Package com.ibm.wala.ssa
Class SSAAbstractInvokeInstruction
- java.lang.Object
-
- com.ibm.wala.ssa.SSAInstruction
-
- com.ibm.wala.ssa.SSAAbstractInvokeInstruction
-
- Direct Known Subclasses:
MultiReturnValueInvokeInstruction
,SSAInvokeInstruction
public abstract class SSAAbstractInvokeInstruction extends SSAInstruction
A Call instruction. Note that different languages have different notions of what a call is. This is an abstract superclass which encapsulates the common functionality that all languages share, so far.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.ibm.wala.ssa.SSAInstruction
SSAInstruction.IVisitor, SSAInstruction.Visitor
-
-
Field Summary
Fields Modifier and Type Field Description protected int
exception
The value number which represents the exception object which the call may throw.protected CallSiteReference
site
The call site, containing the program counter location and the method being called.-
Fields inherited from class com.ibm.wala.ssa.SSAInstruction
iindex, NO_INDEX
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
SSAAbstractInvokeInstruction(int iindex, int exception, CallSiteReference site)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description CallSiteReference
getCallSite()
TypeReference
getDeclaredResultType()
What is the declared return type of the called methodMethodReference
getDeclaredTarget()
What method is the declared callee?int
getDef()
int
getDef(int i)
Return the ith defint
getException()
Return the value number which is def'fed by this call instruction if the call returns exceptionally.IInvokeInstruction.IDispatch
getInvocationCode()
int
getNumberOfDefs()
abstract int
getNumberOfParameters()
How many parameters does this call specify?abstract int
getNumberOfReturnValues()
How many distinct values does this call return?int
getProgramCounter()
int
getReceiver()
abstract int
getReturnValue(int i)
What is the the value number of the ith value returned by this callboolean
hasDef()
Does this instruction define a normal value, as distinct from a set of exceptions possibly thrown by it (e.g.boolean
isDispatch()
Might this call dispatch to one of several possible methods? i.e., in Java, is it an invokeinterface or invokevirtualboolean
isFallThrough()
boolean
isPEI()
boolean
isSpecial()
Is this a 'special' call? (invokespecial in Java)boolean
isStatic()
Is this a 'static' call? (invokestatic in Java)String
toString(SymbolTable symbolTable)
-
Methods inherited from class com.ibm.wala.ssa.SSAInstruction
copyForSSA, equals, getExceptionTypes, getNumberOfUses, getUse, getValueString, hashCode, toString, visit
-
-
-
-
Field Detail
-
exception
protected final int exception
The value number which represents the exception object which the call may throw.
-
site
protected final CallSiteReference site
The call site, containing the program counter location and the method being called.
-
-
Constructor Detail
-
SSAAbstractInvokeInstruction
protected SSAAbstractInvokeInstruction(int iindex, int exception, CallSiteReference site)
- Parameters:
exception
- The value number which represents the exception object which the call may throw.site
- The call site, containing the program counter location and the method being called.
-
-
Method Detail
-
getCallSite
public CallSiteReference getCallSite()
- Returns:
- The call site, containing the program counter location and the method being called.
-
isStatic
public boolean isStatic()
Is this a 'static' call? (invokestatic in Java)
-
isDispatch
public boolean isDispatch()
Might this call dispatch to one of several possible methods? i.e., in Java, is it an invokeinterface or invokevirtual
-
isSpecial
public boolean isSpecial()
Is this a 'special' call? (invokespecial in Java)
-
getReceiver
public int getReceiver()
- Returns:
- the value number of the receiver of a virtual call
-
getProgramCounter
public int getProgramCounter()
- Returns:
- the program counter (index into the method's bytecode) for this call site.
-
getNumberOfDefs
public int getNumberOfDefs()
- Overrides:
getNumberOfDefs
in classSSAInstruction
-
getDef
public int getDef(int i)
Description copied from class:SSAInstruction
Return the ith def- Overrides:
getDef
in classSSAInstruction
- Parameters:
i
- number of the def, starting at 0.
-
getException
public int getException()
Return the value number which is def'fed by this call instruction if the call returns exceptionally.
-
hasDef
public boolean hasDef()
Description copied from class:SSAInstruction
Does this instruction define a normal value, as distinct from a set of exceptions possibly thrown by it (e.g. for invoke instructions).- Overrides:
hasDef
in classSSAInstruction
- Returns:
- true if the instruction does define a proper value.
-
getDef
public int getDef()
- Overrides:
getDef
in classSSAInstruction
-
getNumberOfParameters
public abstract int getNumberOfParameters()
How many parameters does this call specify?
-
getNumberOfReturnValues
public abstract int getNumberOfReturnValues()
How many distinct values does this call return?
-
getReturnValue
public abstract int getReturnValue(int i)
What is the the value number of the ith value returned by this call
-
getDeclaredResultType
public TypeReference getDeclaredResultType()
What is the declared return type of the called method
-
getDeclaredTarget
public MethodReference getDeclaredTarget()
What method is the declared callee?
-
getInvocationCode
public IInvokeInstruction.IDispatch getInvocationCode()
- See Also:
CallSiteReference.getInvocationCode()
-
isPEI
public boolean isPEI()
- Overrides:
isPEI
in classSSAInstruction
- Returns:
- true iff this instruction may throw an exception.
-
isFallThrough
public boolean isFallThrough()
- Specified by:
isFallThrough
in classSSAInstruction
- Returns:
- true iff this instruction may fall through to the next
-
toString
public String toString(SymbolTable symbolTable)
- Specified by:
toString
in classSSAInstruction
-
-