public abstract class PropagationCallGraphBuilder extends java.lang.Object implements CallGraphBuilder<InstanceKey>
TODO: This implementation currently keeps all points to sets live ... even those for local variables that do not span interprocedural boundaries. This may be too space-inefficient .. we can consider recomputing local sets on demand.
| Modifier and Type | Class and Description |
|---|---|
class |
PropagationCallGraphBuilder.ArrayLoadOperator
Binary op: <dummy>:= ArrayLoad( <arrayref>) Side effect: Creates new equations.
|
class |
PropagationCallGraphBuilder.ArrayStoreOperator
Binary op: <dummy>:= ArrayStore( <arrayref>) Side effect: Creates new equations.
|
class |
PropagationCallGraphBuilder.FilterOperator
The FilterOperator is a filtered set-union.
|
class |
PropagationCallGraphBuilder.GetFieldOperator
Binary op: <dummy>:= GetField( <ref>) Side effect: Creates new equations.
|
class |
PropagationCallGraphBuilder.InstanceArrayStoreOperator
Update the points-to-set for an array contents to include a particular instance key.
|
class |
PropagationCallGraphBuilder.InstancePutFieldOperator
Update the points-to-set for a field to include a particular instance key.
|
protected class |
PropagationCallGraphBuilder.InverseFilterOperator |
protected static class |
PropagationCallGraphBuilder.MutableBoolean |
class |
PropagationCallGraphBuilder.PutFieldOperator
Operator that represents a putfield
|
static class |
PropagationCallGraphBuilder.TypedPointerKey
A pointer key that delegates to an untyped variant, but adds a type filter
|
| Modifier and Type | Field and Description |
|---|---|
static com.ibm.wala.ipa.callgraph.propagation.AssignOperator |
assignOperator
Singleton operator for assignments
|
protected ExplicitCallGraph |
callGraph
The call graph under construction
|
IClassHierarchy |
cha
Governing class hierarchy
|
protected ContextSelector |
contextSelector
A context selector which may use information derived from the propagation-based dataflow.
|
protected static boolean |
DEBUG_GENERAL |
protected java.util.Set<CallSiteReference> |
entrypointCallSites
Set of calls (CallSiteReferences) that are created by entrypoints
|
PropagationCallGraphBuilder.FilterOperator |
filterOperator
singleton operator for filter
|
protected InstanceKeyFactory |
instanceKeyFactory
An object that abstracts how to model instances in the heap.
|
protected PropagationCallGraphBuilder.InverseFilterOperator |
inverseFilterOperator
singleton operator for inverse filter
|
protected AnalysisOptions |
options
Special rules for bypassing Java calls
|
protected PointerKeyFactory |
pointerKeyFactory
Meta-data regarding how pointers are modeled
|
protected PropagationSystem |
system
The system of constraints used to build this graph
|
| Modifier | Constructor and Description |
|---|---|
protected |
PropagationCallGraphBuilder(IMethod abstractRootMethod,
AnalysisOptions options,
IAnalysisCacheView cache,
PointerKeyFactory pointerKeyFactory) |
protected static final boolean DEBUG_GENERAL
protected PointerKeyFactory pointerKeyFactory
public final IClassHierarchy cha
protected final AnalysisOptions options
protected final java.util.Set<CallSiteReference> entrypointCallSites
protected PropagationSystem system
protected final ExplicitCallGraph callGraph
public static final com.ibm.wala.ipa.callgraph.propagation.AssignOperator assignOperator
public final PropagationCallGraphBuilder.FilterOperator filterOperator
protected final PropagationCallGraphBuilder.InverseFilterOperator inverseFilterOperator
protected ContextSelector contextSelector
protected InstanceKeyFactory instanceKeyFactory
protected PropagationCallGraphBuilder(IMethod abstractRootMethod, AnalysisOptions options, IAnalysisCacheView cache, PointerKeyFactory pointerKeyFactory)
options - governing call graph construction optionspointerKeyFactory - factory which embodies pointer abstraction policypublic PropagationSystem getSystem()
protected ExplicitCallGraph createEmptyCallGraph(IMethod abstractRootMethod, AnalysisOptions options)
protected boolean isJavaLangObject(IClass klass)
public CallGraph makeCallGraph(AnalysisOptions options) throws java.lang.IllegalArgumentException, com.ibm.wala.util.CancelException
java.lang.IllegalArgumentExceptioncom.ibm.wala.util.CancelExceptionpublic CallGraph makeCallGraph(AnalysisOptions options, com.ibm.wala.util.MonitorUtil.IProgressMonitor monitor) throws java.lang.IllegalArgumentException, CallGraphBuilderCancelException
CallGraphBuildermakeCallGraph in interface CallGraphBuilder<InstanceKey>options - an object representing controlling options that the call graph building
algorithm needs to know.java.lang.IllegalArgumentExceptionCallGraphBuilderCancelExceptionprotected PropagationSystem makeSystem(AnalysisOptions options)
protected abstract IPointsToSolver makeSolver()
protected void customInit()
protected abstract boolean addConstraintsFromNode(CGNode n, com.ibm.wala.util.MonitorUtil.IProgressMonitor monitor) throws com.ibm.wala.util.CancelException
com.ibm.wala.util.CancelExceptionprotected boolean addConstraintsFromNewNodes(com.ibm.wala.util.MonitorUtil.IProgressMonitor monitor)
throws com.ibm.wala.util.CancelException
com.ibm.wala.util.CancelExceptionpublic PointerKey getPointerKeyForLocal(CGNode node, int valueNumber)
public FilteredPointerKey getFilteredPointerKeyForLocal(CGNode node, int valueNumber, FilteredPointerKey.TypeFilter filter)
public FilteredPointerKey getFilteredPointerKeyForLocal(CGNode node, int valueNumber, IClass filter)
public FilteredPointerKey getFilteredPointerKeyForLocal(CGNode node, int valueNumber, InstanceKey filter)
public PointerKey getPointerKeyForReturnValue(CGNode node)
public PointerKey getPointerKeyForExceptionalReturnValue(CGNode node)
public PointerKey getPointerKeyForStaticField(IField f)
public PointerKey getPointerKeyForInstanceField(InstanceKey I, IField field)
java.lang.IllegalArgumentException - if I is nulljava.lang.IllegalArgumentException - if field is nullpublic PointerKey getPointerKeyForArrayContents(InstanceKey I)
I - an InstanceKey representing an abstract arrayjava.lang.IllegalArgumentException - if I is nullprotected void assignInstanceToCatch(PointerKey exceptionVar, java.util.Set<IClass> catchClasses, InstanceKey e)
exceptionVar - points-to set for a variable representing a caught exceptioncatchClasses - set of TypeReferences that the exceptionVar may catche - a particular exception instanceprotected void addAssignmentsForCatchPointerKey(PointerKey exceptionVar, java.util.Set<IClass> catchClasses, PointerKey e)
exceptionVar - points-to set for a variable representing a caught exceptioncatchClasses - set of TypeReferences that the exceptionVar may catche - points-to-set representing a thrown exception that might be caught.public static boolean catches(java.util.Set<IClass> catchClasses, IClass klass, IClassHierarchy cha)
catchClasses - Set of TypeReferenceklass - an Exception Classjava.lang.IllegalArgumentException - if catchClasses is nullpublic static boolean representsNullType(InstanceKey key) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentExceptionpublic IClassHierarchy getClassHierarchy()
getClassHierarchy in interface CallGraphBuilder<InstanceKey>public AnalysisOptions getOptions()
public IClass getJavaLangObject()
public ExplicitCallGraph getCallGraph()
public void setContextInterpreter(SSAContextInterpreter interpreter)
public PointerAnalysis<InstanceKey> getPointerAnalysis()
getPointerAnalysis in interface CallGraphBuilder<InstanceKey>public PropagationSystem getPropagationSystem()
public PointerKeyFactory getPointerKeyFactory()
public void setPointerKeyFactory(PointerKeyFactory pkFact)
public RTAContextInterpreter getContextInterpreter()
protected CGNode getTargetForCall(CGNode caller, CallSiteReference site, IClass recv, InstanceKey[] iKey)
caller - the caller nodeiKey - an abstraction of the receiver of the call (or null if not applicable)public ContextSelector getContextSelector()
public void setContextSelector(ContextSelector selector)
public InstanceKeyFactory getInstanceKeys()
public void setInstanceKeys(InstanceKeyFactory keys)
public InstanceKey getInstanceKeyForAllocation(CGNode node, NewSiteReference allocation)
public InstanceKey getInstanceKeyForMultiNewArray(CGNode node, NewSiteReference allocation, int dim)
dim - the dimension of the array whose instance we would like to model. dim == 0
represents the first dimension, e.g., the [Object; instances in [[Object; e.g., the
[[Object; instances in [[[Object; dim == 1 represents the second dimension, e.g., the
[Object instances in [[[Object;public <T> InstanceKey getInstanceKeyForConstant(TypeReference type, T S)
public InstanceKey getInstanceKeyForMetadataObject(java.lang.Object obj, TypeReference objType)
public boolean haveAlreadyVisited(CGNode node)
protected void markAlreadyVisited(CGNode node)
public void markDiscovered(CGNode node)
protected void markChanged(CGNode node)
protected boolean wasChanged(CGNode node)
protected com.ibm.wala.util.intset.MutableIntSet getMutableInstanceKeysForClass(IClass klass)
protected com.ibm.wala.util.intset.IntSet getInstanceKeysForClass(IClass klass)
protected com.ibm.wala.util.intset.IntSet filterForClass(com.ibm.wala.util.intset.IntSet S,
IClass klass)
klass - a classprotected IPointsToSolver getSolver()
public void addConstraintsFromChangedNode(CGNode node, com.ibm.wala.util.MonitorUtil.IProgressMonitor monitor) throws com.ibm.wala.util.CancelException
com.ibm.wala.util.CancelExceptionprotected abstract boolean unconditionallyAddConstraintsFromNode(CGNode node, com.ibm.wala.util.MonitorUtil.IProgressMonitor monitor) throws com.ibm.wala.util.CancelException
com.ibm.wala.util.CancelExceptionpublic IAnalysisCacheView getAnalysisCache()
getAnalysisCache in interface CallGraphBuilder<InstanceKey>