|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsoot.toolkits.scalar.AbstractFlowAnalysis<N,A>
soot.toolkits.scalar.FlowAnalysis<N,A>
soot.toolkits.scalar.ForwardFlowAnalysis<Unit,HashMap<Value,Object>>
soot.jimple.toolkits.pointer.LocalMustAliasAnalysis
public class LocalMustAliasAnalysis
LocalMustAliasAnalysis attempts to determine if two local
variables (at two potentially different program points) must point
to the same object.
The underlying abstraction is based on global value numbering.
See also StrongLocalMustAliasAnalysis
for an analysis
that soundly treats redefinitions within loops.
See Sable TR 2007-8 for details.
StrongLocalMustAliasAnalysis
Field Summary | |
---|---|
protected SootMethod |
container
the containing method |
protected Set<Value> |
localsAndFieldRefs
The set of all local variables and field references that we track. |
protected HashMap<BinaryIdentitySet<HashMap<Value,Object>>,Integer> |
mergeToNumber
maps from a merge point (set of containers for analysis information) to value numbers |
protected int |
nextNumber
the next value number |
protected static Object |
NOTHING
|
protected Map<Value,Integer> |
rhsToNumber
maps from right-hand side expressions (non-locals) to value numbers |
protected static Object |
UNKNOWN
|
static String |
UNKNOWN_LABEL
|
Fields inherited from class soot.toolkits.scalar.FlowAnalysis |
---|
filterUnitToAfterFlow, unitToAfterFlow |
Fields inherited from class soot.toolkits.scalar.AbstractFlowAnalysis |
---|
filterUnitToBeforeFlow, graph, unitToBeforeFlow |
Constructor Summary | |
---|---|
LocalMustAliasAnalysis(UnitGraph g)
Creates a new LocalMustAliasAnalysis tracking local variables. |
|
LocalMustAliasAnalysis(UnitGraph g,
boolean tryTrackFieldAssignments)
Creates a new LocalMustAliasAnalysis . |
Method Summary | |
---|---|
protected void |
copy(HashMap<Value,Object> sourceMap,
HashMap<Value,Object> destMap)
Creates a copy of the source flow object in dest . |
protected HashMap<Value,Object> |
entryInitialFlow()
Initial most conservative value: has to be UNKNOWN (top). |
protected void |
flowThrough(HashMap<Value,Object> in,
Unit u,
HashMap<Value,Object> 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. |
String |
instanceKeyString(Local l,
Stmt s)
Returns a string (natural number) representation of the instance key associated with l at statement s or null if there is no such key associated or UNKNOWN if
the value of l at s is UNKNOWN . |
protected void |
merge(HashMap<Value,Object> inMap1,
HashMap<Value,Object> inMap2,
HashMap<Value,Object> outMap)
Compute the merge of the in1 and in2 sets, putting the result into out . |
boolean |
mustAlias(Local l1,
Stmt s1,
Local l2,
Stmt s2)
|
protected HashMap<Value,Object> |
newInitialFlow()
Initial bottom value: objects have no definitions. |
Methods inherited from class soot.toolkits.scalar.ForwardFlowAnalysis |
---|
constructWorklist, doAnalysis, isForward |
Methods inherited from class soot.toolkits.scalar.FlowAnalysis |
---|
constructOrderer, getFlowAfter |
Methods inherited from class soot.toolkits.scalar.AbstractFlowAnalysis |
---|
getFlowBefore, merge, treatTrapHandlersAsEntries |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String UNKNOWN_LABEL
protected static final Object UNKNOWN
protected static final Object NOTHING
protected Set<Value> localsAndFieldRefs
Local
and, if tryTrackFieldAssignments is
enabled, it may also contain EquivalentValue
s of FieldRef
s.
If so, these field references are to be tracked on the same way as Local
s are.
protected transient Map<Value,Integer> rhsToNumber
protected transient HashMap<BinaryIdentitySet<HashMap<Value,Object>>,Integer> mergeToNumber
protected int nextNumber
protected SootMethod container
Constructor Detail |
---|
public LocalMustAliasAnalysis(UnitGraph g)
LocalMustAliasAnalysis
tracking local variables.
public LocalMustAliasAnalysis(UnitGraph g, boolean tryTrackFieldAssignments)
LocalMustAliasAnalysis
. If tryTrackFieldAssignments,
we run an interprocedural side-effects analysis to determine which fields
are (transitively) written to by this method. All fields which that are not written
to are tracked just as local variables. This semantics is sound for single-threaded programs.
Method Detail |
---|
protected void merge(HashMap<Value,Object> inMap1, HashMap<Value,Object> inMap2, HashMap<Value,Object> outMap)
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,HashMap<Value,Object>>
protected void flowThrough(HashMap<Value,Object> in, Unit u, HashMap<Value,Object> 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,HashMap<Value,Object>>
protected void copy(HashMap<Value,Object> sourceMap, HashMap<Value,Object> destMap)
AbstractFlowAnalysis
source
flow object in dest
.
copy
in class AbstractFlowAnalysis<Unit,HashMap<Value,Object>>
protected HashMap<Value,Object> entryInitialFlow()
UNKNOWN
(top).
entryInitialFlow
in class AbstractFlowAnalysis<Unit,HashMap<Value,Object>>
protected HashMap<Value,Object> newInitialFlow()
newInitialFlow
in class AbstractFlowAnalysis<Unit,HashMap<Value,Object>>
public String instanceKeyString(Local l, Stmt s)
null
if there is no such key associated or UNKNOWN
if
the value of l at s is UNKNOWN
.
l
- any local of the associated methods
- the statement at which to checkpublic 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 mustAlias(Local l1, Stmt s1, Local l2, Stmt s2)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |