|
|||||||||
| 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
|
| 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 int |
CUTOFF
A constant which constrains computation in getBoundOnNumberOfTargets |
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 modelled |
protected PropagationSystem |
system
The system of constraints used to build this graph |
static java.util.Set<TypeReference> |
THROWABLE_SET
A singleton set holding the java.lang.Throwable TypeReference |
| Constructor Summary | |
|---|---|
protected |
PropagationCallGraphBuilder(IClassHierarchy cha,
WarningSet warnings,
AnalysisOptions options,
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
public static final java.util.Set<TypeReference> THROWABLE_SET
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
protected static final int CUTOFF
| Constructor Detail |
|---|
protected PropagationCallGraphBuilder(IClassHierarchy cha,
WarningSet warnings,
AnalysisOptions options,
PointerKeyFactory pointerKeyFactory)
cha - governing class hierarchywarnings - an object to track analysis warningsoptions - governing call graph construction optionspointerKeyFactory - factory which embodies pointer abstraction policy| Method Detail |
|---|
protected ExplicitCallGraph createEmptyCallGraph(IClassHierarchy cha,
AnalysisOptions options)
protected byte getDefaultDispatchBoundHeuristic()
protected boolean isJavaLangObject(IClass klass)
klass -
public CallGraph makeCallGraph(AnalysisOptions options)
CallGraphBuilder
makeCallGraph in interface CallGraphBuilderoptions - an object representing controlling options that the call
graph building algorithm needs to know.
protected PropagationSystem makeSystem(AnalysisOptions options)
protected abstract IPointsToSolver makeSolver()
protected void customInit()
protected abstract boolean addConstraintsFromNode(CGNode n)
protected boolean addConstraintsFromNewNodes()
public PointerKey getPointerKeyForLocal(CGNode node,
int valueNumber)
node - valueNumber -
public FilteredPointerKey getFilteredPointerKeyForLocal(CGNode node,
int valueNumber,
FilteredPointerKey.TypeFilter filter)
node - valueNumber -
public FilteredPointerKey getFilteredPointerKeyForLocal(CGNode node,
int valueNumber,
IClass filter)
public FilteredPointerKey getFilteredPointerKeyForLocal(CGNode node,
int valueNumber,
InstanceKey filter)
public PointerKey getPointerKeyForReturnValue(CGNode node)
node -
public PointerKey getPointerKeyForExceptionalReturnValue(CGNode node)
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 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 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 catchClasses,
IClass klass,
IClassHierarchy cha)
catchClasses - Set of TypeReferenceklass - an Exception Class
java.lang.IllegalArgumentException - if catchClasses is nullpublic static boolean representsNullType(InstanceKey key)
public IClassHierarchy getClassHierarchy()
public AnalysisOptions getOptions()
public IClass getJavaLangObject()
public IClass getJavaLangThrowable()
public ExplicitCallGraph getCallGraph()
public WarningSet getWarnings()
public void setContextInterpreter(SSAContextInterpreter interpreter)
public PointerAnalysis getPointerAnalysis()
getPointerAnalysis in interface CallGraphBuilderpublic PointerFlowGraphFactory getPointerFlowGraphFactory()
getPointerFlowGraphFactory in interface CallGraphBuilderpublic PropagationSystem getPropagationSystem()
public PointerKeyFactory getPointerKeyFactory()
public RTAContextInterpreter getContextInterpreter()
protected int getBoundOnNumberOfTargets(CGNode caller,
CallSiteReference site)
caller - the caller node
protected int findOrCreateBoundFromIClassHierarchy(MethodReference m)
m -
public CGNode getTargetForCall(CGNode caller,
CallSiteReference site,
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 InstanceKey getInstanceKeyForConstant(TypeReference type,
java.lang.Object S)
public java.lang.String getStringConstantForInstanceKey(InstanceKey I)
public InstanceKey getInstanceKeyForClassObject(TypeReference type)
public boolean haveAlreadyVisited(CGNode node)
protected void markAlreadyVisited(CGNode node)
node - public void markDiscovered(CGNode node)
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
public void setWarnings(WarningSet set)
set - protected IPointsToSolver getSolver()
public void addConstraintsFromChangedNode(CGNode node)
node - protected abstract boolean unconditionallyAddConstraintsFromNode(CGNode node)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||