|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.ibm.wala.ipa.callgraph.propagation.PropagationCallGraphBuilder
public abstract class PropagationCallGraphBuilder
This abstract base class provides the general algorithm for a call graph builder that relies on propagation through an iterative dataflow solver 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.
| Nested Class Summary | |
|---|---|
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 |
| Field Summary | |
|---|---|
protected static com.ibm.wala.ipa.callgraph.propagation.AssignOperator |
assignOperator
Singleton operator for assignments |
protected ExplicitCallGraph |
callGraph
The call graph under construction |
protected 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 |
| Constructor Summary | |
|---|---|
protected |
PropagationCallGraphBuilder(IClassHierarchy cha,
AnalysisOptions options,
AnalysisCache cache,
PointerKeyFactory pointerKeyFactory)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final boolean DEBUG_GENERAL
protected final PointerKeyFactory pointerKeyFactory
protected final IClassHierarchy cha
protected final AnalysisOptions options
protected final java.util.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
| Constructor Detail |
|---|
protected PropagationCallGraphBuilder(IClassHierarchy cha,
AnalysisOptions options,
AnalysisCache cache,
PointerKeyFactory pointerKeyFactory)
cha - governing class hierarchyoptions - governing call graph construction optionspointerKeyFactory - factory which embodies pointer abstraction policy| Method Detail |
|---|
protected ExplicitCallGraph createEmptyCallGraph(IClassHierarchy cha,
AnalysisOptions options)
protected boolean isJavaLangObject(IClass klass)
public CallGraph makeCallGraph(AnalysisOptions options)
throws java.lang.IllegalArgumentException,
CancelException
java.lang.IllegalArgumentException
CancelException
public CallGraph makeCallGraph(AnalysisOptions options,
MonitorUtil.IProgressMonitor monitor)
throws java.lang.IllegalArgumentException,
CallGraphBuilderCancelException
CallGraphBuilder
makeCallGraph in interface CallGraphBuilderoptions - an object representing controlling options that the call graph building algorithm needs to know.
java.lang.IllegalArgumentException
CallGraphBuilderCancelExceptionprotected 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)
java.lang.IllegalArgumentException - if I is null
java.lang.IllegalArgumentException - if field is nullpublic PointerKey getPointerKeyForArrayContents(InstanceKey I)
I - an InstanceKey representing an abstract array
java.lang.IllegalArgumentException - if I is null
protected 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 instance
protected 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 Class
java.lang.IllegalArgumentException - if catchClasses is null
public static boolean representsNullType(InstanceKey key)
throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentExceptionpublic IClassHierarchy getClassHierarchy()
public AnalysisOptions getOptions()
public IClass getJavaLangObject()
public ExplicitCallGraph getCallGraph()
public void setContextInterpreter(SSAContextInterpreter interpreter)
public PointerAnalysis getPointerAnalysis()
getPointerAnalysis in interface CallGraphBuilderpublic PropagationSystem getPropagationSystem()
public PointerKeyFactory getPointerKeyFactory()
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 getInstanceKeyForClassObject(TypeReference type)
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 getInstanceKeysForClass(IClass klass)
protected IntSet filterForClass(IntSet S,
IClass klass)
klass - a class
protected 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
CancelExceptionpublic AnalysisCache getAnalysisCache()
getAnalysisCache in interface CallGraphBuilder
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||