com.ibm.wala.ipa.callgraph.propagation.rta
Class AbstractRTABuilder

java.lang.Object
  extended by com.ibm.wala.ipa.callgraph.propagation.PropagationCallGraphBuilder
      extended by com.ibm.wala.ipa.callgraph.propagation.rta.AbstractRTABuilder
All Implemented Interfaces:
CallGraphBuilder
Direct Known Subclasses:
BasicRTABuilder

public abstract class AbstractRTABuilder
extends PropagationCallGraphBuilder

Abstract superclass of various RTA flavors


Nested Class Summary
 
Nested classes/interfaces inherited from class com.ibm.wala.ipa.callgraph.propagation.PropagationCallGraphBuilder
PropagationCallGraphBuilder.ArrayLoadOperator, PropagationCallGraphBuilder.ArrayStoreOperator, PropagationCallGraphBuilder.FilterOperator, PropagationCallGraphBuilder.GetFieldOperator, PropagationCallGraphBuilder.InstanceArrayStoreOperator, PropagationCallGraphBuilder.InstancePutFieldOperator, PropagationCallGraphBuilder.InverseFilterOperator, PropagationCallGraphBuilder.MutableBoolean, PropagationCallGraphBuilder.PutFieldOperator, PropagationCallGraphBuilder.TypedPointerKey
 
Field Summary
protected  java.util.HashSet<IClass> allocatedClasses
          set of classes (IClass) discovered to be allocated
protected  java.util.Set<IClass> clinitProcessed
          set of classes whose clinit are processed
protected  boolean clone2Assign
          Should we change calls to clone() to assignments?
protected static boolean DEBUG
           
protected static int DEBUG_LEVEL
           
 
Fields inherited from class com.ibm.wala.ipa.callgraph.propagation.PropagationCallGraphBuilder
assignOperator, callGraph, cha, contextSelector, CUTOFF, DEBUG_GENERAL, entrypointCallSites, filterOperator, instanceKeyFactory, inverseFilterOperator, options, pointerKeyFactory, system, THROWABLE_SET
 
Constructor Summary
protected AbstractRTABuilder(ClassHierarchy cha, WarningSet warnings, AnalysisOptions options, ContextSelector appContextSelector, SSAContextInterpreter appContextInterpreter, ReflectionSpecification reflect)
           
 
Method Summary
protected  boolean addConstraintsFromNode(CGNode node)
          Visit all instructions in a node, and add dataflow constraints induced by each statement relevat to RTA
protected  ExplicitCallGraph createEmptyCallGraph(ClassHierarchy cha, AnalysisOptions options)
           
protected  void customInit()
           
 java.util.Set<IClass> getAllocatedTypes()
           
protected abstract  PointerKey getKeyForSite(CallSiteReference site)
           
 PointerAnalysis getPointerAnalysis()
           
protected  RTAContextInterpreter getRTAContextInterpreter()
           
protected  SSAContextInterpreter makeContextInterpreter(SSAContextInterpreter appContextInterpreter, ReflectionSpecification reflect, WarningSet warnings)
           
protected  ContextSelector makeContextSelector(ContextSelector appContextSelector)
           
protected abstract  UnaryOperator makeDispatchOperator(CallSiteReference site, CGNode node)
           
protected  IPointsToSolver makeSolver()
           
protected  PropagationSystem makeSystem(AnalysisOptions options)
           
protected  void processClassInitializer(IClass klass)
           
protected  boolean unconditionallyAddConstraintsFromNode(CGNode node)
           
protected abstract  void updateSetsForNewClass(IClass klass, InstanceKey iKey, CGNode node, NewSiteReference ns)
          Perform needed bookkeeping when a new class is discovered.
 void visitInvoke(CGNode node, CallSiteReference site)
          Add a constraint for a call instruction
 void visitNew(CGNode node, NewSiteReference newSite)
          Add a constraint for an allocate
 
Methods inherited from class com.ibm.wala.ipa.callgraph.propagation.PropagationCallGraphBuilder
addAssignmentsForCatchPointerKey, addConstraintsFromChangedNode, addConstraintsFromNewNodes, assignInstanceToCatch, catches, filterForClass, findOrCreateBoundFromClassHierarchy, getBoundOnNumberOfTargets, getCallGraph, getClassHierarchy, getContextInterpreter, getContextSelector, getDefaultDispatchBoundHeuristic, getFilteredPointerKeyForLocal, getFilteredPointerKeyForLocal, getFilteredPointerKeyForLocal, getInstanceKeyForAllocation, getInstanceKeyForClassObject, getInstanceKeyForConstant, getInstanceKeyForMultiNewArray, getInstanceKeys, getInstanceKeysForClass, getJavaLangObject, getJavaLangThrowable, getMutableInstanceKeysForClass, getOptions, getPointerFlowGraphFactory, getPointerKeyFactory, getPointerKeyForArrayContents, getPointerKeyForExceptionalReturnValue, getPointerKeyForInstanceField, getPointerKeyForLocal, getPointerKeyForReturnValue, getPointerKeyForStaticField, getPropagationSystem, getSolver, getStringConstantForInstanceKey, getTargetForCall, getWarnings, haveAlreadyVisited, isJavaLangObject, makeCallGraph, markAlreadyVisited, markChanged, markDiscovered, setContextInterpreter, setContextSelector, setInstanceKeys, setWarnings, wasChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEBUG_LEVEL

protected static final int DEBUG_LEVEL
See Also:
Constant Field Values

DEBUG

protected static final boolean DEBUG
See Also:
Constant Field Values

clone2Assign

protected final boolean clone2Assign
Should we change calls to clone() to assignments?

See Also:
Constant Field Values

clinitProcessed

protected final java.util.Set<IClass> clinitProcessed
set of classes whose clinit are processed


allocatedClasses

protected final java.util.HashSet<IClass> allocatedClasses
set of classes (IClass) discovered to be allocated

Constructor Detail

AbstractRTABuilder

protected AbstractRTABuilder(ClassHierarchy cha,
                             WarningSet warnings,
                             AnalysisOptions options,
                             ContextSelector appContextSelector,
                             SSAContextInterpreter appContextInterpreter,
                             ReflectionSpecification reflect)
Method Detail

getRTAContextInterpreter

protected RTAContextInterpreter getRTAContextInterpreter()

addConstraintsFromNode

protected boolean addConstraintsFromNode(CGNode node)
Visit all instructions in a node, and add dataflow constraints induced by each statement relevat to RTA

Specified by:
addConstraintsFromNode in class PropagationCallGraphBuilder
Returns:
true iff any new constraints are added.

processClassInitializer

protected void processClassInitializer(IClass klass)
Parameters:
klass -

visitInvoke

public void visitInvoke(CGNode node,
                        CallSiteReference site)
Add a constraint for a call instruction

Throws:
java.lang.IllegalArgumentException - if site is null

makeDispatchOperator

protected abstract UnaryOperator makeDispatchOperator(CallSiteReference site,
                                                      CGNode node)

getKeyForSite

protected abstract PointerKey getKeyForSite(CallSiteReference site)

visitNew

public void visitNew(CGNode node,
                     NewSiteReference newSite)
Add a constraint for an allocate

Throws:
java.lang.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.

Parameters:
klass -

customInit

protected void customInit()
Overrides:
customInit in class PropagationCallGraphBuilder

getAllocatedTypes

public java.util.Set<IClass> getAllocatedTypes()
Returns:
set of IClasses determined to be allocated

makeSolver

protected IPointsToSolver makeSolver()
Specified by:
makeSolver in class PropagationCallGraphBuilder

makeContextSelector

protected ContextSelector makeContextSelector(ContextSelector appContextSelector)

makeContextInterpreter

protected SSAContextInterpreter makeContextInterpreter(SSAContextInterpreter appContextInterpreter,
                                                       ReflectionSpecification reflect,
                                                       WarningSet warnings)

unconditionallyAddConstraintsFromNode

protected boolean unconditionallyAddConstraintsFromNode(CGNode node)
Specified by:
unconditionallyAddConstraintsFromNode in class PropagationCallGraphBuilder

createEmptyCallGraph

protected ExplicitCallGraph createEmptyCallGraph(ClassHierarchy cha,
                                                 AnalysisOptions options)
Overrides:
createEmptyCallGraph in class PropagationCallGraphBuilder

makeSystem

protected PropagationSystem makeSystem(AnalysisOptions options)
Overrides:
makeSystem in class PropagationCallGraphBuilder

getPointerAnalysis

public PointerAnalysis getPointerAnalysis()
Specified by:
getPointerAnalysis in interface CallGraphBuilder
Overrides:
getPointerAnalysis in class PropagationCallGraphBuilder
Returns:
the Pointer Analysis information computed as a side-effect of call graph construction.