Package soot.jimple.toolkits.scalar.pre
Class DelayabilityAnalysis
- java.lang.Object
-
- soot.toolkits.scalar.AbstractFlowAnalysis<N,A>
-
- soot.toolkits.scalar.FlowAnalysis<N,A>
-
- soot.toolkits.scalar.ForwardFlowAnalysis<Unit,FlowSet<EquivalentValue>>
-
- soot.jimple.toolkits.scalar.pre.DelayabilityAnalysis
-
public class DelayabilityAnalysis extends ForwardFlowAnalysis<Unit,FlowSet<EquivalentValue>>
Performs a Delayability-analysis on the given graph. This analysis is the third analysis in the PRE (lazy code motion) and has little (no?) sense if used alone. Basically it tries to push the computations we would insert in the Busy Code Motion as far down as possible, to decrease life-time ranges (clearly this is not true, if the computation "uses" two variables and produces only one temporary).
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class soot.toolkits.scalar.FlowAnalysis
FlowAnalysis.Flow
-
-
Field Summary
-
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 DelayabilityAnalysis(DirectedGraph<Unit> dg)Deprecated.DelayabilityAnalysis(DirectedGraph<Unit> dg, EarliestnessComputation earliest, Map<Unit,EquivalentValue> equivRhsMap)Automatically performs the Delayability-analysis on the graphdgand the Earliest-computationearliest.
theequivRhsMapis only here to avoid doing these things again...DelayabilityAnalysis(DirectedGraph<Unit> dg, EarliestnessComputation earliest, Map<Unit,EquivalentValue> equivRhsMap, BoundedFlowSet<EquivalentValue> set)Automatically performs the Delayability-analysis on the graphdgand the Earliest-computationearliest.
theequivRhsMapis only here to avoid doing these things again...
as set-operations are usually more efficient, if the sets come from one source, sets should be shared around analyses, if the analyses are to be combined.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcopy(FlowSet<EquivalentValue> sourceSet, FlowSet<EquivalentValue> destSet)Creates a copy of thesourceflow object indest.protected FlowSet<EquivalentValue>entryInitialFlow()Returns the initial flow value for entry/exit graph nodes.protected voidflowThrough(FlowSet<EquivalentValue> in, Unit u, FlowSet<EquivalentValue> out)Given the merge of theoutsets, compute theinset fors(or in to out, depending on direction).protected voidmerge(FlowSet<EquivalentValue> inSet1, FlowSet<EquivalentValue> inSet2, FlowSet<EquivalentValue> outSet)Compute the merge of thein1andin2sets, putting the result intoout.protected FlowSet<EquivalentValue>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
-
-
-
-
Constructor Detail
-
DelayabilityAnalysis
@Deprecated public DelayabilityAnalysis(DirectedGraph<Unit> dg)
Deprecated.this constructor should not be used, and will throw a runtime-exception!
-
DelayabilityAnalysis
public DelayabilityAnalysis(DirectedGraph<Unit> dg, EarliestnessComputation earliest, Map<Unit,EquivalentValue> equivRhsMap)
Automatically performs the Delayability-analysis on the graphdgand the Earliest-computationearliest.
theequivRhsMapis only here to avoid doing these things again...- Parameters:
dg- a ExceptionalUnitGraphearliest- the earliest-computation of the same graph.equivRhsMap- the rhs of each unit (if assignment-stmt).
-
DelayabilityAnalysis
public DelayabilityAnalysis(DirectedGraph<Unit> dg, EarliestnessComputation earliest, Map<Unit,EquivalentValue> equivRhsMap, BoundedFlowSet<EquivalentValue> set)
Automatically performs the Delayability-analysis on the graphdgand the Earliest-computationearliest.
theequivRhsMapis only here to avoid doing these things again...
as set-operations are usually more efficient, if the sets come from one source, sets should be shared around analyses, if the analyses are to be combined.- Parameters:
dg- a ExceptionalUnitGraphearliest- the earliest-computation of the same graph.equivRhsMap- the rhs of each unit (if assignment-stmt).set- the shared set.
-
-
Method Detail
-
newInitialFlow
protected FlowSet<EquivalentValue> newInitialFlow()
Description copied from class:AbstractFlowAnalysisReturns the flow object corresponding to the initial values for each graph node.- Specified by:
newInitialFlowin classAbstractFlowAnalysis<Unit,FlowSet<EquivalentValue>>
-
entryInitialFlow
protected FlowSet<EquivalentValue> entryInitialFlow()
Description copied from class:AbstractFlowAnalysisReturns the initial flow value for entry/exit graph nodes. This is equal toAbstractFlowAnalysis.newInitialFlow()- Overrides:
entryInitialFlowin classAbstractFlowAnalysis<Unit,FlowSet<EquivalentValue>>
-
flowThrough
protected void flowThrough(FlowSet<EquivalentValue> in, Unit u, FlowSet<EquivalentValue> out)
Description copied from class:FlowAnalysisGiven the merge of theoutsets, compute theinset 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:
flowThroughin classFlowAnalysis<Unit,FlowSet<EquivalentValue>>- Parameters:
in- the input flowu- the current nodeout- the returned flow
-
merge
protected void merge(FlowSet<EquivalentValue> inSet1, FlowSet<EquivalentValue> inSet2, FlowSet<EquivalentValue> outSet)
Description copied from class:AbstractFlowAnalysisCompute the merge of thein1andin2sets, putting the result intoout. The behavior of this function depends on the implementation ( it may be necessary to check whetherin1andin2are equal or aliased ). Used by the doAnalysis method.- Specified by:
mergein classAbstractFlowAnalysis<Unit,FlowSet<EquivalentValue>>
-
copy
protected void copy(FlowSet<EquivalentValue> sourceSet, FlowSet<EquivalentValue> destSet)
Description copied from class:AbstractFlowAnalysisCreates a copy of thesourceflow object indest.- Specified by:
copyin classAbstractFlowAnalysis<Unit,FlowSet<EquivalentValue>>
-
-