|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectharpoon.Analysis.PointerAnalysis.PAThreadMap
public class PAThreadMap
PAThreadMap
implements the parallel thread map
(i.e. the "tau" function from the algorithm). For each thread node
n, tau(n) is a conservative approximation of the number of instances
of nT that could run in parallel with the current thread.
tau(n) is a number from the set {0,1,2} where 0 stands for no instance,
1 for at most one instance and 2 for possibly multiple instances.
PAThreadMap
is more or less a Hashtable
with
some access functions to enforce the new rules for addition and
substraction.
Constructor Summary | |
---|---|
PAThreadMap()
Creates a PAThreadMap . |
Method Summary | |
---|---|
Enumeration |
activeThreads()
Returns all the thread nodes nT that have assigned
a non-zero count (i.e. tau(nT) > 0 in the algorithm) |
Set |
activeThreadSet()
Returns all the thread nodes nT that have assigned
a non-zero count (i.e. tau(nT) > 0 in the algorithm) |
void |
add(PANode n,
int delta)
Add a positive delta to the value attached to a node. |
Object |
clone()
clone creates a copy of this thread map;
by doing a simple shallow copy of the hash |
void |
dec(PANode n)
Decrements the value attached to n |
boolean |
equals(Object o)
Checks the equality of two PAThreadMap s |
int |
getValue(PANode n)
|
void |
inc(PANode n)
Increments the value attached to n |
void |
incAll(Set nodes)
Convenient function that calls inc for all the
nodes from set |
void |
insert(PAThreadMap tau2,
Relation mu)
Inserts the image of tau2 through the mu
mapping into this object. |
boolean |
isStarted(PANode nt)
Checks whether the thread "nt" is started or not. |
void |
join(PAThreadMap tau2)
join combines two PAThreadMap s in
a control-flow join poin |
PAThreadMap |
keepTheEssential(Set essential_nodes)
Produces a new PAThreadMap containing only the thread
nodes that appear in essential_nodes . |
void |
remove(Set set)
Remove all the PANode s that appear in set
from this thread map. |
void |
setToZero(PANode n)
Set to zero the value attached to the node n . |
PAThreadMap |
specialize(Map map)
|
String |
toString()
Pretty print function for debug purposes. |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public PAThreadMap()
PAThreadMap
.
Method Detail |
---|
public int getValue(PANode n)
public void inc(PANode n)
n
public void incAll(Set nodes)
inc
for all the
nodes from set
public void dec(PANode n)
n
public boolean isStarted(PANode nt)
public void add(PANode n, int delta)
delta
to the value attached to a node.
public void setToZero(PANode n)
n
.
public Enumeration activeThreads()
nT
that have assigned
a non-zero count (i.e. tau(nT) > 0 in the algorithm)
public Set activeThreadSet()
nT
that have assigned
a non-zero count (i.e. tau(nT) > 0 in the algorithm)
public void remove(Set set)
PANode
s that appear in set
from this
thread map.
public void join(PAThreadMap tau2)
join
combines two PAThreadMap
s in
a control-flow join poin
public void insert(PAThreadMap tau2, Relation mu)
tau2
through the mu
mapping into this
object.
Forall node
in tau2.activeThreads
,
forall node2
in mu(node)
,
tau(node2) += tau2(node)
.
public PAThreadMap specialize(Map map)
public Object clone()
clone
creates a copy of this
thread map;
by doing a simple shallow copy of the hash field.
- Overrides:
clone
in class Object
public PAThreadMap keepTheEssential(Set essential_nodes)
PAThreadMap
containing only the thread
nodes that appear in essential_nodes
.
public boolean equals(Object o)
PAThreadMap
s
equals
in class Object
public String toString()
tau1.equals(tau2) <==> tau1.toString().equals(tau2.toString()).
toString
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |