Package soot.jimple.toolkits.scalar
Class SlowAvailableExpressionsAnalysis
- java.lang.Object
-
- soot.toolkits.scalar.AbstractFlowAnalysis<N,A>
-
- soot.toolkits.scalar.FlowAnalysis<N,A>
-
- soot.toolkits.scalar.ForwardFlowAnalysis<Unit,FlowSet<Value>>
-
- soot.jimple.toolkits.scalar.SlowAvailableExpressionsAnalysis
-
- Direct Known Subclasses:
PessimisticAvailableExpressionsAnalysis
public class SlowAvailableExpressionsAnalysis extends ForwardFlowAnalysis<Unit,FlowSet<Value>>
Implements an available expressions analysis on local variables. The current implementation is slow but correct. A better implementation would use an implicit universe and the kill rule would be computed on-the-fly for each statement.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class soot.toolkits.scalar.FlowAnalysis
FlowAnalysis.Flow
-
-
Field Summary
Fields Modifier and Type Field Description protected FlowSet<Value>
emptySet
protected Map<Value,Stmt>
rhsToContainingStmt
maps an rhs to its containing stmt.protected Map<Unit,BoundedFlowSet<Value>>
unitToGenerateSet
protected Map<Unit,BoundedFlowSet<Value>>
unitToPreserveSet
-
Fields inherited from class soot.toolkits.scalar.FlowAnalysis
filterUnitToAfterFlow, unitToAfterFlow
-
Fields inherited from class soot.toolkits.scalar.AbstractFlowAnalysis
filterUnitToBeforeFlow, graph, unitToBeforeFlow
-
-
Constructor Summary
Constructors Constructor Description SlowAvailableExpressionsAnalysis(DirectedGraph<Unit> dg)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
copy(FlowSet<Value> sourceSet, FlowSet<Value> destSet)
Creates a copy of thesource
flow object indest
.protected FlowSet<Value>
entryInitialFlow()
Returns the initial flow value for entry/exit graph nodes.protected void
flowThrough(FlowSet<Value> in, Unit unit, FlowSet<Value> out)
Given the merge of theout
sets, compute thein
set fors
(or in to out, depending on direction).protected void
merge(FlowSet<Value> inSet1, FlowSet<Value> inSet2, FlowSet<Value> outSet)
Compute the merge of thein1
andin2
sets, putting the result intoout
.protected FlowSet<Value>
newInitialFlow()
Returns the flow object corresponding to the initial values for each graph node.-
Methods inherited from class soot.toolkits.scalar.ForwardFlowAnalysis
doAnalysis, isForward
-
Methods inherited from class soot.toolkits.scalar.FlowAnalysis
copyFreshToExisting, getFlow, getFlowAfter, getFlowBefore, omissible
-
Methods inherited from class soot.toolkits.scalar.AbstractFlowAnalysis
merge, mergeInto, treatTrapHandlersAsEntries
-
-
-
-
Field Detail
-
unitToGenerateSet
protected final Map<Unit,BoundedFlowSet<Value>> unitToGenerateSet
-
unitToPreserveSet
protected final Map<Unit,BoundedFlowSet<Value>> unitToPreserveSet
-
rhsToContainingStmt
protected final Map<Value,Stmt> rhsToContainingStmt
maps an rhs to its containing stmt. object equality in rhs.
-
-
Constructor Detail
-
SlowAvailableExpressionsAnalysis
public SlowAvailableExpressionsAnalysis(DirectedGraph<Unit> dg)
-
-
Method Detail
-
newInitialFlow
protected FlowSet<Value> newInitialFlow()
Description copied from class:AbstractFlowAnalysis
Returns the flow object corresponding to the initial values for each graph node.- Specified by:
newInitialFlow
in classAbstractFlowAnalysis<Unit,FlowSet<Value>>
-
entryInitialFlow
protected FlowSet<Value> entryInitialFlow()
Description copied from class:AbstractFlowAnalysis
Returns the initial flow value for entry/exit graph nodes. This is equal toAbstractFlowAnalysis.newInitialFlow()
- Overrides:
entryInitialFlow
in classAbstractFlowAnalysis<Unit,FlowSet<Value>>
-
flowThrough
protected void flowThrough(FlowSet<Value> in, Unit unit, FlowSet<Value> out)
Description copied from class:FlowAnalysis
Given the merge of theout
sets, compute thein
set fors
(or in to out, depending on direction). This function often causes confusion, because the same interface is used for both forward and backward flow analyses. The first parameter is always the argument to the flow function (i.e. it is the "in" set in a forward analysis and the "out" set in a backward analysis), and the third parameter is always the result of the flow function (i.e. it is the "out" set in a forward analysis and the "in" set in a backward analysis).- Specified by:
flowThrough
in classFlowAnalysis<Unit,FlowSet<Value>>
- Parameters:
in
- the input flowunit
- the current nodeout
- the returned flow
-
merge
protected void merge(FlowSet<Value> inSet1, FlowSet<Value> inSet2, FlowSet<Value> outSet)
Description copied from class:AbstractFlowAnalysis
Compute the merge of thein1
andin2
sets, putting the result intoout
. The behavior of this function depends on the implementation ( it may be necessary to check whetherin1
andin2
are equal or aliased ). Used by the doAnalysis method.- Specified by:
merge
in classAbstractFlowAnalysis<Unit,FlowSet<Value>>
-
copy
protected void copy(FlowSet<Value> sourceSet, FlowSet<Value> destSet)
Description copied from class:AbstractFlowAnalysis
Creates a copy of thesource
flow object indest
.- Specified by:
copy
in classAbstractFlowAnalysis<Unit,FlowSet<Value>>
-
-