From: stephey <stephey>
Date: Mon, 25 Oct 2010 08:08:35 +0000 (+0000)
Subject: Improved heuristics for marking where resume cases are possible. Instead marking... 
X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=400b2141727b16db53892b60c62c671f5b07e4b9;p=IRC.git

Improved heuristics for marking where resume cases are possible. Instead marking every conflict as a possible resume case, it now only marks cases where there is a read conflict (which implies that there is a write somewhere else) or where there is an ancestor read conflict and a current conflict.
---

diff --git a/Robust/src/IR/Flat/RuntimeConflictResolver.java b/Robust/src/IR/Flat/RuntimeConflictResolver.java
index 29ec23a5..937fdaa1 100644
--- a/Robust/src/IR/Flat/RuntimeConflictResolver.java
+++ b/Robust/src/IR/Flat/RuntimeConflictResolver.java
@@ -469,7 +469,7 @@ public class RuntimeConflictResolver {
 
       if (!created.containsKey(rootKey)) {
         created.put(rootKey, singleRoot);
-        createHelper(singleRoot, edge.getDst().iteratorToReferencees(), created, table, t);
+        createHelper(singleRoot, edge.getDst().iteratorToReferencees(), created, table, t, false);
       }
     }
   }
@@ -480,8 +480,10 @@ public class RuntimeConflictResolver {
                             Iterator<RefEdge> edges, 
                             Hashtable<Integer, ConcreteRuntimeObjNode> created,
                             EffectsTable table, 
-                            Taint taint) {
+                            Taint taint,
+                            boolean ancestorCanBeIncorrectIn) {
     assert table != null;
+    boolean ancestorCanBeIncorrect = ancestorCanBeIncorrectIn;
     AllocSite parentKey = curr.allocSite;
     EffectsGroup currEffects = table.getEffects(parentKey, taint); 
     
@@ -511,8 +513,17 @@ public class RuntimeConflictResolver {
           curr.addObjChild(field, child, effectsForGivenField);
           
           if (effectsForGivenField.hasConflict()) {
-            child.hasPotentialToBeIncorrectDueToConflict = true;
             propagateObjConflict(curr, child);
+            
+            //Ancestor had a read conflict down this field
+            if(ancestorCanBeIncorrect) {
+              child.hasPotentialToBeIncorrectDueToConflict = true;
+            }
+            //read conflict implies that there's got to be a write somewhere else. 
+            else if(effectsForGivenField.hasReadConflict) {
+              child.hasPotentialToBeIncorrectDueToConflict = true;
+              ancestorCanBeIncorrect = true;
+            }
           }
           
           if(effectsForGivenField.hasReadEffect) {
@@ -520,7 +531,7 @@ public class RuntimeConflictResolver {
             
             //If isNewChild, flag propagation will be handled at recursive call
             if(isNewChild) {
-              createHelper(child, childHRN.iteratorToReferencees(), created, table, taint);
+              createHelper(child, childHRN.iteratorToReferencees(), created, table, taint, ancestorCanBeIncorrect);
             } else {
             //This makes sure that all conflicts below the child is propagated up the referencers.
               if(child.decendantsPrimConflict || child.hasPrimitiveConflicts()) {