public abstract class InvokeInstruction extends JVMInstruction
Modifier and Type | Field and Description |
---|---|
protected int |
argSize |
protected Object[] |
arguments |
protected String |
cname |
protected MethodInfo |
invokedMethod
watch out - this is only const for static and special invocation
all virtuals will use it only as a cache
|
protected int |
lastObj
to cache the last callee object
|
protected String |
mname |
protected String |
signature |
attr, insnIndex, mi, position
Modifier | Constructor and Description |
---|---|
protected |
InvokeInstruction() |
protected |
InvokeInstruction(String clsName,
String methodName,
String signature) |
Modifier and Type | Method and Description |
---|---|
void |
accept(InstructionVisitor insVisitor) |
protected boolean |
checkSyncCG(ElementInfo ei,
ThreadInfo ti) |
int |
getArgSize() |
Object[] |
getArgumentAttrs(ThreadInfo ti) |
Object |
getArgumentValue(String id,
ThreadInfo ti)
<2do> - this relies on same order of arguments and LocalVariableTable entries, which
seems to hold for javac, but is not required by the VM spec, which only
says that arguments are stored in consecutive slots starting at 0
|
Object[] |
getArgumentValues(ThreadInfo ti)
this is a little helper to find out about call argument values from listeners that
don't want to dig through MethodInfos and Types.
|
Object |
getFieldOrArgumentValue(String id,
ThreadInfo ti) |
abstract Object |
getFieldValue(String id,
ThreadInfo ti) |
MethodInfo |
getInvokedMethod() |
abstract MethodInfo |
getInvokedMethod(ThreadInfo ti) |
String |
getInvokedMethodClassName()
be aware of that this might differ from getInvokedMethod(), since it only
denotes the target type info we have at the static point of the call, i.e.
|
String |
getInvokedMethodName() |
String |
getInvokedMethodSignature() |
int |
getLastObjRef() |
int |
getLength()
return the length in bytes of this instruction.
|
int |
getReturnType() |
String |
getReturnTypeName() |
boolean |
hasArgumentAttr(ThreadInfo ti,
Class<?> type)
check if there is any argument attr of the specified type
(use this before using any of the more expensive retrievers)
|
boolean |
hasAttrRefArgument(ThreadInfo ti,
Class<?> type)
do we have a reference argument that has an object attribute?
less efficient, but still without object creation
|
boolean |
isCompleted(ThreadInfo ti)
this is for listeners that process instructionExecuted(), but need to
determine if there was a CG registration, an overlayed direct call
(like clinit) etc.
|
boolean |
isReferenceReturnType() |
void |
setInvokedMethod(String clsName,
String mthName,
String sig)
this is for explicit initialization (not BCEL)
|
protected void |
setupCallee(ThreadInfo ti,
MethodInfo callee) |
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, execute, getAttr, getAttr, getByteCode, getFileLocation, getFilePos, getInstructionIndex, getLineNumber, getMethodInfo, getMnemonic, getNext, getNext, getNextAttr, getPosition, getPrev, getSourceLine, getSourceLocation, getSourceOrLocation, hasAttr, hasAttr, init, isBackJump, isExtendedInstruction, isFirstInstruction, isSchedulingRelevant, removeAttr, replaceAttr, requiresClinitExecution, setAttr, setContext, setLocation, setMethodInfo, toString
protected String cname
protected String mname
protected String signature
protected int argSize
protected int lastObj
protected MethodInfo invokedMethod
protected Object[] arguments
public int getLength()
Instruction
getLength
in class Instruction
public int getLastObjRef()
public void setInvokedMethod(String clsName, String mthName, String sig)
public String getInvokedMethodClassName()
public String getInvokedMethodSignature()
public String getInvokedMethodName()
public abstract MethodInfo getInvokedMethod(ThreadInfo ti)
public MethodInfo getInvokedMethod()
public boolean isCompleted(ThreadInfo ti)
Instruction
isCompleted
in class Instruction
protected void setupCallee(ThreadInfo ti, MethodInfo callee)
public Object[] getArgumentValues(ThreadInfo ti)
public Object[] getArgumentAttrs(ThreadInfo ti)
public boolean hasArgumentAttr(ThreadInfo ti, Class<?> type)
public boolean hasAttrRefArgument(ThreadInfo ti, Class<?> type)
public int getArgSize()
public int getReturnType()
public boolean isReferenceReturnType()
public String getReturnTypeName()
public Object getFieldOrArgumentValue(String id, ThreadInfo ti)
public abstract Object getFieldValue(String id, ThreadInfo ti)
public Object getArgumentValue(String id, ThreadInfo ti)
protected boolean checkSyncCG(ElementInfo ei, ThreadInfo ti)
public void accept(InstructionVisitor insVisitor)
public Instruction typeSafeClone(MethodInfo mi)
Instruction
typeSafeClone
in class Instruction