public class LocalMustNotAliasAnalysis extends ForwardFlowAnalysis<Unit,java.util.HashMap<Local,java.util.Set<NewExpr>>>
FlowAnalysis.Flow
Modifier and Type | Field and Description |
---|---|
protected java.util.Set<Local> |
locals |
protected static NewExpr |
UNKNOWN |
filterUnitToAfterFlow, unitToAfterFlow
filterUnitToBeforeFlow, graph, unitToBeforeFlow
Constructor and Description |
---|
LocalMustNotAliasAnalysis(DirectedGraph<Unit> directedGraph,
Body b) |
LocalMustNotAliasAnalysis(UnitGraph g) |
Modifier and Type | Method and Description |
---|---|
RefType |
concreteType(Local l,
Stmt s)
If the given local at the given statement was initialized with a single, concrete new-expression
then the type of this expression is returned.
|
protected void |
copy(java.util.HashMap<Local,java.util.Set<NewExpr>> source,
java.util.HashMap<Local,java.util.Set<NewExpr>> dest)
Creates a copy of the
source flow object in dest . |
protected java.util.HashMap<Local,java.util.Set<NewExpr>> |
entryInitialFlow()
Returns the initial flow value for entry/exit graph nodes.
|
protected void |
flowThrough(java.util.HashMap<Local,java.util.Set<NewExpr>> in,
Unit unit,
java.util.HashMap<Local,java.util.Set<NewExpr>> out)
Given the merge of the
out sets, compute the in
set for s (or in to out, depending on direction). |
boolean |
hasInfoOn(Local l,
Stmt s)
Returns true if this analysis has any information about local l
at statement s (i.e.
|
protected void |
merge(java.util.HashMap<Local,java.util.Set<NewExpr>> in1,
java.util.HashMap<Local,java.util.Set<NewExpr>> in2,
java.util.HashMap<Local,java.util.Set<NewExpr>> o)
Compute the merge of the
in1 and in2 sets, putting the result into out . |
protected java.util.HashMap<Local,java.util.Set<NewExpr>> |
newInitialFlow()
Returns the flow object corresponding to the initial values for
each graph node.
|
boolean |
notMayAlias(Local l1,
Stmt s1,
Local l2,
Stmt s2) |
doAnalysis, isForward
getFlow, getFlowAfter, getFlowBefore, omissible
merge, mergeInto, treatTrapHandlersAsEntries
protected static final NewExpr UNKNOWN
protected java.util.Set<Local> locals
public LocalMustNotAliasAnalysis(UnitGraph g)
public LocalMustNotAliasAnalysis(DirectedGraph<Unit> directedGraph, Body b)
protected void merge(java.util.HashMap<Local,java.util.Set<NewExpr>> in1, java.util.HashMap<Local,java.util.Set<NewExpr>> in2, java.util.HashMap<Local,java.util.Set<NewExpr>> o)
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,java.util.HashMap<Local,java.util.Set<NewExpr>>>
protected void flowThrough(java.util.HashMap<Local,java.util.Set<NewExpr>> in, Unit unit, java.util.HashMap<Local,java.util.Set<NewExpr>> out)
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,java.util.HashMap<Local,java.util.Set<NewExpr>>>
in
- the input flowunit
- the current nodeout
- the returned flowprotected void copy(java.util.HashMap<Local,java.util.Set<NewExpr>> source, java.util.HashMap<Local,java.util.Set<NewExpr>> dest)
AbstractFlowAnalysis
source
flow object in dest
.copy
in class AbstractFlowAnalysis<Unit,java.util.HashMap<Local,java.util.Set<NewExpr>>>
protected java.util.HashMap<Local,java.util.Set<NewExpr>> entryInitialFlow()
AbstractFlowAnalysis
AbstractFlowAnalysis.newInitialFlow()
entryInitialFlow
in class AbstractFlowAnalysis<Unit,java.util.HashMap<Local,java.util.Set<NewExpr>>>
protected java.util.HashMap<Local,java.util.Set<NewExpr>> newInitialFlow()
AbstractFlowAnalysis
newInitialFlow
in class AbstractFlowAnalysis<Unit,java.util.HashMap<Local,java.util.Set<NewExpr>>>
public boolean hasInfoOn(Local l, Stmt s)
UNKNOWN
).
In particular, it is safe to pass in locals/statements that are not
even part of the right method. In those cases false
will be returned.
Permits s to be null
, in which case false
will be returned.public boolean notMayAlias(Local l1, Stmt s1, Local l2, Stmt s2)