public class BasicBranchUnit extends Object implements BranchUnit
| Modifier and Type | Field and Description |
|---|---|
protected InstructionOffsetValue |
traceBranchTargets |
protected boolean |
wasCalled |
| Constructor and Description |
|---|
BasicBranchUnit() |
| Modifier and Type | Method and Description |
|---|---|
void |
branch(Clazz clazz,
CodeAttribute codeAttribute,
int offset,
int branchTarget)
Sets the new instruction offset.
|
void |
branchConditionally(Clazz clazz,
CodeAttribute codeAttribute,
int offset,
int branchTarget,
int conditional)
Sets the new instruction offset, depending on the certainty of the
conditional branch.
|
InstructionOffsetValue |
getTraceBranchTargets()
Returns the accumulated branch targets that were passed to the branch
unit methods.
|
void |
reset()
Resets the accumulated branch targets and the flag that tells whether
any of the branch unit methods was called.
|
void |
returnFromMethod()
Returns from the method with the given value.
|
void |
throwException()
Handles the throwing of an exception.
|
boolean |
wasCalled()
Returns whether any of the branch unit methods was called.
|
protected InstructionOffsetValue traceBranchTargets
protected boolean wasCalled
public void reset()
public boolean wasCalled()
public InstructionOffsetValue getTraceBranchTargets()
public void branch(Clazz clazz, CodeAttribute codeAttribute, int offset, int branchTarget)
BranchUnitbranch in interface BranchUnitpublic void branchConditionally(Clazz clazz, CodeAttribute codeAttribute, int offset, int branchTarget, int conditional)
BranchUnitbranchConditionally in interface BranchUnitpublic void returnFromMethod()
BranchUnitreturnFromMethod in interface BranchUnitpublic void throwException()
BranchUnitthrowException in interface BranchUnitCopyright © 2019. All rights reserved.