Package proguard.evaluation
Class BasicBranchUnit
- java.lang.Object
-
- proguard.evaluation.BasicBranchUnit
-
- All Implemented Interfaces:
BranchUnit
public class BasicBranchUnit extends java.lang.Object implements BranchUnit
ThisBranchUnitremembers the branch unit commands that are invoked on it. It doesn't consider conditions when branching.
-
-
Field Summary
Fields Modifier and Type Field Description protected InstructionOffsetValuetraceBranchTargetsprotected booleanwasCalled
-
Constructor Summary
Constructors Constructor Description BasicBranchUnit()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbranch(Clazz clazz, CodeAttribute codeAttribute, int offset, int branchTarget)Sets the new instruction offset.voidbranchConditionally(Clazz clazz, CodeAttribute codeAttribute, int offset, int branchTarget, int conditional)Sets the new instruction offset, depending on the certainty of the conditional branch.InstructionOffsetValuegetTraceBranchTargets()Returns the accumulated branch targets that were passed to the branch unit methods.voidreset()Resets the accumulated branch targets and the flag that tells whether any of the branch unit methods was called.voidreturnFromMethod()Returns from the method with the given value.voidthrowException()Handles the throwing of an exception.booleanwasCalled()Returns whether any of the branch unit methods was called.
-
-
-
Field Detail
-
traceBranchTargets
protected InstructionOffsetValue traceBranchTargets
-
wasCalled
protected boolean wasCalled
-
-
Method Detail
-
reset
public void reset()
Resets the accumulated branch targets and the flag that tells whether any of the branch unit methods was called.
-
wasCalled
public boolean wasCalled()
Returns whether any of the branch unit methods was called.
-
getTraceBranchTargets
public InstructionOffsetValue getTraceBranchTargets()
Returns the accumulated branch targets that were passed to the branch unit methods.
-
branch
public void branch(Clazz clazz, CodeAttribute codeAttribute, int offset, int branchTarget)
Description copied from interface:BranchUnitSets the new instruction offset.- Specified by:
branchin interfaceBranchUnit
-
branchConditionally
public void branchConditionally(Clazz clazz, CodeAttribute codeAttribute, int offset, int branchTarget, int conditional)
Description copied from interface:BranchUnitSets the new instruction offset, depending on the certainty of the conditional branch.- Specified by:
branchConditionallyin interfaceBranchUnit
-
returnFromMethod
public void returnFromMethod()
Description copied from interface:BranchUnitReturns from the method with the given value.- Specified by:
returnFromMethodin interfaceBranchUnit
-
throwException
public void throwException()
Description copied from interface:BranchUnitHandles the throwing of an exception.- Specified by:
throwExceptionin interfaceBranchUnit
-
-