From 8e75aab57853a9e1e2bbf6f3fd5a666a440f5840 Mon Sep 17 00:00:00 2001 From: jjenista Date: Mon, 1 Mar 2010 18:48:38 +0000 Subject: [PATCH] check in a debug mode for call site transfer I use a lot, but actually hook it up to the build options, whoops --- .../Analysis/Disjoint/DisjointAnalysis.java | 12 ++++- Robust/src/Analysis/Disjoint/ReachGraph.java | 48 ++++++++++--------- 2 files changed, 35 insertions(+), 25 deletions(-) diff --git a/Robust/src/Analysis/Disjoint/DisjointAnalysis.java b/Robust/src/Analysis/Disjoint/DisjointAnalysis.java index 8ca9128d..626fb6c1 100644 --- a/Robust/src/Analysis/Disjoint/DisjointAnalysis.java +++ b/Robust/src/Analysis/Disjoint/DisjointAnalysis.java @@ -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 ); } diff --git a/Robust/src/Analysis/Disjoint/ReachGraph.java b/Robust/src/Analysis/Disjoint/ReachGraph.java index a03c8d46..93fe7044 100644 --- a/Robust/src/Analysis/Disjoint/ReachGraph.java +++ b/Robust/src/Analysis/Disjoint/ReachGraph.java @@ -1133,7 +1133,8 @@ public class ReachGraph { makeCalleeView( FlatCall fc, FlatMethod fm, Set callerNodesCopiedToCallee, - Set callerEdgesCopiedToCallee + Set 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 callerNodesCopiedToCallee, - Set callerEdgesCopiedToCallee + Set 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 calleeNodesSatisfied = @@ -1435,6 +1434,11 @@ public class ReachGraph { ) ) { calleeNodesSatisfied.add( hrnCallee ); + + + + + } Iterator 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 ); } } -- 2.34.1