From: jjenista Date: Fri, 7 Oct 2011 21:16:48 +0000 (+0000) Subject: fix a bug for Taint similar to ReachState, when either is an element of an ExistPred... X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=64ab9a68b349fef02f9c8de0992054384a4dc1cf;p=IRC.git fix a bug for Taint similar to ReachState, when either is an element of an ExistPred, SCRUB the preds on the taint and reach state before adding it, and within ExistPred use the equalsIgnorePreds and hashCodeNoPreds variants --- diff --git a/Robust/src/Analysis/Disjoint/DisjointAnalysis.java b/Robust/src/Analysis/Disjoint/DisjointAnalysis.java index 5c230a4a..3c5e29e3 100644 --- a/Robust/src/Analysis/Disjoint/DisjointAnalysis.java +++ b/Robust/src/Analysis/Disjoint/DisjointAnalysis.java @@ -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 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 ); + } diff --git a/Robust/src/Analysis/Disjoint/ExistPred.java b/Robust/src/Analysis/Disjoint/ExistPred.java index 87c5e842..a28d5b3b 100644 --- a/Robust/src/Analysis/Disjoint/ExistPred.java +++ b/Robust/src/Analysis/Disjoint/ExistPred.java @@ -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; diff --git a/Robust/src/Analysis/Disjoint/RefEdge.java b/Robust/src/Analysis/Disjoint/RefEdge.java index 457e752e..1d0e349e 100644 --- a/Robust/src/Analysis/Disjoint/RefEdge.java +++ b/Robust/src/Analysis/Disjoint/RefEdge.java @@ -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() ); } diff --git a/Robust/src/Analysis/Disjoint/Taint.java b/Robust/src/Analysis/Disjoint/Taint.java index 05f6c201..4d664f31 100644 --- a/Robust/src/Analysis/Disjoint/Taint.java +++ b/Robust/src/Analysis/Disjoint/Taint.java @@ -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(); diff --git a/Robust/src/Benchmarks/oooJava/master-makefile b/Robust/src/Benchmarks/oooJava/master-makefile index c4dbbd39..8f2cb5a9 100644 --- a/Robust/src/Benchmarks/oooJava/master-makefile +++ b/Robust/src/Benchmarks/oooJava/master-makefile @@ -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