public class BranchTargetFinder extends SimplifiedVisitor implements AttributeVisitor, InstructionVisitor, ExceptionInfoVisitor, ConstantVisitor
| Modifier and Type | Field and Description |
|---|---|
static int |
NO_SUBROUTINE |
static int |
NONE |
static int |
UNKNOWN |
| Constructor and Description |
|---|
BranchTargetFinder() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
containsSubroutines()
Returns whether the method contains subroutines, in the CodeAttribute
that was visited most recently.
|
int |
creationOffset(int offset)
Returns the offset of the 'new' instruction that corresponds to the
invocation of the instance initializer at the given offset, or
AT_METHOD_ENTRY if the invocation is calling the "super" or
"this" initializer method, , or NONE if it is not a 'new'
instruction. |
int |
initializationOffset(int offset)
Returns the instruction offset at which the object instance that is
created at the given 'new' instruction offset is initialized, or
NONE if it is not being created. |
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.
|
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.
|
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.
|
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.
|
boolean |
isExceptionHandler(int offset)
Returns whether the instruction at the given offset is the start of an
exception catch block in the CodeAttribute that was visited most recently.
|
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.
|
boolean |
isInitializer()
Returns whether the method is an instance initializer, in the
CodeAttribute that was visited most recently.
|
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.
|
boolean |
isInstruction(int offset)
Returns whether there is an instruction at the given offset in the
CodeAttribute that was visited most recently.
|
boolean |
isNew(int offset)
Returns whether the instruction at the given offset is a 'new'
instruction, in the CodeAttribute that was visited most recently.
|
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.
|
boolean |
isSubroutineInvocation(int offset)
Returns whether the instruction at the given offset is a subroutine
invocation in the CodeAttribute that was visited most recently.
|
boolean |
isSubroutineReturning(int offset)
Returns whether the subroutine at the given offset is ever returning
by means of a regular 'ret' instruction.
|
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.
|
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.
|
int |
subroutineEnd(int offset)
Returns the offset after the subroutine at the given offset, in the
CodeAttribute that was visited most recently.
|
int |
subroutineStart(int offset)
Returns the start offset of the subroutine at the given offset, in the
CodeAttribute that was visited most recently.
|
int |
superInitializationOffset()
Returns the instruction offset at which this initializer is calling
the "super" or "this" initializer method, or
NONE if it is
not an initializer. |
void |
visitAnyAttribute(Clazz clazz,
Attribute attribute)
Visit any type of attribute.
|
void |
visitAnyConstant(Clazz clazz,
Constant constant) |
void |
visitAnySwitchInstruction(Clazz clazz,
Method method,
CodeAttribute codeAttribute,
int offset,
SwitchInstruction switchInstruction)
Visits either type of SwitchInstruction.
|
void |
visitBranchInstruction(Clazz clazz,
Method method,
CodeAttribute codeAttribute,
int offset,
BranchInstruction branchInstruction) |
void |
visitCodeAttribute(Clazz clazz,
Method method,
CodeAttribute codeAttribute) |
void |
visitConstantInstruction(Clazz clazz,
Method method,
CodeAttribute codeAttribute,
int offset,
ConstantInstruction constantInstruction) |
void |
visitExceptionInfo(Clazz clazz,
Method method,
CodeAttribute codeAttribute,
ExceptionInfo exceptionInfo) |
void |
visitMethodrefConstant(Clazz clazz,
MethodrefConstant methodrefConstant) |
void |
visitSimpleInstruction(Clazz clazz,
Method method,
CodeAttribute codeAttribute,
int offset,
SimpleInstruction simpleInstruction) |
void |
visitVariableInstruction(Clazz clazz,
Method method,
CodeAttribute codeAttribute,
int offset,
VariableInstruction variableInstruction) |
visitAnnotation, visitAnnotation, visitAnnotation, visitAnnotation, visitAnnotation, visitAnnotation, visitAnnotationDefaultAttribute, visitAnnotationElementValue, visitAnyAnnotationsAttribute, visitAnyClass, visitAnyElementValue, visitAnyInstruction, visitAnyMember, visitAnyMethodrefConstant, visitAnyParameterAnnotationsAttribute, visitAnyRefConstant, visitAnyStackMapFrame, visitAnyTargetInfo, visitAnyTypeAnnotationsAttribute, visitAnyVerificationType, visitArrayElementValue, visitBootstrapMethodsAttribute, visitCatchTargetInfo, visitClassConstant, visitClassElementValue, visitConstantElementValue, visitConstantValueAttribute, visitDeprecatedAttribute, visitDeprecatedAttribute, visitDeprecatedAttribute, visitDeprecatedAttribute, visitDoubleConstant, visitDoubleType, visitEmptyTargetInfo, visitEmptyTargetInfo, visitEmptyTargetInfo, visitEnclosingMethodAttribute, visitEnumConstantElementValue, visitExceptionsAttribute, visitFieldrefConstant, visitFloatConstant, visitFloatType, visitFormalParameterTargetInfo, visitFullFrame, visitInnerClassesAttribute, visitIntegerConstant, visitIntegerType, visitInterfaceMethodrefConstant, visitInvokeDynamicConstant, visitLessZeroFrame, visitLibraryClass, visitLibraryField, visitLibraryMember, visitLibraryMethod, visitLineNumberTableAttribute, visitLocalVariableTableAttribute, visitLocalVariableTargetInfo, visitLocalVariableTypeTableAttribute, visitLongConstant, visitLongType, visitLookUpSwitchInstruction, visitMethodHandleConstant, visitMethodParametersAttribute, visitMethodTypeConstant, visitMoreZeroFrame, visitNameAndTypeConstant, visitNullType, visitObjectType, visitOffsetTargetInfo, visitProgramClass, visitProgramField, visitProgramMember, visitProgramMethod, visitRuntimeInvisibleAnnotationsAttribute, visitRuntimeInvisibleAnnotationsAttribute, visitRuntimeInvisibleAnnotationsAttribute, visitRuntimeInvisibleAnnotationsAttribute, visitRuntimeInvisibleParameterAnnotationsAttribute, visitRuntimeInvisibleTypeAnnotationsAttribute, visitRuntimeInvisibleTypeAnnotationsAttribute, visitRuntimeInvisibleTypeAnnotationsAttribute, visitRuntimeInvisibleTypeAnnotationsAttribute, visitRuntimeInvisibleTypeAnnotationsAttribute, visitRuntimeVisibleAnnotationsAttribute, visitRuntimeVisibleAnnotationsAttribute, visitRuntimeVisibleAnnotationsAttribute, visitRuntimeVisibleAnnotationsAttribute, visitRuntimeVisibleParameterAnnotationsAttribute, visitRuntimeVisibleTypeAnnotationsAttribute, visitRuntimeVisibleTypeAnnotationsAttribute, visitRuntimeVisibleTypeAnnotationsAttribute, visitRuntimeVisibleTypeAnnotationsAttribute, visitRuntimeVisibleTypeAnnotationsAttribute, visitSameOneFrame, visitSameZeroFrame, visitSignatureAttribute, visitSignatureAttribute, visitSignatureAttribute, visitSignatureAttribute, visitSourceDirAttribute, visitSourceFileAttribute, visitStackDoubleType, visitStackFloatType, visitStackIntegerType, visitStackLongType, visitStackMapAttribute, visitStackMapTableAttribute, visitStackNullType, visitStackObjectType, visitStackTopType, visitStackUninitializedThisType, visitStackUninitializedType, visitStringConstant, visitSuperTypeTargetInfo, visitSyntheticAttribute, visitSyntheticAttribute, visitSyntheticAttribute, visitSyntheticAttribute, visitTableSwitchInstruction, visitThrowsTargetInfo, visitTopType, visitTypeAnnotation, visitTypeAnnotation, visitTypeAnnotation, visitTypeAnnotation, visitTypeAnnotation, visitTypeAnnotation, visitTypeArgumentTargetInfo, visitTypeParameterBoundTargetInfo, visitTypeParameterBoundTargetInfo, visitTypeParameterBoundTargetInfo, visitTypeParameterBoundTargetInfo, visitTypeParameterTargetInfo, visitTypeParameterTargetInfo, visitTypePathInfo, visitTypePathInfo, visitTypePathInfo, visitTypePathInfo, visitTypePathInfo, visitUninitializedThisType, visitUninitializedType, visitUnknownAttribute, visitUtf8Constant, visitVariablesDoubleType, visitVariablesFloatType, visitVariablesIntegerType, visitVariablesLongType, visitVariablesNullType, visitVariablesObjectType, visitVariablesTopType, visitVariablesUninitializedThisType, visitVariablesUninitializedTypeclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitvisitAnnotationDefaultAttribute, visitBootstrapMethodsAttribute, visitConstantValueAttribute, visitDeprecatedAttribute, visitDeprecatedAttribute, visitDeprecatedAttribute, visitEnclosingMethodAttribute, visitExceptionsAttribute, visitInnerClassesAttribute, visitLineNumberTableAttribute, visitLocalVariableTableAttribute, visitLocalVariableTypeTableAttribute, visitMethodParametersAttribute, visitRuntimeInvisibleAnnotationsAttribute, visitRuntimeInvisibleAnnotationsAttribute, visitRuntimeInvisibleAnnotationsAttribute, visitRuntimeInvisibleParameterAnnotationsAttribute, visitRuntimeInvisibleTypeAnnotationsAttribute, visitRuntimeInvisibleTypeAnnotationsAttribute, visitRuntimeInvisibleTypeAnnotationsAttribute, visitRuntimeInvisibleTypeAnnotationsAttribute, visitRuntimeVisibleAnnotationsAttribute, visitRuntimeVisibleAnnotationsAttribute, visitRuntimeVisibleAnnotationsAttribute, visitRuntimeVisibleParameterAnnotationsAttribute, visitRuntimeVisibleTypeAnnotationsAttribute, visitRuntimeVisibleTypeAnnotationsAttribute, visitRuntimeVisibleTypeAnnotationsAttribute, visitRuntimeVisibleTypeAnnotationsAttribute, visitSignatureAttribute, visitSignatureAttribute, visitSignatureAttribute, visitSourceDirAttribute, visitSourceFileAttribute, visitStackMapAttribute, visitStackMapTableAttribute, visitSyntheticAttribute, visitSyntheticAttribute, visitSyntheticAttribute, visitUnknownAttributevisitLookUpSwitchInstruction, visitTableSwitchInstructionvisitClassConstant, visitDoubleConstant, visitFieldrefConstant, visitFloatConstant, visitIntegerConstant, visitInterfaceMethodrefConstant, visitInvokeDynamicConstant, visitLongConstant, visitMethodHandleConstant, visitMethodTypeConstant, visitNameAndTypeConstant, visitStringConstant, visitUtf8Constantpublic static final int NONE
public static final int UNKNOWN
public static final int NO_SUBROUTINE
public boolean isInstruction(int offset)
public boolean isTarget(int offset)
public boolean isBranchOrigin(int offset)
public boolean isBranchTarget(int offset)
public boolean isAfterBranch(int offset)
public boolean isExceptionStart(int offset)
public boolean isExceptionEnd(int offset)
public boolean isExceptionHandler(int offset)
public boolean isSubroutineInvocation(int offset)
public boolean isSubroutineStart(int offset)
public boolean isSubroutine(int offset)
public boolean isSubroutineReturning(int offset)
public int subroutineStart(int offset)
public int subroutineEnd(int offset)
public boolean isNew(int offset)
public int initializationOffset(int offset)
NONE if it is not being created.public boolean isInitializer()
public int superInitializationOffset()
NONE if it is
not an initializer.public boolean isInitializer(int offset)
public int creationOffset(int offset)
AT_METHOD_ENTRY if the invocation is calling the "super" or
"this" initializer method, , or NONE if it is not a 'new'
instruction.public boolean containsSubroutines()
public void visitAnyAttribute(Clazz clazz, Attribute attribute)
SimplifiedVisitorvisitAnyAttribute in class SimplifiedVisitorpublic void visitCodeAttribute(Clazz clazz, Method method, CodeAttribute codeAttribute)
visitCodeAttribute in interface AttributeVisitorvisitCodeAttribute in class SimplifiedVisitorpublic void visitSimpleInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, SimpleInstruction simpleInstruction)
visitSimpleInstruction in interface InstructionVisitorvisitSimpleInstruction in class SimplifiedVisitorpublic void visitConstantInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, ConstantInstruction constantInstruction)
visitConstantInstruction in interface InstructionVisitorvisitConstantInstruction in class SimplifiedVisitorpublic void visitVariableInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, VariableInstruction variableInstruction)
visitVariableInstruction in interface InstructionVisitorvisitVariableInstruction in class SimplifiedVisitorpublic void visitBranchInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, BranchInstruction branchInstruction)
visitBranchInstruction in interface InstructionVisitorvisitBranchInstruction in class SimplifiedVisitorpublic void visitAnySwitchInstruction(Clazz clazz, Method method, CodeAttribute codeAttribute, int offset, SwitchInstruction switchInstruction)
SimplifiedVisitorvisitAnySwitchInstruction in class SimplifiedVisitorpublic void visitAnyConstant(Clazz clazz, Constant constant)
visitAnyConstant in class SimplifiedVisitorpublic void visitMethodrefConstant(Clazz clazz, MethodrefConstant methodrefConstant)
visitMethodrefConstant in interface ConstantVisitorvisitMethodrefConstant in class SimplifiedVisitorpublic void visitExceptionInfo(Clazz clazz, Method method, CodeAttribute codeAttribute, ExceptionInfo exceptionInfo)
visitExceptionInfo in interface ExceptionInfoVisitorCopyright © 2015. All Rights Reserved.