From: jjenista Date: Fri, 10 Jun 2011 18:26:28 +0000 (+0000) Subject: Bug fix: in some cases we really do want the heap region inherent reach set to have... X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=a7ec16941adfee35e209a58e5b4a6bdb1d6fdb33;p=IRC.git Bug fix: in some cases we really do want the heap region inherent reach set to have preds other than true, but when we allocate a new node, the state on that node should always have a true pred also. --- diff --git a/Robust/src/Analysis/Disjoint/DisjointAnalysis.java b/Robust/src/Analysis/Disjoint/DisjointAnalysis.java index 1e7b1b91..a47426d8 100644 --- a/Robust/src/Analysis/Disjoint/DisjointAnalysis.java +++ b/Robust/src/Analysis/Disjoint/DisjointAnalysis.java @@ -1314,9 +1314,9 @@ public class DisjointAnalysis implements HeapAnalysis { rg.writeGraph("genReach"+fgrn.getGraphName(), true, // write labels (variables) - false, //true, // selectively hide intermediate temp vars + true, // selectively hide intermediate temp vars true, // prune unreachable heap regions - true, // hide reachability altogether + false, // hide reachability altogether true, // hide subset reachability states true, // hide predicates true); //false); // hide edge taints @@ -1856,6 +1856,7 @@ public class DisjointAnalysis implements HeapAnalysis { fn2rgAtExit.put(fn, rgOnExit); + // at this point rg should be the correct update // by an above transfer function, or untouched if // the flat node type doesn't affect the heap @@ -3027,7 +3028,7 @@ public class DisjointAnalysis implements HeapAnalysis { true, // prune unreachable heap regions false, // hide reachability false, // hide subset reachability states - true, // hide predicates + false, // hide predicates true); // hide edge taints } } diff --git a/Robust/src/Analysis/Disjoint/HeapRegionNode.java b/Robust/src/Analysis/Disjoint/HeapRegionNode.java index ed7e101f..c38617c9 100644 --- a/Robust/src/Analysis/Disjoint/HeapRegionNode.java +++ b/Robust/src/Analysis/Disjoint/HeapRegionNode.java @@ -319,7 +319,7 @@ public class HeapRegionNode extends RefSrcNode { description; if( !hideReach ) { - s += "\\n"+alpha.toStringEscNewline(hideSubsetReach); + s += "\\n"+alpha.toStringEscNewline(hideSubsetReach, hidePreds); } if( !hidePreds ) { diff --git a/Robust/src/Analysis/Disjoint/ReachGraph.java b/Robust/src/Analysis/Disjoint/ReachGraph.java index 7cab6054..b397af05 100644 --- a/Robust/src/Analysis/Disjoint/ReachGraph.java +++ b/Robust/src/Analysis/Disjoint/ReachGraph.java @@ -871,8 +871,8 @@ public class ReachGraph { // after tokens have been aged, reset newest node's reachability // and a brand new node has a "true" predicate - hrn0.setAlpha(hrn0.getInherent() ); - hrn0.setPreds(predsTrue); + hrn0.setAlpha( Canonical.changePredsTo( hrn0.getInherent(), predsTrue ) ); + hrn0.setPreds( predsTrue); } @@ -2260,8 +2260,8 @@ public class ReachGraph { private static boolean resolveMethodDebugDOTwriteLabels = true; private static boolean resolveMethodDebugDOTselectTemps = true; private static boolean resolveMethodDebugDOTpruneGarbage = true; - private static boolean resolveMethodDebugDOThideReach = true; - private static boolean resolveMethodDebugDOThideSubsetReach = true; + private static boolean resolveMethodDebugDOThideReach = false; + private static boolean resolveMethodDebugDOThideSubsetReach = false; private static boolean resolveMethodDebugDOThidePreds = false; private static boolean resolveMethodDebugDOThideEdgeTaints = true; @@ -2370,6 +2370,8 @@ public class ReachGraph { continue; } + + // since the node is coming over, find out which reach // states on it should come over, too assert calleeNode2calleeStatesSatisfied.get(hrnCallee) == null; diff --git a/Robust/src/Analysis/Disjoint/ReachSet.java b/Robust/src/Analysis/Disjoint/ReachSet.java index d821e96c..851eeecc 100644 --- a/Robust/src/Analysis/Disjoint/ReachSet.java +++ b/Robust/src/Analysis/Disjoint/ReachSet.java @@ -179,7 +179,8 @@ public class ReachSet extends Canonical { } - public String toStringEscNewline(boolean hideSubsetReachability) { + public String toStringEscNewline(boolean hideSubsetReachability, + boolean hidePreds) { String s = "["; Iterator i = this.iterator(); @@ -192,7 +193,12 @@ public class ReachSet extends Canonical { continue; } - s += state; + // jjenista - Use this version if you REALLY want to + // the see the preds for heap region nodes, edges, + // AND every reach state on all those elements! + //s += state.toString( hidePreds ); + s += state.toString(); + if( i.hasNext() ) { s += "\\n"; } @@ -242,4 +248,14 @@ public class ReachSet extends Canonical { s += "]"; return s; } + + public String toStringPreds() { + String s = "[\n"; + + for( ReachState state: reachStates ) { + s += " "+state.toStringPreds()+"\n"; + } + + return s+"]"; + } } diff --git a/Robust/src/Analysis/Disjoint/ReachState.java b/Robust/src/Analysis/Disjoint/ReachState.java index 1ea87ea7..3a3cdc5c 100644 --- a/Robust/src/Analysis/Disjoint/ReachState.java +++ b/Robust/src/Analysis/Disjoint/ReachState.java @@ -159,4 +159,11 @@ public class ReachState extends Canonical { public String toStringPreds() { return reachTuples+":"+preds; } + + public String toString( boolean hidePreds ) { + if( hidePreds ) { + return toString(); + } + return toStringPreds(); + } } diff --git a/Robust/src/Analysis/Disjoint/RefEdge.java b/Robust/src/Analysis/Disjoint/RefEdge.java index 8c8c6852..9dc4faa6 100644 --- a/Robust/src/Analysis/Disjoint/RefEdge.java +++ b/Robust/src/Analysis/Disjoint/RefEdge.java @@ -266,7 +266,7 @@ public class RefEdge { type.toPrettyString()+"\\n"+ field; if( !hideReach ) { - s += "\\n"+beta.toStringEscNewline(hideSubsetReach); + s += "\\n"+beta.toStringEscNewline(hideSubsetReach, hidePreds); } if( !hidePreds ) { diff --git a/Robust/src/Benchmarks/oooJava/master-makefile b/Robust/src/Benchmarks/oooJava/master-makefile index 6d4be320..014d367c 100644 --- a/Robust/src/Benchmarks/oooJava/master-makefile +++ b/Robust/src/Benchmarks/oooJava/master-makefile @@ -76,13 +76,13 @@ 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 -# -disjoint-debug-callsite RayTracer.trace RayTracer.shade 10000 1 true +DISJOINTDEBUG= -disjoint -disjoint-k 1 -enable-assertions $(DRELEASEMODE) +# -disjoint-debug-snap-method ArrayIndexedGraph.createNode 1 100 true \ +# -disjoint-debug-callsite ArrayIndexedGraph.createNode Barneshut.run 1 100 true # -disjoint-write-dots final \ # -flatirusermethods \ # -disjoint-write-ihms \ # -disjoint-write-initial-contexts \ -# -disjoint-debug-snap-method RayTracer.shade 300 999 true # -disjoint-debug-snap-method String.indexOf 1 1000 true # -disjoint-debug-callsite String.concat2 FileInputStream.readLine 1 1000 true \ # -disjoint-debug-snap-method String.concat2 1 1000 true @@ -132,7 +132,7 @@ $(PROGRAM)p.bin: $(SOURCE_FILES) ../master-makefile $(BUILDSCRIPT) $(BMFLAGS) $(BSFLAGS) $(USECOREPROF) $(USEOOO) $(DISJOINT) -o $(PROGRAM)p -builddir par $(SOURCE_FILES) ooo-debug: $(SOURCE_FILES) ../master-makefile - $(BUILDSCRIPT) $(BMFLAGS) $(BSFLAGS) $(USECOREPROF) $(USEOOO) $(OOODEBUG) $(DISJOINT) -o $(PROGRAM)p -builddir par $(SOURCE_FILES) + $(BUILDSCRIPT) $(BMFLAGS) $(BSFLAGS) $(USECOREPROF) $(USEOOO) $(OOODEBUG) $(DISJOINTDEBUG) -o $(PROGRAM)p -builddir par $(SOURCE_FILES) disjoint-debug: $(SOURCE_FILES) ../master-makefile