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) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addAssignmentsForCatchPointerKey(PointerKey exceptionVar,
Set<IClass> catchClasses,
PointerKey e)
Generate a set of constraints to represent assignment to an exception variable in a catch clause.
|
void |
addConstraintsFromChangedNode(CGNode node,
com.ibm.wala.util.MonitorUtil.IProgressMonitor monitor)
Add constraints when the interpretation of a node changes (e.g.
|
protected boolean |
addConstraintsFromNewNodes(com.ibm.wala.util.MonitorUtil.IProgressMonitor monitor)
Add constraints from newly discovered nodes.
|
protected abstract boolean |
addConstraintsFromNode(CGNode n,
com.ibm.wala.util.MonitorUtil.IProgressMonitor monitor)
Add constraints for a node.
|
protected void |
assignInstanceToCatch(PointerKey exceptionVar,
Set<IClass> catchClasses,
InstanceKey e)
Handle assign of a particular exception instance into an exception variable
|
static boolean |
catches(Set<IClass> catchClasses,
IClass klass,
IClassHierarchy cha) |
protected ExplicitCallGraph |
createEmptyCallGraph(IClassHierarchy cha,
AnalysisOptions options) |
protected void |
customInit() |
protected com.ibm.wala.util.intset.IntSet |
filterForClass(com.ibm.wala.util.intset.IntSet S,
IClass klass) |
AnalysisCache |
getAnalysisCache() |
ExplicitCallGraph |
getCallGraph() |
IClassHierarchy |
getClassHierarchy() |
RTAContextInterpreter |
getContextInterpreter()
END Custom change: setter for pointerkey factory
|
ContextSelector |
getContextSelector() |
FilteredPointerKey |
getFilteredPointerKeyForLocal(CGNode node,
int valueNumber,
FilteredPointerKey.TypeFilter filter) |
FilteredPointerKey |
getFilteredPointerKeyForLocal(CGNode node,
int valueNumber,
IClass filter) |
FilteredPointerKey |
getFilteredPointerKeyForLocal(CGNode node,
int valueNumber,
InstanceKey filter) |
InstanceKey |
getInstanceKeyForAllocation(CGNode node,
NewSiteReference allocation) |
<T> InstanceKey |
getInstanceKeyForConstant(TypeReference type,
T S) |
InstanceKey |
getInstanceKeyForMetadataObject(Object obj,
TypeReference objType) |
InstanceKey |
getInstanceKeyForMultiNewArray(CGNode node,
NewSiteReference allocation,
int dim) |
InstanceKeyFactory |
getInstanceKeys() |
protected com.ibm.wala.util.intset.IntSet |
getInstanceKeysForClass(IClass klass) |
IClass |
getJavaLangObject() |
protected com.ibm.wala.util.intset.MutableIntSet |
getMutableInstanceKeysForClass(IClass klass) |
AnalysisOptions |
getOptions() |
PointerAnalysis<InstanceKey> |
getPointerAnalysis() |
PointerKeyFactory |
getPointerKeyFactory() |
PointerKey |
getPointerKeyForArrayContents(InstanceKey I)
TODO: expand this API to differentiate between different array indices
|
PointerKey |
getPointerKeyForExceptionalReturnValue(CGNode node) |
PointerKey |
getPointerKeyForInstanceField(InstanceKey I,
IField field) |
PointerKey |
getPointerKeyForLocal(CGNode node,
int valueNumber) |
PointerKey |
getPointerKeyForReturnValue(CGNode node) |
PointerKey |
getPointerKeyForStaticField(IField f) |
PropagationSystem |
getPropagationSystem() |
protected IPointsToSolver |
getSolver() |
PropagationSystem |
getSystem() |
protected CGNode |
getTargetForCall(CGNode caller,
CallSiteReference site,
IClass recv,
InstanceKey[] iKey) |
boolean |
haveAlreadyVisited(CGNode node) |
protected boolean |
isJavaLangObject(IClass klass) |
CallGraph |
makeCallGraph(AnalysisOptions options) |
CallGraph |
makeCallGraph(AnalysisOptions options,
com.ibm.wala.util.MonitorUtil.IProgressMonitor monitor)
Build a call graph.
|
protected abstract IPointsToSolver |
makeSolver() |
protected PropagationSystem |
makeSystem(AnalysisOptions options) |
protected void |
markAlreadyVisited(CGNode node) |
protected void |
markChanged(CGNode node) |
void |
markDiscovered(CGNode node)
record that we've discovered a node
|
static boolean |
representsNullType(InstanceKey key) |
void |
setContextInterpreter(SSAContextInterpreter interpreter)
Subclasses must register the context interpreter before building a call graph.
|
void |
setContextSelector(ContextSelector selector) |
void |
setInstanceKeys(InstanceKeyFactory keys) |
void |
setPointerKeyFactory(PointerKeyFactory pkFact)
BEGIN Custom change: setter for pointerkey factory
|
protected abstract boolean |
unconditionallyAddConstraintsFromNode(CGNode node,
com.ibm.wala.util.MonitorUtil.IProgressMonitor monitor) |
protected boolean |
wasChanged(CGNode node) |
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, com.ibm.wala.util.CancelException
IllegalArgumentExceptioncom.ibm.wala.util.CancelExceptionpublic CallGraph makeCallGraph(AnalysisOptions options, com.ibm.wala.util.MonitorUtil.IProgressMonitor monitor) throws IllegalArgumentException, CallGraphBuilderCancelException
CallGraphBuildermakeCallGraph in interface CallGraphBuilderoptions - an object representing controlling options that the call graph building algorithm needs to know.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
monitor - 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)
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
IllegalArgumentExceptionpublic IClassHierarchy getClassHierarchy()
public AnalysisOptions getOptions()
public IClass getJavaLangObject()
public ExplicitCallGraph getCallGraph()
public void setContextInterpreter(SSAContextInterpreter interpreter)
public PointerAnalysis<InstanceKey> getPointerAnalysis()
getPointerAnalysis in interface CallGraphBuilderpublic 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 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
monitor - 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 AnalysisCache getAnalysisCache()
getAnalysisCache in interface CallGraphBuilderCopyright © 2015. All rights reserved.