public abstract class IfInstruction extends Instruction implements 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(JVMInstructionVisitor 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)
|
java.lang.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, asInstruction, attrIterator, attrIterator, cleanupTransients, getAttr, getAttr, getFileLocation, getFilePos, getInstructionIndex, getLineNumber, getMethodInfo, getMnemonic, getNext, getNext, getNextAttr, getPosition, getPrev, getSourceLine, getSourceLocation, getSourceOrLocation, hasAttr, hasAttr, init, isCompleted, isExtendedInstruction, isFirstInstruction, isMonitorEnterPrologue, isSchedulingRelevant, removeAttr, replaceAttr, requiresClinitExecution, setAttr, setContext, setLocation, setMethodInfo, toPostExecStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitasInstruction, getByteCode, getFileLocation, getFilePos, getInstructionIndex, getLineNumber, getMethodInfo, getMnemonic, getNext, getNext, getPosition, getPrev, getSourceLine, getSourceLocation, isCompleted, isExtendedInstruction, isFirstInstruction, toPostExecStringaddAttr, attrIterator, attrIterator, getAttr, getAttr, getNextAttr, hasAttr, hasAttr, removeAttr, replaceAttr, setAttrprotected int targetPosition
protected Instruction target
protected boolean conditionValue
protected IfInstruction(int targetPosition)
public boolean getConditionValue()
public boolean isBackJump()
isBackJump in interface InstructionInterfaceisBackJump in class Instructionpublic abstract boolean popConditionValue(StackFrame frame)
public Instruction getTarget()
public Instruction execute(ThreadInfo ti)
Instructionexecute in interface InstructionInterfaceexecute in class Instructionprotected Instruction executeBothBranches(SystemState ss, KernelState ks, ThreadInfo ti)
public java.lang.String toString()
toString in class Instructionpublic int getLength()
InstructiongetLength in interface InstructionInterfacegetLength in class Instructionpublic void accept(JVMInstructionVisitor insVisitor)
accept in interface JVMInstructionpublic Instruction typeSafeClone(MethodInfo mi)
InstructiontypeSafeClone in class Instruction