From 42a3cabaf86d37d73dc66a187c115d8fe0700f4c Mon Sep 17 00:00:00 2001 From: jjenista Date: Fri, 6 Nov 2009 22:49:40 +0000 Subject: [PATCH] don't keep an analysis graph for every program point unless we're looking for method effects --- .../OwnershipAnalysis/OwnershipAnalysis.java | 35 +++++++++++-------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/Robust/src/Analysis/OwnershipAnalysis/OwnershipAnalysis.java b/Robust/src/Analysis/OwnershipAnalysis/OwnershipAnalysis.java index 3f8d4c51..13d49da9 100644 --- a/Robust/src/Analysis/OwnershipAnalysis/OwnershipAnalysis.java +++ b/Robust/src/Analysis/OwnershipAnalysis/OwnershipAnalysis.java @@ -381,14 +381,14 @@ public class OwnershipAnalysis { // for controlling method effects private boolean methodEffects; - //map each FlatNode to its own internal ownership graph - private MethodEffectsAnalysis meAnalysis; + //map each FlatNode to its own internal ownership graph + private MethodEffectsAnalysis meAnalysis; - //keep internal ownership graph by method context and flat node - private Hashtable> mapMethodContextToFlatNodeOwnershipGraph; + //keep internal ownership graph by method context and flat node + private Hashtable> mapMethodContextToFlatNodeOwnershipGraph; - //map method context to a set of allocation sites of live-in vars - private Hashtable> mapMethodContextToLiveInAllocationSiteSet; + //map method context to a set of allocation sites of live-in vars + private Hashtable> mapMethodContextToLiveInAllocationSiteSet; @@ -505,7 +505,9 @@ public class OwnershipAnalysis { mapHrnIdToAllocationSite = new Hashtable(); - mapMethodContextToFlatNodeOwnershipGraph=new Hashtable>(); + if( methodEffects ) { + mapMethodContextToFlatNodeOwnershipGraph=new Hashtable>(); + } meAnalysis=new MethodEffectsAnalysis(methodEffects); @@ -1102,14 +1104,16 @@ public class OwnershipAnalysis { break; } - - Hashtable table=mapMethodContextToFlatNodeOwnershipGraph.get(mc); - if(table==null){ + + if( methodEffects ) { + Hashtable table=mapMethodContextToFlatNodeOwnershipGraph.get(mc); + if(table==null){ table=new Hashtable(); + } + table.put(fn, og); + mapMethodContextToFlatNodeOwnershipGraph.put(mc, table); } - table.put(fn, og); - mapMethodContextToFlatNodeOwnershipGraph.put(mc, table); - + return og; } @@ -1462,7 +1466,7 @@ public class OwnershipAnalysis { // insert a call to debugSnapshot() somewhere in the analysis // to get successive captures of the analysis state boolean takeDebugSnapshots = false; - String mcDescSymbolDebug = "insertElementAt"; + String mcDescSymbolDebug = "setRoute"; boolean stopAfterCapture = true; // increments every visit to debugSnapshot, don't fiddle with it @@ -1536,7 +1540,8 @@ public class OwnershipAnalysis { } public MethodContext getCalleeMethodContext(MethodContext callerMC, FlatCall fc){ - + assert methodEffects; + Hashtable table=mapMethodContextToFlatNodeOwnershipGraph.get(callerMC); // merge previous ownership graph to calculate corresponding method context -- 2.34.1