public abstract class IfInstruction extends JVMInstruction
Modifier and Type | Field and Description |
---|---|
protected boolean |
conditionValue |
protected Instruction |
target |
protected int |
targetPosition |
attr, insnIndex, mi, position
Modifier | Constructor and Description |
---|---|
protected |
IfInstruction(int targetPosition)
value of last evaluation of branch condition
|
Modifier and Type | Method and Description |
---|---|
void |
accept(InstructionVisitor insVisitor) |
Instruction |
execute(ThreadInfo ti)
this is the real workhorse
returns next instruction to enter in this thread
<2do> it's unfortunate we roll every side effect into this method, because
it diminishes the value of the 'executeInstruction' notification: all
insns that require some sort of late binding (InvokeVirtual, GetField, ..)
are not yet fully analyzable (e.g.
|
protected Instruction |
executeBothBranches(SystemState ss,
KernelState ks,
ThreadInfo ti)
use this as a delegatee in overridden executes of derived IfInstructions
(e.g.
|
boolean |
getConditionValue()
return which branch was taken.
|
int |
getLength()
return the length in bytes of this instruction.
|
Instruction |
getTarget() |
boolean |
isBackJump()
Added so that SimpleIdleFilter can detect do-while loops when
the while statement evaluates to true.
|
abstract boolean |
popConditionValue(StackFrame frame)
retrieve value of jump condition from operand stack
(not ideal to have this public, but some listeners might need it for
skipping the insn, plus we require it for subclass factorization)
|
String |
toString() |
Instruction |
typeSafeClone(MethodInfo mi)
this is overridden by any Instruction that use a cache for class or
method to provide a type safe cloning
|
addAttr, attrIterator, attrIterator, cleanupTransients, getAttr, getAttr, getByteCode, getFileLocation, getFilePos, getInstructionIndex, getLineNumber, getMethodInfo, getMnemonic, getNext, getNext, getNextAttr, getPosition, getPrev, getSourceLine, getSourceLocation, getSourceOrLocation, hasAttr, hasAttr, init, isCompleted, isExtendedInstruction, isFirstInstruction, isSchedulingRelevant, removeAttr, replaceAttr, requiresClinitExecution, setAttr, setContext, setLocation, setMethodInfo
protected int targetPosition
protected Instruction target
protected boolean conditionValue
protected IfInstruction(int targetPosition)
public boolean getConditionValue()
public boolean isBackJump()
isBackJump
in class Instruction
public abstract boolean popConditionValue(StackFrame frame)
public Instruction getTarget()
public Instruction execute(ThreadInfo ti)
Instruction
execute
in class Instruction
protected Instruction executeBothBranches(SystemState ss, KernelState ks, ThreadInfo ti)
public String toString()
toString
in class Instruction
public int getLength()
Instruction
getLength
in class Instruction
public void accept(InstructionVisitor insVisitor)
public Instruction typeSafeClone(MethodInfo mi)
Instruction
typeSafeClone
in class Instruction