From: stephey Date: Wed, 10 Nov 2010 21:39:36 +0000 (+0000) Subject: Fixed grouping of weakly connected heaproots and removed yucky hacks. Previous versio... X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=83e33ea1e36d3095d081510b5cb6e2d4fa8cd992;p=IRC.git Fixed grouping of weakly connected heaproots and removed yucky hacks. Previous version did not iterate through the entire list of connected heaproots when forming a group out of them. --- diff --git a/Robust/src/IR/Flat/BuildCode.java b/Robust/src/IR/Flat/BuildCode.java index 6e9d5eb7..8295f212 100644 --- a/Robust/src/IR/Flat/BuildCode.java +++ b/Robust/src/IR/Flat/BuildCode.java @@ -4784,11 +4784,7 @@ public class BuildCode { output.println(" while(rec!=NULL) {"); output.println(" for(idx2=0;idx2index;idx2++) {"); - // HACK!!! PART OF THE allHashStructures HACK in - // RuntimeConflictResolver.java as well, the problem - // is that we are just using ONE hashtable for the momen - //int weaklyConnectedComponentIndex = rcr.getWeakID(inset.get(i),fsen); - int weaklyConnectedComponentIndex = 0; + int weaklyConnectedComponentIndex = rcr.getWeakID(inset.get(i),fsen); output.println(" rcr_RETIREHASHTABLE(hashstruct["+ weaklyConnectedComponentIndex+ diff --git a/Robust/src/IR/Flat/RuntimeConflictResolver.java b/Robust/src/IR/Flat/RuntimeConflictResolver.java index c94f2e78..e363e277 100644 --- a/Robust/src/IR/Flat/RuntimeConflictResolver.java +++ b/Robust/src/IR/Flat/RuntimeConflictResolver.java @@ -815,18 +815,10 @@ public class RuntimeConflictResolver { String strrcr=taint.isRBlockTaint()?"&record->rcrRecords["+index+"], ":"NULL, "; String tasksrc=taint.isRBlockTaint()?"(SESEcommon *) record, ":"(SESEcommon *)(((INTPTR)record)|1LL), "; - - - // YUCKY HACK FOR NOW, ALWAYS USE ONE HASH TABLE - // (CONSVERATIVELY PUT ALL PARAMS INTO ONE CONNECTED COMPONENT) - // UNTIL WE FIGURE OUT WHY YOU SOMETIMES GET DIFFERENT - // heaprootNum VALUES WHEN THEY SHOULD BE THE SAME - // We should use the commented lines in the if statements... - int heaprootNum = 0; //Do call if we need it. if(primConfWrite||objConfWrite) { - //int heaprootNum = connectedHRHash.get(taint).id; + int heaprootNum = connectedHRHash.get(taint).id; assert heaprootNum != -1; int allocSiteID = connectedHRHash.get(taint).getWaitingQueueBucketNum(curr); int traverserID = doneTaints.get(taint); @@ -836,7 +828,7 @@ public class RuntimeConflictResolver { else currCase.append(" int tmpvar"+depth+"=rcr_WRITEBINCASE(allHashStructures["+heaprootNum+"], tmpkey"+depth+", "+ tasksrc+strrcr+index+");\n"); } else if (primConfRead||objConfRead) { - //int heaprootNum = connectedHRHash.get(taint).id; + int heaprootNum = connectedHRHash.get(taint).id; assert heaprootNum != -1; int allocSiteID = connectedHRHash.get(taint).getWaitingQueueBucketNum(curr); int traverserID = doneTaints.get(taint); @@ -934,13 +926,15 @@ public class RuntimeConflictResolver { num2WeaklyConnectedHRGroup.add(weaklyConnectedHRCounter, hg); weaklyConnectedHRCounter++; } + if(t.isRBlockTaint()) { - int id=connectedHRHash.get(t).id; - Tuple tup=new Tuple(t.getVar(),t.getSESE()); - if (weakMap.containsKey(tup)) { - if (weakMap.get(tup).intValue()!=id) - throw new Error("Var/SESE not unique for weak component."); - } else weakMap.put(tup, new Integer(id)); + int id=connectedHRHash.get(t).id; + Tuple tup=new Tuple(t.getVar(),t.getSESE()); + if (weakMap.containsKey(tup)) { + if (weakMap.get(tup).intValue()!=id) + throw new Error("Var/SESE not unique for weak component."); + } else + weakMap.put(tup, new Integer(id)); } } } @@ -1403,8 +1397,10 @@ public class RuntimeConflictResolver { Iterator it = oldGroup.connectedHRs.iterator(); Taint relatedTaint; - while((relatedTaint = it.next()) != null && !connectedHRs.contains(relatedTaint)) { - this.add(relatedTaint); + while(it.hasNext() && (relatedTaint = it.next()) != null) { + if(!connectedHRs.contains(relatedTaint)){ + this.add(relatedTaint); + } } } }