Class BasicRTABuilder
java.lang.Object
com.ibm.wala.ipa.callgraph.propagation.PropagationCallGraphBuilder
com.ibm.wala.ipa.callgraph.propagation.rta.AbstractRTABuilder
com.ibm.wala.ipa.callgraph.propagation.rta.BasicRTABuilder
- All Implemented Interfaces:
CallGraphBuilder<InstanceKey>
TODO: refactor to eliminate more redundancy with SSACallGraphBuilder
-
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
Fields inherited from class AbstractRTABuilder
allocatedClasses, clinitProcessed, clone2Assign, DEBUG, DEBUG_LEVELModifier 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
ConstructorsConstructorDescriptionBasicRTABuilder(IClassHierarchy cha, AnalysisOptions options, IAnalysisCacheView cache, ContextSelector contextSelector, SSAContextInterpreter contextInterpreter) -
Method Summary
Modifier and TypeMethodDescriptionprotected RTASelectorKeygetKeyForSelector(Selector selector) protected PointerKeyprotected UnaryOperator<PointsToSetVariable> makeDispatchOperator(CallSiteReference site, CGNode node) protected voidupdateSetsForNewClass(IClass klass, InstanceKey iKey, CGNode node, NewSiteReference n) Perform needed bookkeeping when a new class is discovered.Methods inherited from class AbstractRTABuilder
addConstraintsFromNode, createEmptyCallGraph, customInit, getAllocatedTypes, getPointerAnalysis, getRTAContextInterpreter, makeContextInterpreter, makeContextSelector, makeSolver, makeSystem, processClassInitializer, unconditionallyAddConstraintsFromNode, visitInvoke, visitNewModifier 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 RTAContextInterpreterprotected SSAContextInterpretermakeContextInterpreter(SSAContextInterpreter appContextInterpreter) protected ContextSelectormakeContextSelector(ContextSelector appContextSelector) protected IPointsToSolverprotected PropagationSystemmakeSystem(AnalysisOptions options) protected voidprocessClassInitializer(IClass klass) protected booleanvoidvisitInvoke(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)
-
Constructor Details
-
BasicRTABuilder
public BasicRTABuilder(IClassHierarchy cha, AnalysisOptions options, IAnalysisCacheView cache, ContextSelector contextSelector, SSAContextInterpreter contextInterpreter)
-
-
Method Details
-
updateSetsForNewClass
protected void updateSetsForNewClass(IClass klass, InstanceKey iKey, CGNode node, NewSiteReference n) Perform needed bookkeeping when a new class is discovered.- Specified by:
updateSetsForNewClassin classAbstractRTABuilder
-
getKeyForSite
- Specified by:
getKeyForSitein classAbstractRTABuilder
-
getKeyForSelector
-
makeDispatchOperator
protected UnaryOperator<PointsToSetVariable> makeDispatchOperator(CallSiteReference site, CGNode node) - Specified by:
makeDispatchOperatorin classAbstractRTABuilder
-