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 AnalysisCachecacheprotected IClassHierarchychaprotected SSAInstructionFactoryinstsprotected intnextLocalThe 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 SSANewInstructionadd1DArrayAllocation(TypeReference T, int length)Add a New statement of the given array type and lengthSSANewInstructionaddAllocation(TypeReference T)Add a New statement of the given type Side effect: adds call to default constructor of given type if one exists.SSANewInstructionaddAllocationWithoutCtor(TypeReference T)Add a New statement of the given typeintaddCheckcast(TypeReference[] types, int rv, boolean isPEI)intaddGetArrayField(TypeReference elementType, int baseObject, int indexValue)intaddGetInstance(FieldReference ref, int object)intaddGetStatic(FieldReference ref)SSAInvokeInstructionaddInvocation(int[] params, CallSiteReference site)intaddLocal()intaddPhi(int[] values)SSAReturnInstructionaddReturn(int vn, boolean isPrimitive)Add a return statementvoidaddSetArrayField(TypeReference elementType, int baseObject, int indexValue, int value)voidaddSetInstance(FieldReference ref, int baseObject, int value)voidaddSetStatic(FieldReference ref, int value)RTAContextInterpretergetInterpreter()SSAInstruction[]getStatements(SSAOptions options)protected intgetValueNumberForByteConstant(byte c)protected intgetValueNumberForCharConstant(char c)protected intgetValueNumberForIntConstant(int c)IRmakeIR(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:
getStatementsin classSyntheticMethod
-
makeIR
public IR makeIR(Context context, SSAOptions options)
Description copied from class:SyntheticMethodMost subclasses should override this.- Overrides:
makeIRin 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()
-
-