public int allocationDepth;
// data structure for public interface
- private Hashtable<Descriptor, HashSet<AllocSite> > mapDescriptorToAllocationSiteSet;
+ private Hashtable<Descriptor, HashSet<AllocSite> > mapDescriptorToAllocSiteSet;
// for public interface methods to warn that they
// unique filenames
protected Hashtable<Descriptor, Integer>
mapDescriptorToNumUpdates;
-
+
+ //map task descriptor to initial task parameter
+ protected Hashtable<Descriptor, ReachGraph>
+ mapDescriptorToReachGraph;
// allocate various structures that are not local
mapDescriptorToPriority =
new Hashtable<Descriptor, Integer>();
+
+ mapDescriptorToAllocSiteSet =
+ new Hashtable<Descriptor, HashSet<AllocSite> >();
+
+ mapDescriptorToReachGraph =
+ new Hashtable<Descriptor, ReachGraph>();
}
if( state.DISJOINTALIASFILE != null ) {
if( state.TASK ) {
// not supporting tasks yet...
+ writeAllAliases("allresult", treport, justtime, state.OWNERSHIPALIASTAB, state.lines);
} else {
/*
writeAllAliasesJava( aliasFile,
ReachGraph rg = analyzeMethod( d );
ReachGraph rgPrev = getPartial( d );
-
+
if( !rg.equals( rgPrev ) ) {
setPartial( d, rg );
// 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
completeGraph.merge( rgRet );
}
-
return completeGraph;
}
new Hashtable<TypeDescriptor, HeapRegionNode>();
Set<String> doneSet = new HashSet<String>();
- 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
// return all allocation sites in the method (there is one allocation
// site per FlatNew node in a method)
private HashSet<AllocSite> getAllocationSiteSet(Descriptor d) {
- if( !mapDescriptorToAllocationSiteSet.containsKey(d) ) {
+ if( !mapDescriptorToAllocSiteSet.containsKey(d) ) {
buildAllocationSiteSet(d);
}
- return mapDescriptorToAllocationSiteSet.get(d);
+ return mapDescriptorToAllocSiteSet.get(d);
}
}
}
- mapDescriptorToAllocationSiteSet.put(d, s);
+ mapDescriptorToAllocSiteSet.put(d, s);
}
private HashSet<AllocSite> getFlaggedAllocationSites(Descriptor dIn) {