public abstract class Call
extends java.lang.Object
Method
that is present in the class
pool, a ConcreteCall
is instantiated. If the call target is not a known method, a SymbolicCall
is the appropriate subclass.Modifier and Type | Field and Description |
---|---|
CodeLocation |
caller
The location where the call was invoked.
|
boolean |
controlFlowDependent
If false, control flow in the calling method will always reach this call.
|
Instruction |
instruction
The instruction performing this call.
|
boolean |
runtimeTypeDependent
If true, this call might only be one of several alternative targets, depending on the actual
type of the called object during runtime.
|
int |
throwsNullptr
Describes whether this call will throw a
NullPointerException at runtime. |
Modifier | Constructor and Description |
---|---|
protected |
Call(CodeLocation caller,
Value instance,
java.util.List<Value> arguments,
Value returnValue,
int throwsNullptr,
Instruction instruction,
boolean controlFlowDependent,
boolean runtimeTypeDependent) |
Modifier and Type | Method and Description |
---|---|
void |
clearValues()
Clear all
Value object references from this call. |
boolean |
equals(java.lang.Object o) |
Value |
getArgument(int index)
Get the value for a specific argument index.
|
int |
getArgumentCount()
Returns the number of arguments.
|
Value |
getInstance()
If this is a virtual call, this describes the
this pointer of the object whose
method is called, usually an IdentifiedReferenceValue . |
int |
getJvmArgumentSize()
Returns the number of elements that need to be popped from the JVM stack for this call.
|
Value |
getReturnValue()
Get the return value of this call.
|
abstract MethodSignature |
getTarget()
The
MethodSignature of the method that is being called. |
int |
hashCode() |
abstract boolean |
hasIncompleteTarget()
Check if this call's target is fully known or only parts of it (e.g.
|
boolean |
isCertainlyCalled()
Returns true if this call is always executed, no matter which branch in the methods are taken
and which type the called object has during runtime.
|
boolean |
isStatic()
Check if this call is static (no implicit
instance set) or not. |
void |
setArguments(java.util.List<Value> arguments) |
void |
setInstance(Value instance) |
void |
setReturnValue(Value returnValue) |
void |
targetMethodAccept(MemberVisitor memberVisitor) |
java.lang.String |
toSimpleString()
Prints a shorter version of the regular `toString()` without the caller or null pointer
information.
|
java.lang.String |
toString() |
public final CodeLocation caller
public final int throwsNullptr
NullPointerException
at runtime. Either Value.NEVER
, Value.MAYBE
or Value.ALWAYS
.public final Instruction instruction
Instruction.OP_INVOKESTATIC
Instruction.OP_INVOKEVIRTUAL
Instruction.OP_INVOKEINTERFACE
Instruction.OP_INVOKESPECIAL
Instruction.OP_INVOKEDYNAMIC
CallResolver
for more details.public final boolean controlFlowDependent
public final boolean runtimeTypeDependent
protected Call(CodeLocation caller, Value instance, java.util.List<Value> arguments, Value returnValue, int throwsNullptr, Instruction instruction, boolean controlFlowDependent, boolean runtimeTypeDependent)
public boolean isStatic()
instance
set) or not.public abstract MethodSignature getTarget()
MethodSignature
of the method that is being called.public abstract boolean hasIncompleteTarget()
public int getArgumentCount()
public int getJvmArgumentSize()
public Value getArgument(int index)
Note: This is only to be used in implementations of CallVisitor.visitCall(Call)
. Afterwards, the values will have been cleared to reduce
unnecessary memory usage, as argument values are not needed for the full call graph
reconstruction.
public void setArguments(java.util.List<Value> arguments)
public Value getInstance()
this
pointer of the object whose
method is called, usually an IdentifiedReferenceValue
. For static calls this is null.
Note: This is only to be used in implementations of CallVisitor.visitCall(Call)
. Afterwards, the value will have been cleared to reduce
unnecessary memory usage, as the instance value is not needed for the full call graph
reconstruction.
public void setInstance(Value instance)
public Value getReturnValue()
Note: This is only to be used in implementations of CallVisitor.visitCall(Call)
. Afterwards, the value will have been cleared to reduce
unnecessary memory usage, as the return value is not needed for the full call graph
reconstruction.
public void setReturnValue(Value returnValue)
public void clearValues()
Value
object references from this call.public boolean isCertainlyCalled()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toSimpleString()
public void targetMethodAccept(MemberVisitor memberVisitor)
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object