X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=Robust%2Fsrc%2FAnalysis%2FOoOJava%2FConflictGraph.java;h=75304f40e3a98d8b148d51307a87033e9f90b282;hb=c5c26ddb05dc4f492da8d5c69b1accd3cdee3d99;hp=7b30add54025e724ff24f6b66a13639fa830e1a1;hpb=dd6f48af15d1920c05420ae9a779a7a06bab2825;p=IRC.git diff --git a/Robust/src/Analysis/OoOJava/ConflictGraph.java b/Robust/src/Analysis/OoOJava/ConflictGraph.java index 7b30add5..75304f40 100644 --- a/Robust/src/Analysis/OoOJava/ConflictGraph.java +++ b/Robust/src/Analysis/OoOJava/ConflictGraph.java @@ -321,7 +321,16 @@ public class ConflictGraph { conflictType = updateConflictType(conflictType, ConflictGraph.COARSE_GRAIN_EDGE); } } else { - return ConflictGraph.COARSE_GRAIN_EDGE; + if (state.RCR) { + // need coarse effects for RCR from just one pass + addCoarseEffect(nodeA, asA, strongUpdateA); + if (!nodeA.equals(nodeB)) { + addCoarseEffect(nodeB, asB, effectB); + } + conflictType=ConflictGraph.COARSE_GRAIN_EDGE; + } else { + return ConflictGraph.COARSE_GRAIN_EDGE; + } } } @@ -425,14 +434,16 @@ public class ConflictGraph { } } } else { - if (state.RCR) { - //need coarse effects for RCR from just one pass - addCoarseEffect(nodeA, asA, effectA); - if (!nodeA.equals(nodeB)) { - addCoarseEffect(nodeB, asB, effectB); - } - } - return ConflictGraph.COARSE_GRAIN_EDGE; + if (state.RCR) { + // need coarse effects for RCR from just one pass + addCoarseEffect(nodeA, asA, effectA); + if (!nodeA.equals(nodeB)) { + addCoarseEffect(nodeB, asB, effectB); + } + conflictType=ConflictGraph.COARSE_GRAIN_EDGE; + } else { + return ConflictGraph.COARSE_GRAIN_EDGE; + } } } } @@ -547,9 +558,9 @@ public class ConflictGraph { WaitingElement newElement = new WaitingElement(); newElement.setQueueID(seseLock.getID()); newElement.setStatus(seseLock.getNodeType(node)); + newElement.setTempDesc(node.getVar()); if (isFineElement(newElement.getStatus())) { - newElement.setDynID(node.getVar().toString()); - newElement.setTempDesc(node.getVar()); + newElement.setDynID(node.getVar().toString()); } if (!waitingElementSet.contains(newElement)) { waitingElementSet.add(newElement); @@ -585,15 +596,14 @@ public class ConflictGraph { set.add(waitingElement); map.put(new Integer(waitingElement.getQueueID()), set); } - - if(!state.RCR){ - Set keySet = map.keySet(); - for (Iterator iterator = keySet.iterator(); iterator.hasNext();) { - Integer queueID = (Integer) iterator.next(); - Set queueWEset = map.get(queueID); - refineQueue(queueID.intValue(), queueWEset, seseDS); - } + + Set keySet = map.keySet(); + for (Iterator iterator = keySet.iterator(); iterator.hasNext();) { + Integer queueID = (Integer) iterator.next(); + Set queueWEset = map.get(queueID); + refineQueue(queueID.intValue(), queueWEset, seseDS); } + return seseDS; } @@ -624,12 +634,23 @@ public class ConflictGraph { SCCelement = waitingElement; } } - if (SCCelement != null) { // if there is at lease one SCC element, just enqueue SCC and // ignore others. + 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();) { + WaitingElement waitingElement = (WaitingElement) iterator.next(); + SCCelement.addTempDesc(waitingElement.getTempDesc()); + if(waitingElement!=SCCelement){ + waitingElement.setBogus(true); + refinedSet.add(waitingElement); + } + } + } refinedSet.add(SCCelement); - } else if (numCoarse == 1 && (numRead + numWrite + numCoarse == 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); @@ -637,6 +658,17 @@ public class ConflictGraph { refinedSet.add(we); } else if (numCoarse == total) { // if there are multiple coarses, enqueue just one coarse. + if(state.RCR){ + // for rcr, we need to label all of coarse tempdescriptors + for (Iterator iterator = waitingElementSet.iterator(); iterator.hasNext();) { + WaitingElement waitingElement = (WaitingElement) iterator.next(); + if(waitingElement!=coarseElement){ + coarseElement.addTempDesc(waitingElement.getTempDesc()); + waitingElement.setBogus(true); + refinedSet.add(waitingElement); + } + } + } refinedSet.add(coarseElement); } else if (numWrite == total || (numRead + numWrite) == total) { // code generator is going to handle the case for multiple writes & @@ -770,5 +802,9 @@ public class ConflictGraph { bw.close(); } + + public Hashtable getId2cn() { + return id2cn; + } }