fix a bug for Taint similar to ReachState, when either is an element of an ExistPred...
authorjjenista <jjenista>
Fri, 7 Oct 2011 21:16:48 +0000 (21:16 +0000)
committerjjenista <jjenista>
Fri, 7 Oct 2011 21:16:48 +0000 (21:16 +0000)
Robust/src/Analysis/Disjoint/DisjointAnalysis.java
Robust/src/Analysis/Disjoint/ExistPred.java
Robust/src/Analysis/Disjoint/RefEdge.java
Robust/src/Analysis/Disjoint/Taint.java
Robust/src/Benchmarks/oooJava/master-makefile

index 5c230a4a6d19b48b1108b3cc9c6e56b8dbba24a0..3c5e29e3411d88a636c49228a0c77978eb6ded95 100644 (file)
@@ -1778,7 +1778,7 @@ public class DisjointAnalysis implements HeapAnalysis {
           fc2enclosing.put(fc, mdCaller);
 
           if( state.DISJOINTDEBUGSCHEDULING ) {
-            System.out.println("  context changed, scheduling callee: "+mdPossible);
+            System.out.println("  context changed at callsite: "+fc+", scheduling callee: "+mdPossible);
           }
 
           if( state.DISJOINTDVISITSTACKEESONTOP ) {
@@ -2419,7 +2419,13 @@ public class DisjointAnalysis implements HeapAnalysis {
     Hashtable<FlatCall, ReachGraph> heapsFromCallers =
       getIHMcontributions(d);
 
-    heapsFromCallers.put(fc, rg);
+    // ensure inputs to initial contexts increase monotonically
+    ReachGraph merged = new ReachGraph();
+    merged.merge( rg );
+    merged.merge( heapsFromCallers.get( fc ) );
+
+    heapsFromCallers.put( fc, merged );
+    
   }
 
 
index 87c5e8426b44b395d451a211e01e419c0aa22222..a28d5b3ba253e62288b3124d7510138e1c668459 100644 (file)
@@ -80,7 +80,9 @@ public class ExistPred extends Canonical {
   // if the taint is non-null then the predicate
   // is true only if the edge exists AND has the
   // taint--ONLY ONE of the ne_state or e_taint
-  // may be non-null for an edge predicate
+  // may be non-null for an edge predicate, AND
+  // like the ne_state above, strip preds off this
+  // taint within a pred itself
   protected Taint e_taint;
 
 
@@ -191,7 +193,7 @@ public class ExistPred extends Canonical {
     this.e_type     = type;
     this.e_field    = field;
     this.ne_state   = removePreds( state );
-    this.e_taint    = taint;
+    this.e_taint    = removePreds( taint );
     this.predType   = TYPE_EDGE;
     n_hrnID = null;
   }
@@ -234,6 +236,10 @@ public class ExistPred extends Canonical {
     return state == null ? null : Canonical.attach( state, ExistPredSet.factory() );
   }
 
+  private Taint removePreds( Taint taint ) {
+    return taint == null ? null : Canonical.attach( taint, ExistPredSet.factory() );
+  }
+
 
 
   // only consider the subest of the caller elements that
@@ -508,7 +514,7 @@ public class ExistPred extends Canonical {
       if( pred.e_taint != null ) {
         return false;
       }
-    } else if( !e_taint.equals(pred.e_taint) ) {
+    } else if( !e_taint.equalsIgnorePreds(pred.e_taint) ) {
       return false;
     }
 
@@ -560,7 +566,7 @@ public class ExistPred extends Canonical {
       }
 
       if( e_taint != null ) {
-        hash ^= e_taint.hashCode();
+        hash ^= e_taint.hashCodeNoPreds();
       }
 
       return hash;
index 457e752e66cda84502a4e70fd834ff657d1f4018..1d0e349e646baffd843617bed017051c8a9ae220 100644 (file)
@@ -67,11 +67,7 @@ public class RefEdge {
     // is changing beta info, betaNew is always empty
     betaNew = ReachSet.factory();
 
-    if( taints != null ) {
-      this.taints = taints;
-    } else {
-      this.taints = TaintSet.factory();
-    }
+    setTaints( taints != null ? taints : TaintSet.factory() );
   }
 
 
index 05f6c2015c14f4e19719d7e7341a7f02e23808f8..4d664f3194f9679f1025417859b33fc88f7beeea 100644 (file)
@@ -100,7 +100,7 @@ public class Taint extends Canonical {
                   ExistPredSet eps) {
     assert
       (sese == null && stallSite != null) ||
-    (sese != null && stallSite == null);
+      (sese != null && stallSite == null);
 
     assert v   != null;
     assert as  != null;
@@ -205,6 +205,10 @@ public class Taint extends Canonical {
   }
 
   public int hashCodeSpecific() {
+    return hashCodeNoPreds() ^ preds.hashCode();
+  }
+
+  public int hashCodeNoPreds() {
     int hash = allocSite.hashCode();
     hash = hash ^ var.hashCode();
 
index c4dbbd39690dad89a0fc3fbabb57ea7c3b6887fe..8f2cb5a95842c614e758300eae1a2a33218470e0 100644 (file)
@@ -76,8 +76,10 @@ DISJOINT= -disjoint -disjoint-k 1 -enable-assertions $(DRELEASEMODE) #-disjoint-
 # EX: (skip first 10 visits, capture the next 3, then halt)
 # -disjoint-debug-snap-method Remove 10 3 true
 
-DISJOINTDEBUG= -disjoint -disjoint-k 1 -enable-assertions $(DRELEASEMODE) \
-       -disjoint-debug-callsite Barneshut.Insert Barneshut.run 50 500 true
+DISJOINTDEBUG= -disjoint -disjoint-k 1 -enable-assertions $(DRELEASEMODE)
+#      -disjoint-write-dots all
+#      -disjoint-debug-scheduling
+#      -disjoint-debug-callsite Barneshut.Insert Barneshut.run 50 500 true
 #      -disjoint-debug-snap-method ArrayIndexedGraph.createNode 1 100 true \
 #      -disjoint-write-dots final \
 #      -flatirusermethods \
@@ -91,7 +93,6 @@ DISJOINTDEBUG= -disjoint -disjoint-k 1 -enable-assertions $(DRELEASEMODE) \
 #
 #       -justanalyze \
 #      -disjoint-debug-callsite String.toString String.valueOf 1 1000 true \
-#      -disjoint-debug-scheduling \
 #      -disjoint-desire-determinism
 #      -disjoint-debug-callsite Demand.add Lateral.compute 1 1000 true
 #      -disjoint-debug-snap-method ComputeCenterOfMass 6 2 true