Class AbstractRTABuilder
java.lang.Object
com.ibm.wala.ipa.callgraph.propagation.PropagationCallGraphBuilder
com.ibm.wala.ipa.callgraph.propagation.rta.AbstractRTABuilder
- All Implemented Interfaces:
CallGraphBuilder<InstanceKey>
- Direct Known Subclasses:
BasicRTABuilder
Abstract superclass of various RTA flavors
-
Nested Class Summary
Nested classes/interfaces inherited from class PropagationCallGraphBuilder
PropagationCallGraphBuilder.ArrayLoadOperator, PropagationCallGraphBuilder.ArrayStoreOperator, PropagationCallGraphBuilder.FilterOperator, PropagationCallGraphBuilder.GetFieldOperator, PropagationCallGraphBuilder.InstanceArrayStoreOperator, PropagationCallGraphBuilder.InstancePutFieldOperator, PropagationCallGraphBuilder.InverseFilterOperator, PropagationCallGraphBuilder.MutableBoolean, PropagationCallGraphBuilder.PutFieldOperator, PropagationCallGraphBuilder.TypedPointerKeyModifier and TypeClassDescriptionfinal classBinary op: <dummy>:= ArrayLoad( <arrayref>) Side effect: Creates new equations.final classBinary op: <dummy>:= ArrayStore( <arrayref>) Side effect: Creates new equations.classThe FilterOperator is a filtered set-union.classBinary op: <dummy>:= GetField( <ref>) Side effect: Creates new equations.final classUpdate the points-to-set for an array contents to include a particular instance key.final classUpdate the points-to-set for a field to include a particular instance key.protected classprotected static classclassOperator that represents a putfieldstatic final classA pointer key that delegates to an untyped variant, but adds a type filter -
Field Summary
FieldsModifier and TypeFieldDescriptionset of classes (IClass) discovered to be allocatedset of classes whose clinit are processedprotected final booleanShould we change calls to clone() to assignments?protected static final booleanprotected static final intFields inherited from class PropagationCallGraphBuilder
assignOperator, callGraph, cha, contextSelector, DEBUG_GENERAL, entrypointCallSites, filterOperator, instanceKeyFactory, inverseFilterOperator, options, pointerKeyFactory, systemModifier and TypeFieldDescriptionstatic final com.ibm.wala.ipa.callgraph.propagation.AssignOperatorSingleton operator for assignmentsprotected final ExplicitCallGraphThe call graph under constructionfinal IClassHierarchyGoverning class hierarchyprotected ContextSelectorA context selector which may use information derived from the propagation-based dataflow.protected static final booleanprotected final Set<CallSiteReference> Set of calls (CallSiteReferences) that are created by entrypointssingleton operator for filterprotected InstanceKeyFactoryAn object that abstracts how to model instances in the heap.protected final PropagationCallGraphBuilder.InverseFilterOperatorsingleton operator for inverse filterprotected final AnalysisOptionsSpecial rules for bypassing Java callsprotected PointerKeyFactoryMeta-data regarding how pointers are modeledprotected PropagationSystemThe system of constraints used to build this graph -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractRTABuilder(IClassHierarchy cha, AnalysisOptions options, IAnalysisCacheView cache, ContextSelector appContextSelector, SSAContextInterpreter appContextInterpreter) -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanaddConstraintsFromNode(CGNode node, MonitorUtil.IProgressMonitor monitor) Visit all instructions in a node, and add dataflow constraints induced by each statement relevant to RTAprotected ExplicitCallGraphcreateEmptyCallGraph(IMethod fakeRootClass, AnalysisOptions options) protected voidprotected abstract PointerKeyprotected RTAContextInterpreterprotected SSAContextInterpretermakeContextInterpreter(SSAContextInterpreter appContextInterpreter) protected ContextSelectormakeContextSelector(ContextSelector appContextSelector) protected abstract UnaryOperator<PointsToSetVariable> makeDispatchOperator(CallSiteReference site, CGNode node) protected IPointsToSolverprotected PropagationSystemmakeSystem(AnalysisOptions options) protected voidprocessClassInitializer(IClass klass) protected booleanprotected abstract voidupdateSetsForNewClass(IClass klass, InstanceKey iKey, CGNode node, NewSiteReference ns) Perform needed bookkeeping when a new class is discovered.voidvisitInvoke(CGNode node, CallSiteReference site) Add a constraint for a call instructionvoidvisitNew(CGNode node, NewSiteReference newSite) Add a constraint for an allocateMethods inherited from class PropagationCallGraphBuilder
addAssignmentsForCatchPointerKey, addConstraintsFromChangedNode, addConstraintsFromNewNodes, assignInstanceToCatch, catches, filterForClass, getAnalysisCache, getCallGraph, getClassHierarchy, getContextInterpreter, getContextSelector, getFilteredPointerKeyForLocal, getFilteredPointerKeyForLocal, getFilteredPointerKeyForLocal, getInstanceKeyForAllocation, getInstanceKeyForConstant, getInstanceKeyForMetadataObject, getInstanceKeyForMultiNewArray, getInstanceKeys, getInstanceKeysForClass, getJavaLangObject, getMutableInstanceKeysForClass, getOptions, getPointerKeyFactory, getPointerKeyForArrayContents, getPointerKeyForExceptionalReturnValue, getPointerKeyForInstanceField, getPointerKeyForLocal, getPointerKeyForReturnValue, getPointerKeyForStaticField, getPropagationSystem, getSolver, getSystem, getTargetForCall, haveAlreadyVisited, isJavaLangObject, makeCallGraph, makeCallGraph, markAlreadyVisited, markChanged, markDiscovered, representsNullType, setContextInterpreter, setContextSelector, setInstanceKeys, setPointerKeyFactory, wasChangedModifier and TypeMethodDescriptionprotected voidaddAssignmentsForCatchPointerKey(PointerKey exceptionVar, Set<IClass> catchClasses, PointerKey e) Generate a set of constraints to represent assignment to an exception variable in a catch clause.voidaddConstraintsFromChangedNode(CGNode node, MonitorUtil.IProgressMonitor monitor) Add constraints when the interpretation of a node changes (e.g.protected booleanAdd constraints from newly discovered nodes.protected voidassignInstanceToCatch(PointerKey exceptionVar, Set<IClass> catchClasses, InstanceKey e) Handle assign of a particular exception instance into an exception variablestatic booleancatches(Set<IClass> catchClasses, IClass klass, IClassHierarchy cha) protected IntSetfilterForClass(IntSet S, IClass klass) getFilteredPointerKeyForLocal(CGNode node, int valueNumber, IClass filter) getFilteredPointerKeyForLocal(CGNode node, int valueNumber, FilteredPointerKey.TypeFilter filter) getFilteredPointerKeyForLocal(CGNode node, int valueNumber, InstanceKey filter) getInstanceKeyForAllocation(CGNode node, NewSiteReference allocation) <T> InstanceKeygetInstanceKeyForConstant(TypeReference type, T S) getInstanceKeyForMetadataObject(Object obj, TypeReference objType) getInstanceKeyForMultiNewArray(CGNode node, NewSiteReference allocation, int dim) protected IntSetgetInstanceKeysForClass(IClass klass) protected MutableIntSetTODO: expand this API to differentiate between different array indicesgetPointerKeyForInstanceField(InstanceKey I, IField field) getPointerKeyForLocal(CGNode node, int valueNumber) protected IPointsToSolverprotected CGNodegetTargetForCall(CGNode caller, CallSiteReference site, IClass recv, InstanceKey[] iKey) booleanhaveAlreadyVisited(CGNode node) protected booleanisJavaLangObject(IClass klass) makeCallGraph(AnalysisOptions options) makeCallGraph(AnalysisOptions options, MonitorUtil.IProgressMonitor monitor) Build a call graph.protected voidmarkAlreadyVisited(CGNode node) protected voidmarkChanged(CGNode node) voidmarkDiscovered(CGNode node) record that we've discovered a nodestatic booleanvoidsetContextInterpreter(SSAContextInterpreter interpreter) Subclasses must register the context interpreter before building a call graph.voidsetContextSelector(ContextSelector selector) voidvoidprotected booleanwasChanged(CGNode node)
-
Field Details
-
DEBUG_LEVEL
protected static final int DEBUG_LEVEL- See Also:
-
DEBUG
protected static final boolean DEBUG- See Also:
-
clone2Assign
protected final boolean clone2AssignShould we change calls to clone() to assignments?- See Also:
-
clinitProcessed
-
allocatedClasses
-
-
Constructor Details
-
AbstractRTABuilder
protected AbstractRTABuilder(IClassHierarchy cha, AnalysisOptions options, IAnalysisCacheView cache, ContextSelector appContextSelector, SSAContextInterpreter appContextInterpreter)
-
-
Method Details
-
getRTAContextInterpreter
-
addConstraintsFromNode
Visit all instructions in a node, and add dataflow constraints induced by each statement relevant to RTA- Specified by:
addConstraintsFromNodein classPropagationCallGraphBuilder- Returns:
- true iff any new constraints are added.
-
processClassInitializer
-
visitInvoke
Add a constraint for a call instruction- Throws:
IllegalArgumentException- if site is null
-
makeDispatchOperator
protected abstract UnaryOperator<PointsToSetVariable> makeDispatchOperator(CallSiteReference site, CGNode node) -
getKeyForSite
-
visitNew
Add a constraint for an allocate- Throws:
IllegalArgumentException- if newSite is null
-
updateSetsForNewClass
protected abstract void updateSetsForNewClass(IClass klass, InstanceKey iKey, CGNode node, NewSiteReference ns) Perform needed bookkeeping when a new class is discovered. -
customInit
protected void customInit()- Overrides:
customInitin classPropagationCallGraphBuilder
-
getAllocatedTypes
-
makeSolver
- Specified by:
makeSolverin classPropagationCallGraphBuilder
-
makeContextSelector
-
makeContextInterpreter
-
unconditionallyAddConstraintsFromNode
protected boolean unconditionallyAddConstraintsFromNode(CGNode node, MonitorUtil.IProgressMonitor monitor) - Specified by:
unconditionallyAddConstraintsFromNodein classPropagationCallGraphBuilder
-
createEmptyCallGraph
- Overrides:
createEmptyCallGraphin classPropagationCallGraphBuilder
-
makeSystem
- Overrides:
makeSystemin classPropagationCallGraphBuilder
-
getPointerAnalysis
- Specified by:
getPointerAnalysisin interfaceCallGraphBuilder<InstanceKey>- Overrides:
getPointerAnalysisin classPropagationCallGraphBuilder- Returns:
- the Pointer Analysis information computed as a side-effect of call graph construction.
- See Also:
-