public class CombinedDUAnalysis extends BackwardFlowAnalysis<Unit,FlowSet<ValueBox>> implements CombinedAnalysis, LocalDefs, LocalUses, LiveLocals
FlowAnalysis.Flow
LocalDefs.Factory
LocalUses.Factory
LiveLocals.Factory
filterUnitToAfterFlow, unitToAfterFlow
filterUnitToBeforeFlow, graph, unitToBeforeFlow
Constructor and Description |
---|
CombinedDUAnalysis(UnitGraph graph) |
Modifier and Type | Method and Description |
---|---|
protected void |
copy(FlowSet<ValueBox> source,
FlowSet<ValueBox> dest)
Creates a copy of the
source flow object in dest . |
protected FlowSet<ValueBox> |
entryInitialFlow()
Returns the initial flow value for entry/exit graph nodes.
|
protected void |
flowThrough(FlowSet<ValueBox> out,
Unit u,
FlowSet<ValueBox> in)
Given the merge of the
out sets, compute the in
set for s (or in to out, depending on direction). |
java.util.List<Unit> |
getDefsOf(Local l)
Returns the definition sites for a Local merged over all points
in a method.
|
java.util.List<Unit> |
getDefsOfAt(Local l,
Unit s)
Returns the definition sites for a Local at a certain
point (Unit) in a method.
|
java.util.List<Local> |
getLiveLocalsAfter(Unit u)
Returns the list of Locals that are live after the specified
Unit.
|
java.util.List<Local> |
getLiveLocalsBefore(Unit u)
Returns the list of Locals that are live before the specified
Unit.
|
java.util.List<UnitValueBoxPair> |
getUsesOf(Unit u)
Returns a list of the Units that use the Local that is
defined by a given Unit.
|
protected void |
merge(FlowSet<ValueBox> inout,
FlowSet<ValueBox> in) |
protected void |
merge(FlowSet<ValueBox> in1,
FlowSet<ValueBox> in2,
FlowSet<ValueBox> out)
Compute the merge of the
in1 and in2 sets, putting the result into out . |
protected FlowSet<ValueBox> |
newInitialFlow()
Returns the flow object corresponding to the initial values for
each graph node.
|
doAnalysis, isForward
getFlow, getFlowAfter, getFlowBefore, omissible
merge, mergeInto, treatTrapHandlersAsEntries
public CombinedDUAnalysis(UnitGraph graph)
public java.util.List<Unit> getDefsOfAt(Local l, Unit s)
LocalDefs
null
.getDefsOfAt
in interface LocalDefs
l
- the Local in question.s
- a unit that specifies the method context (location)
to query for the definitions of the Local.public java.util.List<Unit> getDefsOf(Local l)
LocalDefs
null
.public java.util.List<UnitValueBoxPair> getUsesOf(Unit u)
LocalUses
public java.util.List<Local> getLiveLocalsBefore(Unit u)
LiveLocals
getLiveLocalsBefore
in interface LiveLocals
u
- the Unit that defines this query.public java.util.List<Local> getLiveLocalsAfter(Unit u)
LiveLocals
getLiveLocalsAfter
in interface LiveLocals
u
- the Unit that defines this query.protected void merge(FlowSet<ValueBox> in1, FlowSet<ValueBox> in2, FlowSet<ValueBox> out)
AbstractFlowAnalysis
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.merge
in class AbstractFlowAnalysis<Unit,FlowSet<ValueBox>>
protected void flowThrough(FlowSet<ValueBox> out, Unit u, FlowSet<ValueBox> in)
FlowAnalysis
out
sets, compute the in
set for s
(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).flowThrough
in class FlowAnalysis<Unit,FlowSet<ValueBox>>
out
- the input flowu
- the current nodein
- the returned flowprotected FlowSet<ValueBox> entryInitialFlow()
AbstractFlowAnalysis
AbstractFlowAnalysis.newInitialFlow()
entryInitialFlow
in class AbstractFlowAnalysis<Unit,FlowSet<ValueBox>>
protected FlowSet<ValueBox> newInitialFlow()
AbstractFlowAnalysis
newInitialFlow
in class AbstractFlowAnalysis<Unit,FlowSet<ValueBox>>
protected void copy(FlowSet<ValueBox> source, FlowSet<ValueBox> dest)
AbstractFlowAnalysis
source
flow object in dest
.copy
in class AbstractFlowAnalysis<Unit,FlowSet<ValueBox>>