working on reach prop, pred bugs, basic tests still do not work, gotta squash more...
authorjjenista <jjenista>
Wed, 17 Mar 2010 15:01:14 +0000 (15:01 +0000)
committerjjenista <jjenista>
Wed, 17 Mar 2010 15:01:14 +0000 (15:01 +0000)
Robust/src/Analysis/Disjoint/ReachGraph.java
Robust/src/Tests/disjoint/predicateTest3/makefile

index e5415018eabf52e37dc5262e12a1773631aab6b1..f2dcff2a7e283d52c0e753ef1092baf5b0ff392c 100644 (file)
@@ -2281,7 +2281,6 @@ public class ReachGraph {
       while( rsnItr.hasNext() ) {
         RefSrcNode rsnCaller = rsnItr.next();
         
-        // TODO: beta rewrites
         RefEdge reCaller = new RefEdge( rsnCaller,
                                         hrnDstCaller,
                                         reCallee.getType(),
@@ -2298,8 +2297,17 @@ public class ReachGraph {
           ExistPredSet preds2 = state.getPreds();
           assert preds2.preds.size() == 1;
 
+          if( state.isEmpty() ) {
+            continue;
+          }
+
           ExistPred pred = preds2.preds.iterator().next();
           ReachState old = pred.ne_state;
+
+          if( old == null ) {
+            old = rstateEmpty;
+          }
+
           assert old != null;
 
           cs = Canonical.union( cs,
@@ -2328,20 +2336,24 @@ public class ReachGraph {
                                 );
 
           // for reach propagation
-          edgePlannedChanges.put( 
-                                 edgeExisting, 
-                                 Canonical.union( edgePlannedChanges.get( edgeExisting ),
-                                                  cs
-                                                  ) 
-                                  );
+          if( !cs.isEmpty() ) {
+            edgePlannedChanges.put( 
+                                   edgeExisting, 
+                                   Canonical.union( edgePlannedChanges.get( edgeExisting ),
+                                                    cs
+                                                    ) 
+                                    );
+          }
           
         } else {                         
           addRefEdge( rsnCaller, hrnDstCaller, reCaller );     
 
           // for reach propagation
-          edgesForPropagation.add( reCaller );
-          assert !edgePlannedChanges.containsKey( reCaller );
-          edgePlannedChanges.put( reCaller, cs );
+          if( !cs.isEmpty() ) {
+            edgesForPropagation.add( reCaller );
+            assert !edgePlannedChanges.containsKey( reCaller );
+            edgePlannedChanges.put( reCaller, cs );
+          }
         }
       }
     }
@@ -3195,13 +3207,10 @@ public class ReachGraph {
                                         )
                        );
 
-        // if hrnB is already dirty or hrnA is dirty,
-        // the hrnB should end up dirty: TODO
-        /*
-        if( !hrnA.isClean() ) {
-          hrnB.setIsClean( false );
-        }
-        */
+        hrnB.setPreds( Canonical.join( hrnB.getPreds(),
+                                       hrnA.getPreds()
+                                       )
+                       );
       }
     }
 
@@ -3279,12 +3288,11 @@ public class ReachGraph {
                                                edgeA.getBeta() 
                                                )
                               );
-          // TODO: what?
-          /*
-         if( !edgeA.isClean() ) {
-           edgeToMerge.setIsClean( false );
-         }
-          */
+          edgeToMerge.setPreds(
+                               Canonical.join( edgeToMerge.getPreds(),
+                                               edgeA.getPreds()
+                                               )
+                               );
        }
       }
     }
@@ -3344,12 +3352,10 @@ public class ReachGraph {
                                                 edgeA.getBeta()
                                                 )
                                );
-          // TODO: what?
-          /*
-         if( !edgeA.isClean() ) {
-           edgeToMerge.setIsClean( false );
-         }
-          */
+          edgeToMerge.setPreds( Canonical.join( edgeToMerge.getPreds(),
+                                                edgeA.getPreds()
+                                                )
+                                );
        }
       }
     }
index 7a4c6b095ab13f9f39cd41e26f37cea1a7b7d033..b4cecea7779e5b4026ba39f93ea94b9bb5046dd6 100644 (file)
@@ -5,13 +5,13 @@ SOURCE_FILES=$(PROGRAM).java
 BUILDSCRIPT=~/research/Robust/src/buildscript
 
 #DEBUGFLAGS= -disjoint-debug-callsite Bar addSomething 1
-DEBUGFLAGS= -disjoint-debug-callsite Foo main 1
+#DEBUGFLAGS= -disjoint-debug-callsite Foo main 1
 
 #DEBUGFLAGS= -disjoint-debug-callsite main analysisEntryMethod 1
 #DEBUGFLAGS= -disjoint-debug-callsite addSomething main 1
 #DEBUGFLAGS= -disjoint-debug-callsite addBar addSomething 1
 #DEBUGFLAGS= -disjoint-debug-callsite Bar addBar 1
-#DEBUGFLAGS=
+DEBUGFLAGS=
 
 BSFLAGS= -mainclass Test -justanalyze -disjoint -disjoint-k 2 -disjoint-write-dots final -disjoint-write-ihms -disjoint-alias-file aliases.txt normal -enable-assertions