Fixed grouping of weakly connected heaproots and removed yucky hacks. Previous versio...
authorstephey <stephey>
Wed, 10 Nov 2010 21:39:36 +0000 (21:39 +0000)
committerstephey <stephey>
Wed, 10 Nov 2010 21:39:36 +0000 (21:39 +0000)
Robust/src/IR/Flat/BuildCode.java
Robust/src/IR/Flat/RuntimeConflictResolver.java

index 6e9d5eb7980a9dad801f3b50110f7f986b4a02ca..8295f212c1543480f20c74faf3567fc8976a2c45 100644 (file)
@@ -4784,11 +4784,7 @@ public class BuildCode {
        output.println("    while(rec!=NULL) {");
        output.println("      for(idx2=0;idx2<rec->index;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+
index c94f2e78e6a0969e124e6090c016e0587fc23aec..e363e277e204afc82629cd7c031fbd0d485397a9 100644 (file)
@@ -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<Taint> 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);
+          }
         }
       }
     }