public class PurityGraph
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected MultiMap |
backEdges |
protected MultiMap |
backLocals |
static boolean |
doCheck |
protected MultiMap |
edges |
protected java.util.Set |
globEscape |
protected MultiMap |
locals |
protected MultiMap |
mutated |
protected java.util.Set |
nodes |
protected java.util.Set |
paramNodes |
protected java.util.Set |
ret |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone() |
static PurityGraph |
conservativeGraph(SootMethod m,
boolean withEffect)
Conservative constructor for unanalysable calls.
|
boolean |
equals(java.lang.Object o) |
static PurityGraph |
freshGraph(SootMethod m)
Special constructor for "pure" methods returning a fresh object.
|
protected java.util.Set<PurityNode> |
getEscaping() |
int |
hashCode() |
protected int |
internalParamStatus(PurityNode p) |
protected void |
internalPassEdges(java.util.Set toColor,
java.util.Set<PurityNode> dest,
boolean consider_inside) |
protected void |
internalPassNode(PurityNode node,
java.util.Set<PurityNode> dest,
boolean consider_inside) |
protected void |
internalPassNodes(java.util.Set toColor,
java.util.Set<PurityNode> dest,
boolean consider_inside) |
boolean |
isPure()
Call this on the merge of graphs at all return points of a method to
know whether the method is pure.
|
boolean |
isPureConstructor()
We use a less restrictive notion of purity for constructors: pure
constructors can mutate fields of this.
|
protected boolean |
localsPut(Local local,
PurityNode node) |
protected boolean |
localsPutAll(Local local,
java.util.Set nodes) |
protected boolean |
localsRemove(Local local) |
protected void |
mergeNodes(PurityNode src,
PurityNode dst)
Utility function to merge node src into dst; src is removed
|
int |
paramStatus(int param)
Call this on the merge of graphs at all return points of a method to
know whether an object passed as method parameter is read only
(PARAM_RO), read write (PARAM_RW), or safe (PARAM_SAFE).
|
protected void |
removeNode(PurityNode n)
Utility function to remove a node & all adjacent edges
|
protected void |
sanityCheck()
Sanity check.
|
int |
thisStatus() |
public static final boolean doCheck
protected java.util.Set nodes
protected java.util.Set paramNodes
protected MultiMap edges
protected MultiMap locals
protected java.util.Set ret
protected java.util.Set globEscape
protected MultiMap backEdges
protected MultiMap backLocals
protected MultiMap mutated
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public static PurityGraph conservativeGraph(SootMethod m, boolean withEffect)
Note: this gives a valid summary for all native methods, including Thread.start().
withEffect
- add a mutated abstract field for the global node to
account for side-effects in the environment (I/O, etc.).public static PurityGraph freshGraph(SootMethod m)
protected void sanityCheck()
protected void internalPassEdges(java.util.Set toColor, java.util.Set<PurityNode> dest, boolean consider_inside)
protected void internalPassNode(PurityNode node, java.util.Set<PurityNode> dest, boolean consider_inside)
protected void internalPassNodes(java.util.Set toColor, java.util.Set<PurityNode> dest, boolean consider_inside)
protected java.util.Set<PurityNode> getEscaping()
public boolean isPure()
public boolean isPureConstructor()
isPure
protected int internalParamStatus(PurityNode p)
public int paramStatus(int param)
public int thisStatus()
isParamReadOnly
public java.lang.Object clone()
clone
in class java.lang.Object
protected final boolean localsRemove(Local local)
protected final boolean localsPut(Local local, PurityNode node)
protected final boolean localsPutAll(Local local, java.util.Set nodes)
protected final void removeNode(PurityNode n)
protected final void mergeNodes(PurityNode src, PurityNode dst)