Package com.ibm.wala.ipa.callgraph.impl
Class AbstractRootMethod
- java.lang.Object
-
- com.ibm.wala.classLoader.SyntheticMethod
-
- com.ibm.wala.ipa.callgraph.impl.AbstractRootMethod
-
- All Implemented Interfaces:
IMember
,IMethod
,ContextItem
,IClassHierarchyDweller
- Direct Known Subclasses:
AstCallGraph.AstFakeRoot
,DexFakeRootMethod
,FakeRootMethod
,FakeWorldClinitMethod
public abstract class AbstractRootMethod extends SyntheticMethod
A synthetic method from theFakeRootClass
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.ibm.wala.ipa.callgraph.ContextItem
ContextItem.Value<T>
-
Nested classes/interfaces inherited from interface com.ibm.wala.classLoader.IMethod
IMethod.SourcePosition
-
-
Field Summary
Fields Modifier and Type Field Description protected AnalysisCache
cache
protected IClassHierarchy
cha
protected SSAInstructionFactory
insts
protected int
nextLocal
The number of the next local value number available for the fake root method.protected ArrayList<SSAInstruction>
statements
-
Fields inherited from class com.ibm.wala.classLoader.SyntheticMethod
declaringClass, NO_STATEMENTS, resolvedMethod
-
-
Constructor Summary
Constructors Constructor Description AbstractRootMethod(MethodReference method, IClass declaringClass, IClassHierarchy cha, AnalysisOptions options, AnalysisCache cache)
AbstractRootMethod(MethodReference method, IClassHierarchy cha, AnalysisOptions options, AnalysisCache cache)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SSANewInstruction
add1DArrayAllocation(TypeReference T, int length)
Add a New statement of the given array type and lengthSSANewInstruction
addAllocation(TypeReference T)
Add a New statement of the given type Side effect: adds call to default constructor of given type if one exists.SSANewInstruction
addAllocationWithoutCtor(TypeReference T)
Add a New statement of the given typeint
addCheckcast(TypeReference[] types, int rv, boolean isPEI)
int
addGetArrayField(TypeReference elementType, int baseObject, int indexValue)
int
addGetInstance(FieldReference ref, int object)
int
addGetStatic(FieldReference ref)
SSAInvokeInstruction
addInvocation(int[] params, CallSiteReference site)
int
addLocal()
int
addPhi(int[] values)
SSAReturnInstruction
addReturn(int vn, boolean isPrimitive)
Add a return statementvoid
addSetArrayField(TypeReference elementType, int baseObject, int indexValue, int value)
void
addSetInstance(FieldReference ref, int baseObject, int value)
void
addSetStatic(FieldReference ref, int value)
RTAContextInterpreter
getInterpreter()
SSAInstruction[]
getStatements(SSAOptions options)
protected int
getValueNumberForByteConstant(byte c)
protected int
getValueNumberForCharConstant(char c)
protected int
getValueNumberForIntConstant(int c)
IR
makeIR(Context context, SSAOptions options)
Most subclasses should override this.-
Methods inherited from class com.ibm.wala.classLoader.SyntheticMethod
equals, getAnnotations, getBytecodeStream, getClassHierarchy, getDeclaredExceptions, getDeclaringClass, getDescriptor, getLineNumber, getLocalVariableName, getMaxLocals, getMaxStackHeight, getName, getNumberOfParameters, getParameterSourcePosition, getParameterType, getPoison, getPoisonLevel, getReference, getReturnType, getSelector, getSignature, getSourcePosition, getStatements, hasExceptionHandler, hashCode, hasLocalVariableTable, hasPoison, isAbstract, isBridge, isClinit, isFactoryMethod, isFinal, isInit, isNative, isPrivate, isProtected, isPublic, isStatic, isSynchronized, isSynthetic, makeControlFlowGraph, toString
-
-
-
-
Field Detail
-
statements
protected final ArrayList<SSAInstruction> statements
-
nextLocal
protected int nextLocal
The number of the next local value number available for the fake root method. Note that we reserve value number 1 to represent the value "any exception caught by the root method"
-
cha
protected final IClassHierarchy cha
-
cache
protected final AnalysisCache cache
-
insts
protected final SSAInstructionFactory insts
-
-
Constructor Detail
-
AbstractRootMethod
public AbstractRootMethod(MethodReference method, IClass declaringClass, IClassHierarchy cha, AnalysisOptions options, AnalysisCache cache)
-
AbstractRootMethod
public AbstractRootMethod(MethodReference method, IClassHierarchy cha, AnalysisOptions options, AnalysisCache cache)
-
-
Method Detail
-
getStatements
public SSAInstruction[] getStatements(SSAOptions options)
- Overrides:
getStatements
in classSyntheticMethod
-
makeIR
public IR makeIR(Context context, SSAOptions options)
Description copied from class:SyntheticMethod
Most subclasses should override this.- Overrides:
makeIR
in classSyntheticMethod
- Parameters:
context
- TODOoptions
- options governing IR conversion
-
addLocal
public int addLocal()
-
addInvocation
public SSAInvokeInstruction addInvocation(int[] params, CallSiteReference site)
- Returns:
- the invoke instructions added by this operation
- Throws:
IllegalArgumentException
- if site is null
-
addReturn
public SSAReturnInstruction addReturn(int vn, boolean isPrimitive)
Add a return statement
-
addAllocation
public SSANewInstruction addAllocation(TypeReference T)
Add a New statement of the given type Side effect: adds call to default constructor of given type if one exists.- Returns:
- instruction added, or null
- Throws:
IllegalArgumentException
- if T is null
-
add1DArrayAllocation
public SSANewInstruction add1DArrayAllocation(TypeReference T, int length)
Add a New statement of the given array type and length
-
addAllocationWithoutCtor
public SSANewInstruction addAllocationWithoutCtor(TypeReference T)
Add a New statement of the given type
-
getValueNumberForIntConstant
protected int getValueNumberForIntConstant(int c)
-
getValueNumberForByteConstant
protected int getValueNumberForByteConstant(byte c)
-
getValueNumberForCharConstant
protected int getValueNumberForCharConstant(char c)
-
addPhi
public int addPhi(int[] values)
-
addGetInstance
public int addGetInstance(FieldReference ref, int object)
-
addGetStatic
public int addGetStatic(FieldReference ref)
-
addCheckcast
public int addCheckcast(TypeReference[] types, int rv, boolean isPEI)
-
addSetInstance
public void addSetInstance(FieldReference ref, int baseObject, int value)
-
addSetStatic
public void addSetStatic(FieldReference ref, int value)
-
addSetArrayField
public void addSetArrayField(TypeReference elementType, int baseObject, int indexValue, int value)
-
addGetArrayField
public int addGetArrayField(TypeReference elementType, int baseObject, int indexValue)
-
getInterpreter
public RTAContextInterpreter getInterpreter()
-
-