public abstract class PropagationCallGraphBuilder extends Object implements CallGraphBuilder
Modifier and Type | Class and Description |
---|---|
class |
PropagationCallGraphBuilder.ArrayLoadOperator
Binary op:
|
class |
PropagationCallGraphBuilder.ArrayStoreOperator
Binary op:
|
class |
PropagationCallGraphBuilder.FilterOperator
The FilterOperator is a filtered set-union.
|
class |
PropagationCallGraphBuilder.GetFieldOperator
Binary op:
|
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 |
---|---|
protected 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 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(IClassHierarchy cha,
AnalysisOptions options,
AnalysisCache cache,
PointerKeyFactory pointerKeyFactory) |
protected static final boolean DEBUG_GENERAL
protected PointerKeyFactory pointerKeyFactory
public final IClassHierarchy cha
protected final AnalysisOptions options
protected final Set<CallSiteReference> entrypointCallSites
protected PropagationSystem system
protected final ExplicitCallGraph callGraph
protected 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(IClassHierarchy cha, AnalysisOptions options, AnalysisCache cache, PointerKeyFactory pointerKeyFactory)
cha
- governing class hierarchyoptions
- governing call graph construction optionspointerKeyFactory
- factory which embodies pointer abstraction policypublic PropagationSystem getSystem()
protected ExplicitCallGraph createEmptyCallGraph(IClassHierarchy cha, AnalysisOptions options)
protected boolean isJavaLangObject(IClass klass)
public CallGraph makeCallGraph(AnalysisOptions options) throws IllegalArgumentException, CancelException
public CallGraph makeCallGraph(AnalysisOptions options, MonitorUtil.IProgressMonitor monitor) throws IllegalArgumentException, CallGraphBuilderCancelException
CallGraphBuilder
makeCallGraph
in interface CallGraphBuilder
options
- an object representing controlling options that the call graph building algorithm needs to know.IllegalArgumentException
CallGraphBuilderCancelException
protected PropagationSystem makeSystem(AnalysisOptions options)
protected abstract IPointsToSolver makeSolver()
protected void customInit()
protected abstract boolean addConstraintsFromNode(CGNode n, MonitorUtil.IProgressMonitor monitor) throws CancelException
monitor
- CancelException
protected boolean addConstraintsFromNewNodes(MonitorUtil.IProgressMonitor monitor) throws CancelException
CancelException
public 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)
IllegalArgumentException
- if I is nullIllegalArgumentException
- if field is nullpublic PointerKey getPointerKeyForArrayContents(InstanceKey I)
I
- an InstanceKey representing an abstract arrayIllegalArgumentException
- if I is nullprotected void assignInstanceToCatch(PointerKey exceptionVar, 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, 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(Set<IClass> catchClasses, IClass klass, IClassHierarchy cha)
catchClasses
- Set of TypeReferenceklass
- an Exception ClassIllegalArgumentException
- if catchClasses is nullpublic static boolean representsNullType(InstanceKey key) throws IllegalArgumentException
IllegalArgumentException
public IClassHierarchy getClassHierarchy()
public AnalysisOptions getOptions()
public IClass getJavaLangObject()
public ExplicitCallGraph getCallGraph()
public void setContextInterpreter(SSAContextInterpreter interpreter)
public PointerAnalysis<InstanceKey> getPointerAnalysis()
getPointerAnalysis
in interface CallGraphBuilder
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(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 MutableIntSet getMutableInstanceKeysForClass(IClass klass)
protected IntSet filterForClass(IntSet S, IClass klass)
klass
- a classprotected IPointsToSolver getSolver()
public void addConstraintsFromChangedNode(CGNode node, MonitorUtil.IProgressMonitor monitor) throws CancelException
monitor
- CancelException
protected abstract boolean unconditionallyAddConstraintsFromNode(CGNode node, MonitorUtil.IProgressMonitor monitor) throws CancelException
CancelException
public AnalysisCache getAnalysisCache()
getAnalysisCache
in interface CallGraphBuilder