package Analysis.OoOJava;
import java.io.BufferedWriter;
+import java.io.File;
import java.io.FileWriter;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import java.util.Map.Entry;
+
+import IR.ClassDescriptor;
import IR.State;
import Util.Pair;
protected Hashtable<String, ConflictNode> id2cn;
protected Hashtable<FlatNode, Hashtable<Taint, Set<Effect>>> sese2te;
- protected HashMap<Pair<Alloc, FieldDescriptor>, Integer> seseEffects;
- protected HashMap<Pair<Alloc, FieldDescriptor>, Integer> stallEffects;
protected DisjointAnalysis da;
protected FlatMethod fmEnclosing;
public static final int NON_WRITE_CONFLICT = 0;
public static final int FINE_GRAIN_EDGE = 1;
public static final int COARSE_GRAIN_EDGE = 2;
-
+
State state;
public ConflictGraph(State state) {
- this.state=state;
+ this.state = state;
id2cn = new Hashtable<String, ConflictNode>();
sese2te = new Hashtable<FlatNode, Hashtable<Taint, Set<Effect>>>();
- seseEffects = new HashMap<Pair<Alloc, FieldDescriptor>, Integer>();
- stallEffects = new HashMap<Pair<Alloc, FieldDescriptor>, Integer>();
- }
-
- public int getStallEffects(Alloc affectedNode, FieldDescriptor fd) {
- return stallEffects.get(new Pair<Alloc, FieldDescriptor>(affectedNode, fd)).intValue();
- }
-
- public int getSESEEffects(Alloc affectedNode, FieldDescriptor fd) {
- return seseEffects.get(new Pair<Alloc, FieldDescriptor>(affectedNode, fd)).intValue();
}
public void setDisJointAnalysis(DisjointAnalysis da) {
while (entryIter.hasNext()) {
Entry entry = (Entry) entryIter.next();
Taint taint = (Taint) entry.getKey();
- Set<Effect> effectSet = (Set<Effect>) entry.getValue();
+ Set<Effect> effectSet = (Set<Effect>)entry.getValue();
if (!effectSet.isEmpty()) {
Iterator<Effect> effectIter = effectSet.iterator();
while (effectIter.hasNext()) {
}
}
- public void addStallSite(Hashtable<Taint, Set<Effect>> taint2Effects, TempDescriptor var) {
+ public void addStallSite(Hashtable<Taint, Set<Effect>> taint2Effects, TempDescriptor var,
+ ClassDescriptor cd) {
if (taint2Effects == null) {
return;
}
while (entryIter.hasNext()) {
Entry entry = (Entry) entryIter.next();
Taint taint = (Taint) entry.getKey();
- Set<Effect> effectSet = (Set<Effect>) entry.getValue();
+ Set<Effect> effectSet = (Set<Effect>)entry.getValue();
if (!effectSet.isEmpty()) {
Iterator<Effect> effectIter = effectSet.iterator();
while (effectIter.hasNext()) {
Effect effect = (Effect) effectIter.next();
if (taint.getVar().equals(var)) {
- addStallSiteEffect(taint, effect);
+ addStallSiteEffect(taint, effect, cd);
}
}
}
}
}
- public void addStallSiteEffect(Taint t, Effect e) {
+ public void addStallSiteEffect(Taint t, Effect e, ClassDescriptor cd) {
FlatNode fn = t.getStallSite();
TempDescriptor var = t.getVar();
Alloc as = t.getAllocSite();
String id = var + "_fn" + fn.hashCode();
ConflictNode node = id2cn.get(id);
if (node == null) {
- node = new ConflictNode(id, ConflictNode.STALLSITE, t.getVar(), t.getStallSite());
+ node = new ConflictNode(id, ConflictNode.STALLSITE, t.getVar(), t.getStallSite(), cd);
}
node.addEffect(as, e);
node.addTaint(t);
id2cn.put(id, node);
-
- Pair<Alloc, FieldDescriptor> p=new Pair<Alloc, FieldDescriptor>(e.getAffectedAllocSite(), e.getField());
- int type=e.getType();
- if (!stallEffects.containsKey(p))
- stallEffects.put(p, new Integer(type));
- else
- stallEffects.put(p, new Integer(type|stallEffects.get(p).intValue()));
}
public void addLiveInNodeEffect(Taint t, Effect e) {
id2cn.put(id, node);
- Pair<Alloc, FieldDescriptor> p=new Pair<Alloc, FieldDescriptor>(e.getAffectedAllocSite(), e.getField());
- int type=e.getType();
- if (!seseEffects.containsKey(p))
- seseEffects.put(p, new Integer(type));
- else
- seseEffects.put(p, new Integer(type|seseEffects.get(p).intValue()));
}
public void addConflictEdge(int type, ConflictNode nodeU, ConflictNode nodeV) {
// priority
Set<ConflictEdge> set = nodeU.getEdgeSet();
ConflictEdge toBeRemoved = null;
- for (Iterator iterator = set.iterator(); iterator.hasNext();) {
+ for (Iterator iterator = set.iterator(); iterator.hasNext(); ) {
ConflictEdge conflictEdge = (ConflictEdge) iterator.next();
if ((conflictEdge.getVertexU().equals(nodeU) && conflictEdge.getVertexV().equals(nodeV))
toBeRemoved = conflictEdge;
break;
} else if (conflictEdge.getType() == ConflictGraph.COARSE_GRAIN_EDGE
- && type == ConflictGraph.FINE_GRAIN_EDGE) {
+ && type == ConflictGraph.FINE_GRAIN_EDGE) {
// ignore
return;
}
Set<String> keySet = id2cn.keySet();
Set<String> analyzedIDSet = new HashSet<String>();
- for (Iterator iterator = keySet.iterator(); iterator.hasNext();) {
+ for (Iterator iterator = keySet.iterator(); iterator.hasNext(); ) {
String nodeID = (String) iterator.next();
ConflictNode node = id2cn.get(nodeID);
analyzePossibleConflicts(analyzedIDSet, node, sitesToFlag, useReachInfo);
}
private void analyzePossibleConflicts(Set<String> analyzedIDSet, ConflictNode currentNode,
- Set<FlatNew> sitesToFlag, boolean useReachInfo) {
+ Set<FlatNew> sitesToFlag, boolean useReachInfo) {
// compare with all nodes
// examine the case where self-edge exists
}
Set<Entry<String, ConflictNode>> set = id2cn.entrySet();
- for (Iterator iterator = set.iterator(); iterator.hasNext();) {
- Entry<String, ConflictNode> entry = (Entry<String, ConflictNode>) iterator.next();
+ for (Iterator iterator = set.iterator(); iterator.hasNext(); ) {
+ Entry<String, ConflictNode> entry = (Entry<String, ConflictNode>)iterator.next();
String entryNodeID = entry.getKey();
ConflictNode entryNode = entry.getValue();
if ((!currentNode.getID().equals(entryNodeID))
&& !(analyzedIDSet.contains(currentNode.getID() + entryNodeID) || analyzedIDSet
.contains(entryNodeID + currentNode.getID()))) {
-
+
conflictType = calculateConflictType(currentNode, entryNode, useReachInfo);
if (conflictType > ConflictGraph.NON_WRITE_CONFLICT) {
addConflictEdge(conflictType, currentNode, entryNode);
}
private int calculateConflictType(ConflictNode node, boolean useReachInfo) {
-
+
int conflictType = ConflictGraph.NON_WRITE_CONFLICT;
- Hashtable<Alloc, Set<Effect>> alloc2readEffects = node.getReadEffectSet();
- Hashtable<Alloc, Set<Effect>> alloc2writeEffects = node.getWriteEffectSet();
- Hashtable<Alloc, Set<Effect>> alloc2SUEffects = node.getStrongUpdateEffectSet();
+ Hashtable<Alloc, Set<Effect>> alloc2readEffects = node.getReadEffectSet();
+ Hashtable<Alloc, Set<Effect>> alloc2writeEffects = node.getWriteEffectSet();
+ Hashtable<Alloc, Set<Effect>> alloc2SUEffects = node.getStrongUpdateEffectSet();
conflictType =
- updateConflictType(conflictType, determineConflictType(node, alloc2writeEffects, node,
- alloc2writeEffects, useReachInfo));
+ updateConflictType(conflictType,
+ determineConflictType(node, alloc2writeEffects, node, alloc2writeEffects, useReachInfo));
conflictType =
- updateConflictType(conflictType, hasStrongUpdateConflicts(node, alloc2SUEffects, node,
- alloc2readEffects, alloc2writeEffects, useReachInfo));
+ updateConflictType(
+ conflictType,
+ hasStrongUpdateConflicts(node, alloc2SUEffects, node, alloc2readEffects,
+ alloc2writeEffects, useReachInfo));
return conflictType;
}
// if node A has write effects on reading/writing regions of node B
conflictType =
- updateConflictType(conflictType, determineConflictType(nodeA, alloc2writeEffectsA, nodeB,
- alloc2readEffectsB, useReachInfo));
+ updateConflictType(
+ conflictType,
+ determineConflictType(nodeA, alloc2writeEffectsA, nodeB, alloc2readEffectsB,
+ useReachInfo));
conflictType =
- updateConflictType(conflictType, determineConflictType(nodeA, alloc2writeEffectsA, nodeB,
- alloc2writeEffectsB, useReachInfo));
+ updateConflictType(
+ conflictType,
+ determineConflictType(nodeA, alloc2writeEffectsA, nodeB, alloc2writeEffectsB,
+ useReachInfo));
// if node B has write effects on reading regions of node A
conflictType =
- updateConflictType(conflictType, determineConflictType(nodeB, alloc2writeEffectsB, nodeA,
- alloc2readEffectsA, useReachInfo));
+ updateConflictType(
+ conflictType,
+ determineConflictType(nodeB, alloc2writeEffectsB, nodeA, alloc2readEffectsA,
+ useReachInfo));
// strong udpate effects conflict with all effects
// on objects that are reachable from the same heap roots
// if node A has SU on regions of node B
if (!alloc2SUEffectsA.isEmpty()) {
conflictType =
- updateConflictType(conflictType, hasStrongUpdateConflicts(nodeA, alloc2SUEffectsA, nodeB,
- alloc2readEffectsB, alloc2writeEffectsB, useReachInfo));
+ updateConflictType(
+ conflictType,
+ hasStrongUpdateConflicts(nodeA, alloc2SUEffectsA, nodeB, alloc2readEffectsB,
+ alloc2writeEffectsB, useReachInfo));
}
// if node B has SU on regions of node A
if (!alloc2SUEffectsB.isEmpty()) {
conflictType =
- updateConflictType(conflictType, hasStrongUpdateConflicts(nodeB, alloc2SUEffectsB, nodeA,
- alloc2readEffectsA, alloc2writeEffectsA, useReachInfo));
+ updateConflictType(
+ conflictType,
+ hasStrongUpdateConflicts(nodeB, alloc2SUEffectsB, nodeA, alloc2readEffectsA,
+ alloc2writeEffectsA, useReachInfo));
}
return conflictType;
}
private int hasStrongUpdateConflicts(ConflictNode nodeA,
- Hashtable<Alloc, Set<Effect>> SUEffectsTableA, ConflictNode nodeB,
- Hashtable<Alloc, Set<Effect>> readTableB, Hashtable<Alloc, Set<Effect>> writeTableB,
- boolean useReachInfo) {
+ Hashtable<Alloc, Set<Effect>> SUEffectsTableA, ConflictNode nodeB,
+ Hashtable<Alloc, Set<Effect>> readTableB, Hashtable<Alloc, Set<Effect>> writeTableB,
+ boolean useReachInfo) {
int conflictType = ConflictGraph.NON_WRITE_CONFLICT;
Iterator effectItrA = SUEffectsTableA.entrySet().iterator();
while (effectItrA.hasNext()) {
- Map.Entry meA = (Map.Entry) effectItrA.next();
+ Map.Entry meA = (Map.Entry)effectItrA.next();
Alloc asA = (Alloc) meA.getKey();
- Set<Effect> strongUpdateSetA = (Set<Effect>) meA.getValue();
+ Set<Effect> strongUpdateSetA = (Set<Effect>)meA.getValue();
Iterator effectItrB = readTableB.entrySet().iterator();
while (effectItrB.hasNext()) {
- Map.Entry meB = (Map.Entry) effectItrB.next();
+ Map.Entry meB = (Map.Entry)effectItrB.next();
Alloc asB = (Alloc) meB.getKey();
- Set<Effect> esB = (Set<Effect>) meB.getValue();
+ Set<Effect> esB = (Set<Effect>)meB.getValue();
- for (Iterator iterator = strongUpdateSetA.iterator(); iterator.hasNext();) {
+ for (Iterator iterator = strongUpdateSetA.iterator(); iterator.hasNext(); ) {
Effect strongUpdateA = (Effect) iterator.next();
- for (Iterator iterator2 = esB.iterator(); iterator2.hasNext();) {
+ for (Iterator iterator2 = esB.iterator(); iterator2.hasNext(); ) {
Effect effectB = (Effect) iterator2.next();
if (strongUpdateA.getAffectedAllocSite().equals(effectB.getAffectedAllocSite())
if (!nodeA.equals(nodeB)) {
addCoarseEffect(nodeB, asB, effectB);
}
- conflictType=ConflictGraph.COARSE_GRAIN_EDGE;
+ conflictType = ConflictGraph.COARSE_GRAIN_EDGE;
} else {
return ConflictGraph.COARSE_GRAIN_EDGE;
}
effectItrB = writeTableB.entrySet().iterator();
while (effectItrB.hasNext()) {
- Map.Entry meB = (Map.Entry) effectItrB.next();
+ Map.Entry meB = (Map.Entry)effectItrB.next();
Alloc asB = (Alloc) meB.getKey();
- Set<Effect> esB = (Set<Effect>) meB.getValue();
+ Set<Effect> esB = (Set<Effect>)meB.getValue();
- for (Iterator iterator = strongUpdateSetA.iterator(); iterator.hasNext();) {
+ for (Iterator iterator = strongUpdateSetA.iterator(); iterator.hasNext(); ) {
Effect strongUpdateA = (Effect) iterator.next();
- for (Iterator iterator2 = esB.iterator(); iterator2.hasNext();) {
+ for (Iterator iterator2 = esB.iterator(); iterator2.hasNext(); ) {
Effect effectB = (Effect) iterator2.next();
if (strongUpdateA.getAffectedAllocSite().equals(effectB.getAffectedAllocSite())
}
- private int determineConflictType(ConflictNode nodeA,
- Hashtable<Alloc, Set<Effect>> nodeAtable, ConflictNode nodeB,
- Hashtable<Alloc, Set<Effect>> nodeBtable, boolean useReachInfo) {
+ private int determineConflictType(ConflictNode nodeA, Hashtable<Alloc, Set<Effect>> nodeAtable,
+ ConflictNode nodeB, Hashtable<Alloc, Set<Effect>> nodeBtable, boolean useReachInfo) {
int conflictType = ConflictGraph.NON_WRITE_CONFLICT;
Iterator effectItrA = nodeAtable.entrySet().iterator();
while (effectItrA.hasNext()) {
- Map.Entry meA = (Map.Entry) effectItrA.next();
+ Map.Entry meA = (Map.Entry)effectItrA.next();
Alloc asA = (Alloc) meA.getKey();
- Set<Effect> esA = (Set<Effect>) meA.getValue();
+ Set<Effect> esA = (Set<Effect>)meA.getValue();
Iterator effectItrB = nodeBtable.entrySet().iterator();
while (effectItrB.hasNext()) {
- Map.Entry meB = (Map.Entry) effectItrB.next();
+ Map.Entry meB = (Map.Entry)effectItrB.next();
Alloc asB = (Alloc) meB.getKey();
- Set<Effect> esB = (Set<Effect>) meB.getValue();
+ Set<Effect> esB = (Set<Effect>)meB.getValue();
- for (Iterator iterator = esA.iterator(); iterator.hasNext();) {
+ for (Iterator iterator = esA.iterator(); iterator.hasNext(); ) {
Effect effectA = (Effect) iterator.next();
- for (Iterator iterator2 = esB.iterator(); iterator2.hasNext();) {
+ for (Iterator iterator2 = esB.iterator(); iterator2.hasNext(); ) {
Effect effectB = (Effect) iterator2.next();
if (effectA.getAffectedAllocSite().equals(effectB.getAffectedAllocSite())
- && ((effectA.getField()!=null&&effectB.getField()!=null&&effectA.getField().equals(effectB.getField()))||
- (effectA.getField()==null&&effectB.getField()==null))) {
+ && ((effectA.getField() != null && effectB.getField() != null && effectA.getField()
+ .equals(effectB.getField())) || (effectA.getField() == null && effectB
+ .getField() == null))) {
if (useReachInfo) {
FlatNew fnRoot1 = asA.getFlatNew();
addCoarseEffect(nodeB, asB, effectB);
}
conflictType =
- updateConflictType(conflictType, ConflictGraph.COARSE_GRAIN_EDGE);
+ updateConflictType(conflictType, ConflictGraph.COARSE_GRAIN_EDGE);
}
} else {
if (da.mayBothReachTarget(fmEnclosing, fnRoot1, fnRoot2, fnTarget)) {
addCoarseEffect(nodeB, asB, effectB);
}
conflictType =
- updateConflictType(conflictType, ConflictGraph.COARSE_GRAIN_EDGE);
+ updateConflictType(conflictType, ConflictGraph.COARSE_GRAIN_EDGE);
} else {
}
}
if (!nodeA.equals(nodeB)) {
addCoarseEffect(nodeB, asB, effectB);
}
- conflictType=ConflictGraph.COARSE_GRAIN_EDGE;
+ conflictType = ConflictGraph.COARSE_GRAIN_EDGE;
} else {
return ConflictGraph.COARSE_GRAIN_EDGE;
}
private void addEffectSetByTaint(Taint t, Effect e) {
- FlatNode node=t.getSESE();
- if(node==null){
+ FlatNode node = t.getSESE();
+ if (node == null) {
// stall site case
- node=t.getStallSite();
+ node = t.getStallSite();
}
-
+
Hashtable<Taint, Set<Effect>> taint2Conflicts = sese2te.get(node);
if (taint2Conflicts == null) {
taint2Conflicts = new Hashtable<Taint, Set<Effect>>();
public void clearAllConflictEdge() {
Collection<ConflictNode> nodes = id2cn.values();
- for (Iterator iterator = nodes.iterator(); iterator.hasNext();) {
+ for (Iterator iterator = nodes.iterator(); iterator.hasNext(); ) {
ConflictNode conflictNode = (ConflictNode) iterator.next();
conflictNode.getEdgeSet().clear();
}
HashSet<ConflictEdge> returnSet = new HashSet<ConflictEdge>();
Collection<ConflictNode> nodes = id2cn.values();
- for (Iterator iterator = nodes.iterator(); iterator.hasNext();) {
+ for (Iterator iterator = nodes.iterator(); iterator.hasNext(); ) {
ConflictNode conflictNode = (ConflictNode) iterator.next();
returnSet.addAll(conflictNode.getEdgeSet());
}
public boolean hasConflictEdge() {
Set<String> keySet = id2cn.keySet();
- for (Iterator iterator = keySet.iterator(); iterator.hasNext();) {
+ for (Iterator iterator = keySet.iterator(); iterator.hasNext(); ) {
String key = (String) iterator.next();
ConflictNode node = id2cn.get(key);
if (node.getEdgeSet().size() > 0) {
if (node.getSESEIdentifier() == seseID) {
Set<ConflictEdge> edgeSet = node.getEdgeSet();
- for (Iterator iterator = edgeSet.iterator(); iterator.hasNext();) {
+ for (Iterator iterator = edgeSet.iterator(); iterator.hasNext(); ) {
ConflictEdge conflictEdge = (ConflictEdge) iterator.next();
- for (Iterator<SESELock> seseLockIter = seseLockSet.iterator(); seseLockIter.hasNext();) {
+ for (Iterator<SESELock> seseLockIter = seseLockSet.iterator(); seseLockIter.hasNext(); ) {
SESELock seseLock = seseLockIter.next();
if (seseLock.containsConflictNode(node)
&& seseLock.containsConflictEdge(conflictEdge)) {
newElement.setStatus(seseLock.getNodeType(node));
newElement.setTempDesc(node.getVar());
if (isFineElement(newElement.getStatus())) {
- newElement.setDynID(node.getVar().toString());
+ newElement.setDynID(node.getVar().toString());
}
if (!waitingElementSet.contains(newElement)) {
waitingElementSet.add(newElement);
// handle the case that multiple enqueues by an SESE for different live-in
// into the same queue
- return refineQueue(waitingElementSet);
+ return refineQueue(waitingElementSet);
}
HashMap<Integer, Set<WaitingElement>> map = new HashMap<Integer, Set<WaitingElement>>();
SESEWaitingQueue seseDS = new SESEWaitingQueue();
- for (Iterator iterator = waitingElementSet.iterator(); iterator.hasNext();) {
+ for (Iterator iterator = waitingElementSet.iterator(); iterator.hasNext(); ) {
WaitingElement waitingElement = (WaitingElement) iterator.next();
Set<WaitingElement> set = map.get(new Integer(waitingElement.getQueueID()));
if (set == null) {
set.add(waitingElement);
map.put(new Integer(waitingElement.getQueueID()), set);
}
-
+
Set<Integer> keySet = map.keySet();
- for (Iterator iterator = keySet.iterator(); iterator.hasNext();) {
+ for (Iterator iterator = keySet.iterator(); iterator.hasNext(); ) {
Integer queueID = (Integer) iterator.next();
Set<WaitingElement> queueWEset = map.get(queueID);
refineQueue(queueID.intValue(), queueWEset, seseDS);
}
private void refineQueue(int queueID, Set<WaitingElement> waitingElementSet,
- SESEWaitingQueue seseDS) {
+ SESEWaitingQueue seseDS) {
if (waitingElementSet.size() > 1) {
// only consider there is more than one element submitted by same SESE
WaitingElement SCCelement = null;
WaitingElement coarseElement = null;
- for (Iterator iterator = waitingElementSet.iterator(); iterator.hasNext();) {
+ for (Iterator iterator = waitingElementSet.iterator(); iterator.hasNext(); ) {
WaitingElement waitingElement = (WaitingElement) iterator.next();
if (waitingElement.getStatus() == ConflictNode.FINE_READ) {
numRead++;
if (SCCelement != null) {
// if there is at lease one SCC element, just enqueue SCC and
// ignore others.
- if(state.RCR){
+ if (state.RCR) {
// for rcr, we need to label all of coarse tempdescriptors
// here assume that all waiting elements are coarse
- for (Iterator iterator = waitingElementSet.iterator(); iterator.hasNext();) {
+ for (Iterator iterator = waitingElementSet.iterator(); iterator.hasNext(); ) {
WaitingElement waitingElement = (WaitingElement) iterator.next();
SCCelement.addTempDesc(waitingElement.getTempDesc());
- if(waitingElement!=SCCelement){
+ if (waitingElement != SCCelement) {
waitingElement.setBogus(true);
refinedSet.add(waitingElement);
}
}
}
refinedSet.add(SCCelement);
- } else if (numCoarse == 1 && (numRead + numWrite == total)) {
+ } else if (numCoarse == 1 && (numRead + numWrite == total)) {
// if one is a coarse, the othere are reads/write, enqueue SCC.
WaitingElement we = new WaitingElement();
we.setQueueID(queueID);
refinedSet.add(we);
} else if (numCoarse == total) {
// if there are multiple coarses, enqueue just one coarse.
- if(state.RCR){
+ if (state.RCR) {
// for rcr, we need to label all of coarse tempdescriptors
- for (Iterator iterator = waitingElementSet.iterator(); iterator.hasNext();) {
+ for (Iterator iterator = waitingElementSet.iterator(); iterator.hasNext(); ) {
WaitingElement waitingElement = (WaitingElement) iterator.next();
- if(waitingElement!=coarseElement){
+ if (waitingElement != coarseElement) {
coarseElement.addTempDesc(waitingElement.getTempDesc());
waitingElement.setBogus(true);
refinedSet.add(waitingElement);
}
public Set<WaitingElement> getStallSiteWaitingElementSet(FlatNode stallSite,
- Set<SESELock> seseLockSet) {
+ Set<SESELock> seseLockSet) {
HashSet<WaitingElement> waitingElementSet = new HashSet<WaitingElement>();
Iterator iter = id2cn.entrySet().iterator();
if (node.isStallSiteNode() && node.getStallSiteFlatNode().equals(stallSite)) {
Set<ConflictEdge> edgeSet = node.getEdgeSet();
- for (Iterator iter2 = edgeSet.iterator(); iter2.hasNext();) {
+ for (Iterator iter2 = edgeSet.iterator(); iter2.hasNext(); ) {
ConflictEdge conflictEdge = (ConflictEdge) iter2.next();
- for (Iterator<SESELock> seseLockIter = seseLockSet.iterator(); seseLockIter.hasNext();) {
+ for (Iterator<SESELock> seseLockIter = seseLockSet.iterator(); seseLockIter.hasNext(); ) {
SESELock seseLock = seseLockIter.next();
if (seseLock.containsConflictNode(node) && seseLock.containsConflictEdge(conflictEdge)) {
WaitingElement newElement = new WaitingElement();
attributes += "label=\"" + node.getID() + "\\n";
if (node.isStallSiteNode()) {
- attributes += "STALL SITE" + "\\n" + "\"]";
+ String srcFileName = node.getSourceFileName();
+ int separatorIdx = srcFileName.lastIndexOf(File.separator);
+ if (separatorIdx > 0) {
+ srcFileName = srcFileName.substring(separatorIdx + 1);
+ }
+ node.stallSite.getNumLine();
+ attributes +=
+ "STALL SITE" + "\\n" + srcFileName + ":" + node.getStallSiteFlatNode().getNumLine()
+ + "\\n" + "\"]";
} else {
attributes += "LIVE-IN" + "\\n" + "\"]";
}
bw.write(entry.getKey() + attributes + ";\n");
Set<ConflictEdge> edgeSet = node.getEdgeSet();
- for (Iterator iterator = edgeSet.iterator(); iterator.hasNext();) {
+ for (Iterator iterator = edgeSet.iterator(); iterator.hasNext(); ) {
ConflictEdge conflictEdge = (ConflictEdge) iterator.next();
ConflictNode u = conflictEdge.getVertexU();
if (!addedSet.contains(conflictEdge)) {
bw.write("" + u.getID() + "--" + v.getID() + "[label=" + conflictEdge.toGraphEdgeString()
- + ",decorate];\n");
+ + ",decorate];\n");
addedSet.add(conflictEdge);
}
bw.close();
}
-
+
public Hashtable<String, ConflictNode> getId2cn() {
return id2cn;
}