public abstract class ReturnInstruction extends JVMInstruction implements ReturnInstruction
Modifier and Type | Field and Description |
---|---|
protected StackFrame |
returnFrame |
attr, insnIndex, mi, position
Constructor and Description |
---|
ReturnInstruction() |
Modifier and Type | Method and Description |
---|---|
void |
accept(InstructionVisitor insVisitor) |
void |
addReturnAttr(ThreadInfo ti,
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,
Class<T> type,
Object prev) |
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,
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 Object |
getReturnedOperandAttr(StackFrame frame) |
StackFrame |
getReturnFrame() |
abstract int |
getReturnTypeSize() |
abstract Object |
getReturnValue(ThreadInfo ti) |
boolean |
hasReturnAttr(ThreadInfo ti) |
boolean |
hasReturnAttr(ThreadInfo ti,
Class<?> type) |
protected abstract void |
pushReturnValue(StackFrame frame) |
Iterator<?> |
returnAttrIterator(ThreadInfo ti) |
<T> Iterator<T> |
returnAttrIterator(ThreadInfo ti,
Class<T> type) |
void |
setReturnAttr(ThreadInfo ti,
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) |
addAttr, attrIterator, attrIterator, getAttr, getAttr, getByteCode, getFileLocation, getFilePos, getInstructionIndex, getLength, getLineNumber, getMethodInfo, getMnemonic, getNext, getNext, getNextAttr, getPosition, getPrev, getSourceLine, getSourceLocation, getSourceOrLocation, hasAttr, hasAttr, init, isBackJump, isCompleted, isExtendedInstruction, isFirstInstruction, isSchedulingRelevant, removeAttr, replaceAttr, requiresClinitExecution, setAttr, setContext, setLocation, setMethodInfo, toString, typeSafeClone
protected StackFrame returnFrame
public abstract int getReturnTypeSize()
protected abstract Object getReturnedOperandAttr(StackFrame frame)
protected abstract void getAndSaveReturnValue(StackFrame frame)
protected abstract void pushReturnValue(StackFrame frame)
public abstract 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, Class<?> type)
public Object getReturnAttr(ThreadInfo ti)
public void setReturnAttr(ThreadInfo ti, Object a)
public void addReturnAttr(ThreadInfo ti, Object attr)
public <T> T getReturnAttr(ThreadInfo ti, Class<T> type)
public <T> T getNextReturnAttr(ThreadInfo ti, Class<T> type, Object prev)
public Iterator<?> returnAttrIterator(ThreadInfo ti)
public <T> Iterator<T> returnAttrIterator(ThreadInfo ti, Class<T> type)
public Instruction execute(ThreadInfo ti)
Instruction
execute
in class Instruction
public void accept(InstructionVisitor insVisitor)
accept
in interface InstructionVisitorAcceptor