bug fix - during call site transfer func we temporarily double nodes per allocation...
authorjjenista <jjenista>
Mon, 18 Apr 2011 20:43:56 +0000 (20:43 +0000)
committerjjenista <jjenista>
Mon, 18 Apr 2011 20:43:56 +0000 (20:43 +0000)
Robust/src/Analysis/Disjoint/DisjointAnalysis.java
Robust/src/Analysis/Disjoint/ReachGraph.java
Robust/src/Tests/disjoint/cc-paper-example/makefile
Robust/src/Tests/disjoint/cc-paper-example/test.java

index 34d41521a396755bda72bea661ed1fac7b5c0200..69abe98b43ec2cef92f04592968a206a32137f58 100644 (file)
@@ -1166,7 +1166,7 @@ public class DisjointAnalysis implements HeapAnalysis {
                      true,   // selectively hide intermediate temp vars 
                      true,    // prune unreachable heap regions          
                      false,   // hide reachability altogether
-                     false,   // hide subset reachability states         
+                     true,   // hide subset reachability states         
                      true,    // hide predicates
                      true );  // hide edge taints      
     } break;
index b17b3f01702f869c729e9d0bfb411cf5687de56e..8dea121d66923ee13067eb0780c8958c979f1c72 100644 (file)
@@ -791,7 +791,7 @@ public class ReachGraph {
 
       // retrieve the summary node, or make it
       // from scratch
-      HeapRegionNode hrnSummary = getSummaryNode( as, false );      
+      HeapRegionNode hrnSummary = getSummaryNode( as, false );
       
       mergeIntoSummary( hrnK, hrnSummary );
     }
@@ -825,25 +825,14 @@ public class ReachGraph {
     wipeOut( hrn0, true );
 
     // now tokens in reachability sets need to "age" also
-    Iterator itrAllVariableNodes = td2vn.entrySet().iterator();
-    while( itrAllVariableNodes.hasNext() ) {
-      Map.Entry    me = (Map.Entry)    itrAllVariableNodes.next();
-      VariableNode ln = (VariableNode) me.getValue();
-
-      Iterator<RefEdge> itrEdges = ln.iteratorToReferencees();
-      while( itrEdges.hasNext() ) {
-       ageTuplesFrom( as, itrEdges.next() );
-      }
-    }
-
     Iterator itrAllHRNodes = id2hrn.entrySet().iterator();
     while( itrAllHRNodes.hasNext() ) {
       Map.Entry      me       = (Map.Entry)      itrAllHRNodes.next();
       HeapRegionNode hrnToAge = (HeapRegionNode) me.getValue();
-
+      
       ageTuplesFrom( as, hrnToAge );
 
-      Iterator<RefEdge> itrEdges = hrnToAge.iteratorToReferencees();
+      Iterator<RefEdge> itrEdges = hrnToAge.iteratorToReferencers();
       while( itrEdges.hasNext() ) {
        ageTuplesFrom( as, itrEdges.next() );
       }
@@ -1007,10 +996,10 @@ public class ReachGraph {
     // then merge hrn reachability into hrnSummary
     hrnSummary.setAlpha( 
                         Canonical.unionORpreds( hrnSummary.getAlpha(),
-                                         hrn.getAlpha() 
-                                         )
+                                                hrn.getAlpha() 
+                                                )
                          );
-
+    
     hrnSummary.setPreds(
                         Canonical.join( hrnSummary.getPreds(),
                                         hrn.getPreds()
@@ -2908,6 +2897,7 @@ public class ReachGraph {
       AllocSite as = asItr.next();
       int ageNorm = 0;
       int ageShad = 0;
+
       while( ageNorm < allocationDepth &&
              ageShad < allocationDepth ) {
 
@@ -2951,6 +2941,21 @@ public class ReachGraph {
         // yes, a normal node exists, so get the shadow summary
         HeapRegionNode summShad = getSummaryNode( as, true );
         mergeIntoSummary( hrnNorm, summShad );
+
+        // now tokens in reachability sets need to age also
+        Iterator itrAllHRNodes = id2hrn.entrySet().iterator();
+        while( itrAllHRNodes.hasNext() ) {
+          Map.Entry      me       = (Map.Entry)      itrAllHRNodes.next();
+          HeapRegionNode hrnToAge = (HeapRegionNode) me.getValue();
+          
+          ageTuplesFrom( as, hrnToAge );
+          
+          Iterator<RefEdge> itrEdges = hrnToAge.iteratorToReferencers();
+          while( itrEdges.hasNext() ) {
+            ageTuplesFrom( as, itrEdges.next() );
+          }
+        }
+
         ageNorm++;
       }
 
index b36b083bb5292593faaef1127c392dc28854803f..041896dcbeb52f56276631536a9564006fa4f650 100644 (file)
@@ -3,7 +3,17 @@ PROGRAM=test
 SOURCE_FILES=$(PROGRAM).java
 
 BUILDSCRIPT=~/research/Robust/src/buildscript
-BSFLAGS= -joptimize -flatirusermethods -mainclass Test -justanalyze -disjoint -disjoint-k 1 -disjoint-write-dots final -disjoint-alias-file aliases.txt normal -enable-assertions
+BSFLAGS= -joptimize -mainclass Test -justanalyze -disjoint -disjoint-k 1 -disjoint-write-dots final -disjoint-alias-file aliases.txt normal -enable-assertions #-flatirusermethods
+
+
+#DEBUGFLAGS= -disjoint-debug-callsite nodeFactory main 0 100 true
+
+#SNAPFLAGS= -disjoint-debug-snap-method calcGoodFeatureTask 5 10 true
+#SNAPFLAGS= -disjoint-debug-snap-method calcGoodFeature 5 1 true
+
+#SNAPFLAGS= -disjoint-debug-snap-method t3 5 20 true
+
+
 
 all: $(PROGRAM).bin
 
@@ -16,7 +26,7 @@ PNGs: DOTs
 DOTs: $(PROGRAM).bin
 
 $(PROGRAM).bin: $(SOURCE_FILES)
-       $(BUILDSCRIPT) $(BSFLAGS) -o $(PROGRAM) $(SOURCE_FILES)
+       $(BUILDSCRIPT) $(BSFLAGS) $(DEBUGFLAGS) -o $(PROGRAM) $(SOURCE_FILES)
 
 clean:
        rm -f  $(PROGRAM).bin
index f81af20ef7461edaf408b681a99ce94b68ff5db2..976af63f0ce5786bee55f514a6280971dee89dad 100644 (file)
@@ -19,13 +19,17 @@ public class Test {
   }
 
   static public void main( String[] args ) {
-    //Graph[] a = new Graph[3];
+    Graph[] a = new Graph[3];
 
     for( int i = 0; i < 3; ++i ) {
+
       Graph g  = disjoint G new Graph();
 
+      genreach p0BeforeUVgen;
       Node  u  = nodeFactory();
+      genreach p1afterUgen;
       Node  v  = nodeFactory();
+      genreach p2afterVgen;
 
       //Node u = disjoint U new Node();
       //Node v = disjoint V new Node();
@@ -37,17 +41,29 @@ public class Test {
       //        v = disjoint N new Node();
       //      } while(false);
 
-      genreach p0;
-
       Config c = disjoint C new Config();
 
       g.n = u;
-      u.n = v; u.c = c;
-      v.n = u; v.c = c;
+      genreach p3AfterConnectG2U;
+
+      u.n = v; 
+      genreach p4AfterConnectU2V;
+
+      v.n = u; 
+      genreach p5AfterConnectV2U;
+
+      u.c = c;
+      v.c = c;
+      genreach p6AfterConfig;
+
+      
+
+      a[i] = g;
 
-      //a[i] = g;
     }
     
-    //System.out.println( a );
+    genreach p7Last;
+
+    System.out.println( a );
   }
 }