类 BranchTargetFinder

java.lang.Object
proguard.classfile.util.BranchTargetFinder
所有已实现的接口:
AttributeVisitor, ExceptionInfoVisitor, ConstantVisitor, InstructionVisitor

public class BranchTargetFinder extends Object implements AttributeVisitor, InstructionVisitor, ExceptionInfoVisitor, ConstantVisitor
This AttributeVisitor finds all instruction offsets, branch targets, and exception targets in the CodeAttribute instances that it visits.
  • 字段详细资料

    • UNKNOWN

      public static final int UNKNOWN
      另请参阅:
    • NO_SUBROUTINE

      public static final int NO_SUBROUTINE
      另请参阅:
  • 构造器详细资料

    • BranchTargetFinder

      public BranchTargetFinder()
  • 方法详细资料

    • isInstruction

      public boolean isInstruction(int offset)
      Returns whether there is an instruction at the given offset in the CodeAttribute that was visited most recently.
    • isCreation

      public boolean isCreation(int offset)
      Returns whether the instruction at the given offset creates a new, uninitialized object instance, in the CodeAttribute that was visited most recently.
    • isInitializer

      public boolean isInitializer(int offset)
      Returns whether the instruction at the given offset is the special invocation of an instance initializer, in the CodeAttribute that was visited most recently.
    • isTarget

      public boolean isTarget(int offset)
      Returns whether the instruction at the given offset is the target of any kind in the CodeAttribute that was visited most recently.
    • isBranchOrigin

      public boolean isBranchOrigin(int offset)
      Returns whether the instruction at the given offset is the origin of a branch instruction in the CodeAttribute that was visited most recently.
    • isBranchTarget

      public boolean isBranchTarget(int offset)
      Returns whether the instruction at the given offset is the target of a branch instruction in the CodeAttribute that was visited most recently.
    • isAfterBranch

      public boolean isAfterBranch(int offset)
      Returns whether the instruction at the given offset comes right after a definite branch instruction in the CodeAttribute that was visited most recently.
    • isExceptionStart

      public boolean isExceptionStart(int offset)
      Returns whether the instruction at the given offset is the start of an exception try block in the CodeAttribute that was visited most recently.
    • isExceptionEnd

      public boolean isExceptionEnd(int offset)
      Returns whether the instruction at the given offset is the end of an exception try block in the CodeAttribute that was visited most recently.
    • isExceptionHandler

      public boolean isExceptionHandler(int offset)
      Returns whether the instruction at the given offset is the start of an exception handler in the CodeAttribute that was visited most recently.
    • isSubroutineInvocation

      public boolean isSubroutineInvocation(int offset)
      Returns whether the instruction at the given offset is a subroutine invocation in the CodeAttribute that was visited most recently.
    • isSubroutineStart

      public boolean isSubroutineStart(int offset)
      Returns whether the instruction at the given offset is the start of a subroutine in the CodeAttribute that was visited most recently.
    • isSubroutine

      public boolean isSubroutine(int offset)
      Returns whether the instruction at the given offset is part of a subroutine in the CodeAttribute that was visited most recently.
    • isSubroutineReturning

      public boolean isSubroutineReturning(int offset)
      Returns whether the subroutine at the given offset is ever returning by means of a regular 'ret' instruction.
    • subroutineStart

      public int subroutineStart(int offset)
      Returns the start offset of the subroutine at the given offset, in the CodeAttribute that was visited most recently.
    • subroutineEnd

      public int subroutineEnd(int offset)
      Returns the offset after the subroutine at the given offset, in the CodeAttribute that was visited most recently.
    • containsSubroutines

      public boolean containsSubroutines()
      Returns whether the method contains subroutines, in the CodeAttribute that was visited most recently.
    • isBranchFallThrough

      public boolean isBranchFallThrough(int offset)
      Return whether the instruction at the given offset is a conditional branch fall-through.
    • isLeader

      public boolean isLeader(int offset)
      Return whether the instruction at the given offset is a leader.
    • visitAnyAttribute

      public void visitAnyAttribute(Clazz clazz, Attribute attribute)
      从接口复制的说明: AttributeVisitor
      Visits any Attribute instance. The more specific default implementations of this interface delegate to this method.
      指定者:
      visitAnyAttribute 在接口中 AttributeVisitor
    • visitCodeAttribute

      public void visitCodeAttribute(Clazz clazz, Method method, CodeAttribute codeAttribute)
      指定者:
      visitCodeAttribute 在接口中 AttributeVisitor
    • visitSimpleInstruction

      public void visitSimpleInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, SimpleInstruction simpleInstruction)
      指定者:
      visitSimpleInstruction 在接口中 InstructionVisitor
    • visitConstantInstruction

      public void visitConstantInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, ConstantInstruction constantInstruction)
      指定者:
      visitConstantInstruction 在接口中 InstructionVisitor
    • visitVariableInstruction

      public void visitVariableInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, VariableInstruction variableInstruction)
      指定者:
      visitVariableInstruction 在接口中 InstructionVisitor
    • visitBranchInstruction

      public void visitBranchInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, BranchInstruction branchInstruction)
      指定者:
      visitBranchInstruction 在接口中 InstructionVisitor
    • visitAnySwitchInstruction

      public void visitAnySwitchInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, SwitchInstruction switchInstruction)
      从接口复制的说明: InstructionVisitor
      Visits any SwitchInstruction instance. The more specific default implementations of this interface delegate to this method.
      指定者:
      visitAnySwitchInstruction 在接口中 InstructionVisitor
    • visitAnyConstant

      public void visitAnyConstant(Clazz clazz, Constant constant)
      从接口复制的说明: ConstantVisitor
      Visits any Constant instance. The more specific default implementations of this interface delegate to this method.
      指定者:
      visitAnyConstant 在接口中 ConstantVisitor
    • visitMethodrefConstant

      public void visitMethodrefConstant(Clazz clazz, MethodrefConstant methodrefConstant)
      指定者:
      visitMethodrefConstant 在接口中 ConstantVisitor
    • visitExceptionInfo

      public void visitExceptionInfo(Clazz clazz, Method method, CodeAttribute codeAttribute, ExceptionInfo exceptionInfo)
      指定者:
      visitExceptionInfo 在接口中 ExceptionInfoVisitor