public abstract class JVMReturnInstruction extends ReturnInstruction implements JVMInstruction
Modifier and Type | Field and Description |
---|---|
protected StackFrame |
returnFrame |
attr, insnIndex, mi, position
Constructor and Description |
---|
JVMReturnInstruction() |
Modifier and Type | Method and Description |
---|---|
void |
accept(JVMInstructionVisitor insVisitor) |
void |
addReturnAttr(ThreadInfo ti,
java.lang.Object attr) |
void |
cleanupTransients()
this is important since keeping the StackFrame alive would be a major
memory leak
|
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 abstract void |
getAndSaveReturnValue(StackFrame frame) |
<T> T |
getNextReturnAttr(ThreadInfo ti,
java.lang.Class<T> type,
java.lang.Object prev) |
java.lang.Object |
getReturnAttr(ThreadInfo ti)
this returns all of them - use either if you know there will be only
one attribute at a time, or check/process result with ObjectList
obviously, this only makes sense from an instructionExecuted(), since
the value is pushed during the enter().
|
<T> T |
getReturnAttr(ThreadInfo ti,
java.lang.Class<T> type)
this only returns the first attr of this type, there can be more
if you don't use client private types or the provided type is too general
|
protected abstract java.lang.Object |
getReturnedOperandAttr(StackFrame frame) |
StackFrame |
getReturnFrame() |
abstract int |
getReturnTypeSize() |
abstract java.lang.Object |
getReturnValue(ThreadInfo ti) |
boolean |
hasReturnAttr(ThreadInfo ti) |
boolean |
hasReturnAttr(ThreadInfo ti,
java.lang.Class<?> type) |
protected abstract void |
pushReturnValue(StackFrame frame) |
java.util.Iterator<?> |
returnAttrIterator(ThreadInfo ti) |
<T> java.util.Iterator<T> |
returnAttrIterator(ThreadInfo ti,
java.lang.Class<T> type) |
void |
setReturnAttr(ThreadInfo ti,
java.lang.Object a)
this replaces all of them - use only if you know
- there will be only one attribute at a time
- you obtained the value you set by a previous getXAttr()
- you constructed a multi value list with ObjectList.createList()
we don't clone since pushing a return value already changed the caller frame
|
void |
setReturnFrame(StackFrame frame) |
java.lang.String |
toPostExecString()
this can contain additional info that was gathered/cached during execution
|
addAttr, asInstruction, attrIterator, attrIterator, getAttr, getAttr, getFileLocation, getFilePos, getInstructionIndex, getLength, getLineNumber, getMethodInfo, getMnemonic, getNext, getNext, getNextAttr, getPosition, getPrev, getSourceLine, getSourceLocation, getSourceOrLocation, hasAttr, hasAttr, init, isBackJump, isCompleted, isExtendedInstruction, isFirstInstruction, isMonitorEnterPrologue, isSchedulingRelevant, removeAttr, replaceAttr, requiresClinitExecution, setAttr, setContext, setLocation, setMethodInfo, toString, typeSafeClone
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
asInstruction, getByteCode, getFileLocation, getFilePos, getInstructionIndex, getLength, getLineNumber, getMethodInfo, getMnemonic, getNext, getNext, getPosition, getPrev, getSourceLine, getSourceLocation, isBackJump, isCompleted, isExtendedInstruction, isFirstInstruction
addAttr, attrIterator, attrIterator, getAttr, getAttr, getNextAttr, hasAttr, hasAttr, removeAttr, replaceAttr, setAttr
protected StackFrame returnFrame
public abstract int getReturnTypeSize()
protected abstract java.lang.Object getReturnedOperandAttr(StackFrame frame)
protected abstract void getAndSaveReturnValue(StackFrame frame)
protected abstract void pushReturnValue(StackFrame frame)
public abstract java.lang.Object getReturnValue(ThreadInfo ti)
public StackFrame getReturnFrame()
public void setReturnFrame(StackFrame frame)
public void cleanupTransients()
cleanupTransients
in class Instruction
public boolean hasReturnAttr(ThreadInfo ti)
public boolean hasReturnAttr(ThreadInfo ti, java.lang.Class<?> type)
public java.lang.Object getReturnAttr(ThreadInfo ti)
public void setReturnAttr(ThreadInfo ti, java.lang.Object a)
public void addReturnAttr(ThreadInfo ti, java.lang.Object attr)
public <T> T getReturnAttr(ThreadInfo ti, java.lang.Class<T> type)
public <T> T getNextReturnAttr(ThreadInfo ti, java.lang.Class<T> type, java.lang.Object prev)
public java.util.Iterator<?> returnAttrIterator(ThreadInfo ti)
public <T> java.util.Iterator<T> returnAttrIterator(ThreadInfo ti, java.lang.Class<T> type)
public Instruction execute(ThreadInfo ti)
Instruction
execute
in interface InstructionInterface
execute
in class Instruction
public void accept(JVMInstructionVisitor insVisitor)
accept
in interface JVMInstruction
public java.lang.String toPostExecString()
Instruction
toPostExecString
in interface InstructionInterface
toPostExecString
in class Instruction