check in a debug mode for call site transfer I use a lot, but actually hook it up...
authorjjenista <jjenista>
Mon, 1 Mar 2010 18:48:38 +0000 (18:48 +0000)
committerjjenista <jjenista>
Mon, 1 Mar 2010 18:48:38 +0000 (18:48 +0000)
Robust/src/Analysis/Disjoint/DisjointAnalysis.java
Robust/src/Analysis/Disjoint/ReachGraph.java

index 8ca9128dbd2bef3abd2c2a41fd4d847228854a56..626fb6c1c49a50b83a8eb3fbd4404b95da2f2e07 100644 (file)
@@ -117,6 +117,7 @@ public class DisjointAnalysis {
     mapDescriptorToNumUpdates;
 
 
+
   // allocate various structures that are not local
   // to a single class method--should be done once
   protected void allocateStructures() {    
@@ -529,10 +530,15 @@ public class DisjointAnalysis {
       break;
 
     case FKind.FlatCall: {
+      MethodDescriptor mdCaller = fmContaining.getMethod();
       FlatCall         fc       = (FlatCall) fn;
       MethodDescriptor mdCallee = fc.getMethod();
       FlatMethod       fmCallee = state.getMethodFlat( mdCallee );
 
+      boolean writeDebugDOTs = 
+        mdCaller.getSymbol().equals( state.DISJOINTDEBUGCALLER ) &&
+        mdCallee.getSymbol().equals( state.DISJOINTDEBUGCALLEE );      
+
 
       // calculate the heap this call site can reach--note this is
       // not used for the current call site transform, we are
@@ -553,7 +559,8 @@ public class DisjointAnalysis {
         rg.makeCalleeView( fc, 
                            fmCallee,
                            callerNodesCopiedToCallee,
-                           callerEdgesCopiedToCallee
+                           callerEdgesCopiedToCallee,
+                           writeDebugDOTs
                            );
 
       if( !heapForThisCall_cur.equals( heapForThisCall_old ) ) {        
@@ -609,7 +616,8 @@ public class DisjointAnalysis {
                                     fmPossible, 
                                     rgEffect,
                                     callerNodesCopiedToCallee,
-                                    callerEdgesCopiedToCallee
+                                    callerEdgesCopiedToCallee,
+                                    writeDebugDOTs
                                     );
         }
         
index a03c8d46435bff78998a4fded718bce2e2b0a47e..93fe70443bc2f283d8dc6fa853a7dfb7300e3dd6 100644 (file)
@@ -1133,7 +1133,8 @@ public class ReachGraph {
     makeCalleeView( FlatCall            fc,
                     FlatMethod          fm,
                     Set<HeapRegionNode> callerNodesCopiedToCallee,
-                    Set<RefEdge>        callerEdgesCopiedToCallee
+                    Set<RefEdge>        callerEdgesCopiedToCallee,
+                    boolean             writeDebugDOTs
                     ) {
 
     // the callee view is a new graph: DON'T MODIFY
@@ -1370,16 +1371,12 @@ public class ReachGraph {
     }    
 
 
-    /*
-    try {
-      rg.writeGraph( "calleeview", true, false, false, false, true, true );
-    } catch( IOException e ) {}
-
-
-    if( fc.getMethod().getSymbol().equals( "addSomething" ) ) {
-      System.exit( 0 );
+    if( writeDebugDOTs ) {    
+      try {
+        rg.writeGraph( "calleeview", true, false, false, false, true, true );
+      } catch( IOException e ) {}
     }
-    */
+
 
     return rg;
   }  
@@ -1389,18 +1386,17 @@ public class ReachGraph {
                        FlatMethod          fm,        
                        ReachGraph          rgCallee,
                        Set<HeapRegionNode> callerNodesCopiedToCallee,
-                       Set<RefEdge>        callerEdgesCopiedToCallee
+                       Set<RefEdge>        callerEdgesCopiedToCallee,
+                       boolean             writeDebugDOTs
                        ) {
 
 
-    if( fc.getMethod().getSymbol().equals( "addBar" ) ) {
-
+    if( writeDebugDOTs ) {
       try {
-        writeGraph( "caller", true, false, false, false, true, true, callerNodesCopiedToCallee, callerEdgesCopiedToCallee );
+        this.writeGraph( "caller", true, false, false, false, true, true, 
+                         callerNodesCopiedToCallee, callerEdgesCopiedToCallee );
         rgCallee.writeGraph( "callee", true, false, false, false, true, true );
       } catch( IOException e ) {}
-      
-      //System.exit( 0 );
     }
 
 
@@ -1415,6 +1411,9 @@ public class ReachGraph {
     // 4. Global sweep it.
 
 
+    System.out.println( );
+
+
 
     // 1. mark what callee elements have satisfied predicates
     Set<HeapRegionNode> calleeNodesSatisfied =
@@ -1435,6 +1434,11 @@ public class ReachGraph {
                                               )
           ) {
         calleeNodesSatisfied.add( hrnCallee );
+
+
+        
+
+
       }
 
       Iterator<RefEdge> reItr = hrnCallee.iteratorToReferencees();
@@ -1460,7 +1464,6 @@ public class ReachGraph {
     }
 
 
-    /*
     // 3. callee elements with satisfied preds come in
 
     // 3.a) nodes
@@ -1535,7 +1538,7 @@ public class ReachGraph {
     }
 
     // 3.c) resolve out-of-context -> callee edges
-    */
+
     
 
     // 4.
@@ -1543,13 +1546,12 @@ public class ReachGraph {
     globalSweep();
     */
 
-    if( fc.getMethod().getSymbol().equals( "addBar" ) ) {
-
+    if( writeDebugDOTs ) {
       try {
-        writeGraph( "callerAfter", true, false, false, false, true, true, null, null );
+        writeGraph( "callerAfter", 
+                    true, false, false, false, true, true, 
+                    null, null );
       } catch( IOException e ) {}
-      
-      //System.exit( 0 );
     }
 
   }