soot.toolkits.scalar
Class AbstractFlowAnalysis

java.lang.Object
  extended bysoot.toolkits.scalar.AbstractFlowAnalysis
Direct Known Subclasses:
BranchedFlowAnalysis, FlowAnalysis

public abstract class AbstractFlowAnalysis
extends Object

An abstract class providing a metaframework for carrying out dataflow analysis. This class provides common methods and fields required by the BranchedFlowAnalysis and FlowAnalysis abstract classes.


Field Summary
protected  Map filterUnitToBeforeFlow
          Filtered: Maps graph nodes to IN sets.
protected  DirectedGraph graph
          The graph being analysed.
protected  Map unitToBeforeFlow
          Maps graph nodes to IN sets.
 
Constructor Summary
AbstractFlowAnalysis(DirectedGraph graph)
          Constructs a flow analysis on the given DirectedGraph.
 
Method Summary
protected abstract  void copy(Object source, Object dest)
          Creates a copy of the source flow object in dest.
protected  void customizeInitialFlowGraph()
          We hereby retract the API for customizeInitialFlowGraph().
protected abstract  void doAnalysis()
          Carries out the actual flow analysis.
protected abstract  Object entryInitialFlow()
          Returns the initial flow value for entry/exit graph nodes.
 Object getFlowBefore(Object s)
          Accessor function returning value of IN set for s.
protected abstract  boolean isForward()
          Returns true if this analysis is forwards.
protected  void merge(Object inout, Object in)
           
protected abstract  void merge(Object in1, Object in2, Object out)
          Compute the merge of the in1 and in2 sets, putting the result into out.
protected abstract  Object newInitialFlow()
          Returns the flow object corresponding to the initial values for each graph node.
protected  boolean treatTrapHandlersAsEntries()
          Determines whether entryInitialFlow() is applied to trap handlers.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

unitToBeforeFlow

protected Map unitToBeforeFlow
Maps graph nodes to IN sets.


filterUnitToBeforeFlow

protected Map filterUnitToBeforeFlow
Filtered: Maps graph nodes to IN sets.


graph

protected DirectedGraph graph
The graph being analysed.

Constructor Detail

AbstractFlowAnalysis

public AbstractFlowAnalysis(DirectedGraph graph)
Constructs a flow analysis on the given DirectedGraph.

Method Detail

newInitialFlow

protected abstract Object newInitialFlow()
Returns the flow object corresponding to the initial values for each graph node.


entryInitialFlow

protected abstract Object entryInitialFlow()
Returns the initial flow value for entry/exit graph nodes.


customizeInitialFlowGraph

protected final void customizeInitialFlowGraph()
We hereby retract the API for customizeInitialFlowGraph().


treatTrapHandlersAsEntries

protected boolean treatTrapHandlersAsEntries()
Determines whether entryInitialFlow() is applied to trap handlers.


isForward

protected abstract boolean isForward()
Returns true if this analysis is forwards.


merge

protected abstract void merge(Object in1,
                              Object in2,
                              Object out)
Compute the merge of the in1 and in2 sets, putting the result into out. The behavior of this function depends on the implementation ( it may be necessary to check whether in1 and in2 are equal or aliased ). Used by the doAnalysis method.


copy

protected abstract void copy(Object source,
                             Object dest)
Creates a copy of the source flow object in dest.


doAnalysis

protected abstract void doAnalysis()
Carries out the actual flow analysis. Typically called from a concrete FlowAnalysis's constructor.


getFlowBefore

public Object getFlowBefore(Object s)
Accessor function returning value of IN set for s.


merge

protected void merge(Object inout,
                     Object in)