changes
authorbdemsky <bdemsky>
Wed, 20 Oct 2010 23:53:27 +0000 (23:53 +0000)
committerbdemsky <bdemsky>
Wed, 20 Oct 2010 23:53:27 +0000 (23:53 +0000)
Robust/src/Analysis/OoOJava/ConflictGraph.java
Robust/src/IR/Flat/BuildCode.java
Robust/src/IR/Flat/RuntimeConflictResolver.java
Robust/src/Runtime/oooJava/hashStructure.c
Robust/src/Runtime/oooJava/hashStructure.h

index 81696a2a3f4f848cc06e8afcf67ea3941ea6d4b4..a7e07c934ee468107f79f90e59072c6ff1bfdf2b 100644 (file)
@@ -585,13 +585,14 @@ public class ConflictGraph {
       set.add(waitingElement);
       map.put(new Integer(waitingElement.getQueueID()), set);
     }
-
+    
     Set<Integer> keySet = map.keySet();
     for (Iterator iterator = keySet.iterator(); iterator.hasNext();) {
       Integer queueID = (Integer) iterator.next();
       Set<WaitingElement> queueWEset = map.get(queueID);
       refineQueue(queueID.intValue(), queueWEset, seseDS);
     }
+
     return seseDS;
   }
 
index 9b2617374ee1931414cf0740d8d9040cddc63b31..e433898fd501e85dd2e5edf897c4baa1103efc41 100644 (file)
@@ -4262,11 +4262,10 @@ public class BuildCode {
     }
   }
 
-  public void generateFlatSESEExitNode( FlatMethod fm,  
-                                       LocalityBinding lb, 
-                                       FlatSESEExitNode fsexn, 
-                                       PrintWriter output
-                                     ) {
+  public void generateFlatSESEExitNode( FlatMethod fm,
+                                       LocalityBinding lb,
+                                       FlatSESEExitNode fsexn,
+                                       PrintWriter output) {
 
     // if MLP flag is off, okay that SESE nodes are in IR graph, 
     // just skip over them and code generates exactly the same 
index 83b216b9be64c8ea344bcdc2adb1b33185b11490..dee52e16703e8f83c44984d0b9a4085a23fb5940 100644 (file)
@@ -804,13 +804,12 @@ public class RuntimeConflictResolver {
           String structType = ref.child.original.getType().getSafeSymbol();
           currCase.append("    struct " + structType + " * "+currPtr+"= (struct "+ structType + " * ) " + childPtr + ";\n");
   
-  
           // Checks if the child exists and has allocsite matching the conflict
           currCase.append("    if (" + currPtr + " != NULL && " + currPtr + getAllocSiteInC + "==" + ref.allocSite + ") {\n");
   
           if (ref.child.decendantsConflict() || ref.child.hasPrimitiveConflicts()) {
             // Checks if we have visited the child before
-  
+
             currCase.append("    if (" + queryVistedHashtable +"("+ currPtr + ")) {\n");
             if (ref.child.getNumOfReachableParents() == 1 && !ref.child.isInsetVar) {
               addChecker(taint, ref.child, cases, currCase, currPtr, depth + 1);
@@ -818,14 +817,12 @@ public class RuntimeConflictResolver {
             else {
               currCase.append("      " + addToQueueInC + childPtr + ");\n ");
             }
-            
             currCase.append("    }\n");
           }
           //one more brace for the opening if
           if(ref.hasDirectObjConflict()) {
             currCase.append("   }\n");
           }
-          
           currCase.append("  }\n ");
         }
       }
index 02970aab6a0002d8d691deef89a250a2eb846d08..b66ca0f17ca1be5547eb66f10bae48a4dc00d730 100644 (file)
@@ -114,7 +114,7 @@ int rcr_WRITEBINCASE(HashStructure *T, void *ptr, SESEcommon *task, int index) {
   bitvt bit=1<<index;
   if (wrmask&bit) {
     //count already includes this
-    status=READY;
+    status=SPECREADY;
   }
   b->bitindexwr=bit|wrmask;
   b->bitindexrd=bit|rdmask;
@@ -128,7 +128,10 @@ int rcr_WRITEBINCASE(HashStructure *T, void *ptr, SESEcommon *task, int index) {
       if (val==((BinItem_rcr *)b)) {
        b->item.status=READY;
        be->head=val;
-       return READY;
+       if (status&SPEC)
+         return SPECREADY;
+       else
+         return READY;
       }
       val=val->next;
     }
@@ -181,10 +184,9 @@ int rcr_READBINCASE(HashStructure *T, void *ptr, SESEcommon * task, int index) {
       if (!(td->bitindexrd & bit)) {
        td->bitindexrd|=bit;
        td->bitindexwr|=bit;
-       if (status==NOTREADY)
-         status=SPECNOTREADY;
+       status=status|SPEC;
       } else 
-       status=READY;
+       status=SPECREADY;
       be->head=val;
       return status;
     }
@@ -196,10 +198,9 @@ int rcr_READBINCASE(HashStructure *T, void *ptr, SESEcommon * task, int index) {
       int status=bintail->status;
       if (!(td->bitindex & bit)) {
        td->bitindex|=bit;
-       if (status==NOTREADY)
-         status=SPECNOTREADY;
+       status=status|SPEC;
       } else 
-       status=READY;
+       status=SPECREADY;
       be->head=val;
       return status;
     }
index 6932bd0016f21283473c75fb812ff55f6b2bdd32..65dd9a42c3fe0dbd780ca47e995400201daaa180 100644 (file)
 #define BINMASK 1\r
 #define PARENTBIN 1\r
 \r
-#define SPECREADY 3\r
-#define SPECNOTREADY 2\r
-#define READY 1\r
-#define NOTREADY 0\r
+#define SPEC 2\r
+#define READY 1          //Item is ready and we haven't seen this bin before\r
+#define NOTREADY 0       //Item is not ready and we haven't seen this bin before\r
+#define SPECREADY (SPEC|READY)      //Item is ready and we've seen this bin before\r
+#define SPECNOTREADY (SPEC|NOTREADY)   //Item is not ready and we've seen this bin before\r
 #define READYMASK 1\r
+
 \r
 #define TRUE 1\r
 #define FALSE 0\r