|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectproguard.classfile.util.SimplifiedVisitor
proguard.optimize.peephole.BranchTargetFinder
public class BranchTargetFinder
This AttributeVisitor finds all instruction offsets, branch targets, and exception targets in the CodeAttribute objects that it visits.
| Field Summary | |
|---|---|
static int |
AT_METHOD_ENTRY
|
static int |
NONE
|
| Constructor Summary | |
|---|---|
BranchTargetFinder()
|
|
| Method Summary | |
|---|---|
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)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface proguard.classfile.instruction.visitor.InstructionVisitor |
|---|
visitLookUpSwitchInstruction, visitTableSwitchInstruction |
| Methods inherited from interface proguard.classfile.constant.visitor.ConstantVisitor |
|---|
visitClassConstant, visitDoubleConstant, visitFieldrefConstant, visitFloatConstant, visitIntegerConstant, visitInterfaceMethodrefConstant, visitLongConstant, visitNameAndTypeConstant, visitStringConstant, visitUtf8Constant |
| Field Detail |
|---|
public static final int NONE
public static final int AT_METHOD_ENTRY
| Constructor Detail |
|---|
public BranchTargetFinder()
| Method Detail |
|---|
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 void visitAnyAttribute(Clazz clazz,
Attribute attribute)
SimplifiedVisitor
visitAnyAttribute in class SimplifiedVisitor
public void visitCodeAttribute(Clazz clazz,
Method method,
CodeAttribute codeAttribute)
visitCodeAttribute in interface AttributeVisitorvisitCodeAttribute in class SimplifiedVisitor
public void visitSimpleInstruction(Clazz clazz,
Method method,
CodeAttribute codeAttribute,
int offset,
SimpleInstruction simpleInstruction)
visitSimpleInstruction in interface InstructionVisitorvisitSimpleInstruction in class SimplifiedVisitor
public void visitConstantInstruction(Clazz clazz,
Method method,
CodeAttribute codeAttribute,
int offset,
ConstantInstruction constantInstruction)
visitConstantInstruction in interface InstructionVisitorvisitConstantInstruction in class SimplifiedVisitor
public void visitVariableInstruction(Clazz clazz,
Method method,
CodeAttribute codeAttribute,
int offset,
VariableInstruction variableInstruction)
visitVariableInstruction in interface InstructionVisitorvisitVariableInstruction in class SimplifiedVisitor
public void visitBranchInstruction(Clazz clazz,
Method method,
CodeAttribute codeAttribute,
int offset,
BranchInstruction branchInstruction)
visitBranchInstruction in interface InstructionVisitorvisitBranchInstruction in class SimplifiedVisitor
public void visitAnySwitchInstruction(Clazz clazz,
Method method,
CodeAttribute codeAttribute,
int offset,
SwitchInstruction switchInstruction)
SimplifiedVisitor
visitAnySwitchInstruction in class SimplifiedVisitor
public void visitAnyConstant(Clazz clazz,
Constant constant)
visitAnyConstant in class SimplifiedVisitor
public void visitMethodrefConstant(Clazz clazz,
MethodrefConstant methodrefConstant)
visitMethodrefConstant in interface ConstantVisitorvisitMethodrefConstant in class SimplifiedVisitor
public void visitExceptionInfo(Clazz clazz,
Method method,
CodeAttribute codeAttribute,
ExceptionInfo exceptionInfo)
visitExceptionInfo in interface ExceptionInfoVisitor
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||