From e06f07e20fd64e6bc39178e126e439f3cb3be88e Mon Sep 17 00:00:00 2001 From: yeom Date: Fri, 19 Mar 2010 18:50:45 +0000 Subject: [PATCH] changes. --- .../Analysis/Disjoint/DisjointAnalysis.java | 42 ++++++++++++------- 1 file changed, 28 insertions(+), 14 deletions(-) diff --git a/Robust/src/Analysis/Disjoint/DisjointAnalysis.java b/Robust/src/Analysis/Disjoint/DisjointAnalysis.java index 028860dc..7b4c394a 100644 --- a/Robust/src/Analysis/Disjoint/DisjointAnalysis.java +++ b/Robust/src/Analysis/Disjoint/DisjointAnalysis.java @@ -306,7 +306,7 @@ public class DisjointAnalysis { public int allocationDepth; // data structure for public interface - private Hashtable > mapDescriptorToAllocationSiteSet; + private Hashtable > mapDescriptorToAllocSiteSet; // for public interface methods to warn that they @@ -407,7 +407,10 @@ public class DisjointAnalysis { // unique filenames protected Hashtable mapDescriptorToNumUpdates; - + + //map task descriptor to initial task parameter + protected Hashtable + mapDescriptorToReachGraph; // allocate various structures that are not local @@ -444,6 +447,12 @@ public class DisjointAnalysis { mapDescriptorToPriority = new Hashtable(); + + mapDescriptorToAllocSiteSet = + new Hashtable >(); + + mapDescriptorToReachGraph = + new Hashtable(); } @@ -506,6 +515,7 @@ public class DisjointAnalysis { if( state.DISJOINTALIASFILE != null ) { if( state.TASK ) { // not supporting tasks yet... + writeAllAliases("allresult", treport, justtime, state.OWNERSHIPALIASTAB, state.lines); } else { /* writeAllAliasesJava( aliasFile, @@ -592,7 +602,7 @@ public class DisjointAnalysis { ReachGraph rg = analyzeMethod( d ); ReachGraph rgPrev = getPartial( d ); - + if( !rg.equals( rgPrev ) ) { setPartial( d, rg ); @@ -641,10 +651,17 @@ public class DisjointAnalysis { // to see if anything was updated. ReachGraph rg = new ReachGraph(); - - if(fn instanceof FlatMethod && ((FlatMethod)fn).getTask()!=null){ - // create initial reach graph for a task - rg=createInitialTaskReachGraph((FlatMethod)fn); + TaskDescriptor taskDesc; + if(fn instanceof FlatMethod && (taskDesc=((FlatMethod)fn).getTask())!=null){ + if(mapDescriptorToReachGraph.containsKey(taskDesc)){ + // retrieve existing reach graph if it is not first time + rg=mapDescriptorToReachGraph.get(taskDesc); + }else{ + // create initial reach graph for a task + rg=createInitialTaskReachGraph((FlatMethod)fn); + rg.globalSweep(); + mapDescriptorToReachGraph.put(taskDesc, rg); + } } // start by merging all node's parents' graphs @@ -701,7 +718,6 @@ public class DisjointAnalysis { completeGraph.merge( rgRet ); } - return completeGraph; } @@ -1521,12 +1537,10 @@ private ReachGraph createInitialTaskReachGraph(FlatMethod fm) { new Hashtable(); Set doneSet = new HashSet(); - TempDescriptor tempDesc = new TempDescriptor(paramDesc.getSymbol(), - paramTypeDesc); + TempDescriptor tempDesc = fm.getParameter(idx); AllocSite as = createParameterAllocSite(rg, tempDesc); VariableNode lnX = rg.getVariableNodeFromTemp(tempDesc); - Integer idNewest = as.getIthOldest(0); HeapRegionNode hrnNewest = rg.id2hrn.get(idNewest); // make a new reference to allocated node @@ -1651,11 +1665,11 @@ private ReachGraph createInitialTaskReachGraph(FlatMethod fm) { // return all allocation sites in the method (there is one allocation // site per FlatNew node in a method) private HashSet getAllocationSiteSet(Descriptor d) { - if( !mapDescriptorToAllocationSiteSet.containsKey(d) ) { + if( !mapDescriptorToAllocSiteSet.containsKey(d) ) { buildAllocationSiteSet(d); } - return mapDescriptorToAllocationSiteSet.get(d); + return mapDescriptorToAllocSiteSet.get(d); } @@ -1695,7 +1709,7 @@ private void buildAllocationSiteSet(Descriptor d) { } } - mapDescriptorToAllocationSiteSet.put(d, s); + mapDescriptorToAllocSiteSet.put(d, s); } private HashSet getFlaggedAllocationSites(Descriptor dIn) { -- 2.34.1