From 5e6c0cbf823e303b951bb680061ac8307fbcaaec Mon Sep 17 00:00:00 2001 From: jjenista Date: Fri, 18 Sep 2009 20:01:25 +0000 Subject: [PATCH] an interface for supporting decomposition of disjointness parameter results --- .../OwnershipAnalysis/OwnershipAnalysis.java | 49 +++-------------- .../ParameterDecomposition.java | 55 +++++++++++++++++++ Robust/src/Makefile | 1 + 3 files changed, 64 insertions(+), 41 deletions(-) create mode 100644 Robust/src/Analysis/OwnershipAnalysis/ParameterDecomposition.java diff --git a/Robust/src/Analysis/OwnershipAnalysis/OwnershipAnalysis.java b/Robust/src/Analysis/OwnershipAnalysis/OwnershipAnalysis.java index 97cc05be..1baddb53 100644 --- a/Robust/src/Analysis/OwnershipAnalysis/OwnershipAnalysis.java +++ b/Robust/src/Analysis/OwnershipAnalysis/OwnershipAnalysis.java @@ -27,6 +27,9 @@ public class OwnershipAnalysis { return getAllocationSiteFromFlatNewPRIVATE(fn); } + public AllocationSite getAllocationSiteFromHeapRegionNodeID(Integer id) { + return mapHrnIdToAllocationSite.get(id); + } public Set createsPotentialAliases(Descriptor taskOrMethod, int paramIndex1, @@ -244,47 +247,6 @@ public class OwnershipAnalysis { bw.write( "\n"+computeAliasContextHistogram() ); bw.close(); } - - - - - /* - getFlaggedAllocationSitesReachableFromTask(TaskDescriptor td) { - return getFlaggedAllocationSitesReachableFromTaskPRIVATE(td); - } - - public AllocationSite getAllocationSiteFromFlatNew(FlatNew fn) { - return getAllocationSiteFromFlatNewPRIVATE(fn); - } - */ - - // return the set of allocation sites for the object that the - // given variable may reference at the given program point - public Set possible( TempDescriptor temp, - FlatNode ppoint ) { - assert temp != null; - assert ppoint != null; - - /* - OwnershipGraph og = new OwnershipGraph( allocationDepth, typeUtil ); - - assert mapDescriptorToAllMethodContexts.containsKey( d ); - HashSet contexts = mapDescriptorToAllMethodContexts.get( d ); - Iterator mcItr = contexts.iterator(); - while( mcItr.hasNext() ) { - MethodContext mc = mcItr.next(); - - OwnershipGraph ogContext = mapMethodContextToCompleteOwnershipGraph.get(mc); - assert ogContext != null; - - og.merge( ogContext ); - } - - return og; - */ - - return null; - } /////////////////////////////////////////// // // end public interface @@ -324,6 +286,7 @@ public class OwnershipAnalysis { private Hashtable mapMethodContextToNumUpdates; private Hashtable > mapDescriptorToAllMethodContexts; private Hashtable > mapMethodContextToDependentContexts; + private Hashtable mapHrnIdToAllocationSite; // Use these data structures to track progress of one pass of // processing the FlatNodes of a particular method @@ -399,6 +362,9 @@ public class OwnershipAnalysis { mapDescriptorToPriority = new Hashtable(); + mapHrnIdToAllocationSite = + new Hashtable(); + if( writeAllDOTs ) { mapMethodContextToNumUpdates = new Hashtable(); @@ -1026,6 +992,7 @@ public class OwnershipAnalysis { for( int i = 0; i < allocationDepth; ++i ) { Integer id = generateUniqueHeapRegionNodeID(); as.setIthOldest(i, id); + mapHrnIdToAllocationSite.put( id, as ); } // the oldest node is a summary node diff --git a/Robust/src/Analysis/OwnershipAnalysis/ParameterDecomposition.java b/Robust/src/Analysis/OwnershipAnalysis/ParameterDecomposition.java new file mode 100644 index 00000000..69900a05 --- /dev/null +++ b/Robust/src/Analysis/OwnershipAnalysis/ParameterDecomposition.java @@ -0,0 +1,55 @@ +package Analysis.OwnershipAnalysis; + +import IR.*; +import IR.Flat.*; +import java.util.*; + +// This class is useful to instantiate from objects out +// of a completed analysis. Given a method's reachability +// graph and a call site, what heap regions might the +// parameter regions be decomposed into? +// +// Also you can build a call chain by constructing +// a new decomposition from another decomp and a +// flat call one step back in the chain. +public class ParameterDecomposition { + + // used to help user realize when they are + // asking for results of an invalid call chain + MethodDescriptor mdCallee; + MethodDescriptor mdCaller; + + public ParameterDecomposition( MethodDescriptor md, + FlatCall fc ) { + + } + + public ParameterDecomposition( ParameterDecomposition pd, + FlatCall fc ) { + + } + + // this family of "gets" returns, for some + // parameter index, all of the associated data + // that parameter might decompose into + public Set + getHeapRegionNodeIDs( Integer paramIndex ) { + return null; + } + + public Set + getHeapRegionNodes( Integer paramIndex ) { + return null; + } + + public Set + getAllocationSites( Integer paramIndex ) { + return null; + } + + public Set + getTypeDescriptors( Integer paramIndex ) { + return null; + } + +} diff --git a/Robust/src/Makefile b/Robust/src/Makefile index 4c3eeb0e..35b1bc32 100644 --- a/Robust/src/Makefile +++ b/Robust/src/Makefile @@ -87,6 +87,7 @@ Analysis/OwnershipAnalysis/ChangeTuple.class \ Analysis/OwnershipAnalysis/ChangeTupleSet.class \ Analysis/OwnershipAnalysis/Canonical.class \ Analysis/OwnershipAnalysis/MethodContext.class \ +Analysis/OwnershipAnalysis/ParameterDecomposition.class \ Analysis/MLP/MLPAnalysis.class \ Analysis/MLP/VariableSourceToken.class \ Analysis/MLP/SVKey.class \ -- 2.34.1