an interface for supporting decomposition of disjointness parameter results
authorjjenista <jjenista>
Fri, 18 Sep 2009 20:01:25 +0000 (20:01 +0000)
committerjjenista <jjenista>
Fri, 18 Sep 2009 20:01:25 +0000 (20:01 +0000)
Robust/src/Analysis/OwnershipAnalysis/OwnershipAnalysis.java
Robust/src/Analysis/OwnershipAnalysis/ParameterDecomposition.java [new file with mode: 0644]
Robust/src/Makefile

index 97cc05be0d8a5446581c72b8f3bd0dad257fd5d9..1baddb535e165b75587f702f5784ece1538b656a 100644 (file)
@@ -27,6 +27,9 @@ public class OwnershipAnalysis {
     return getAllocationSiteFromFlatNewPRIVATE(fn);
   }
 
+  public AllocationSite getAllocationSiteFromHeapRegionNodeID(Integer id) {
+    return mapHrnIdToAllocationSite.get(id);
+  }
 
   public Set<HeapRegionNode> 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<AllocationSite> possible( TempDescriptor temp,
-                                      FlatNode       ppoint ) {
-    assert temp   != null;
-    assert ppoint != null;
-
-    /*
-    OwnershipGraph og = new OwnershipGraph( allocationDepth, typeUtil );
-
-    assert mapDescriptorToAllMethodContexts.containsKey( d );
-    HashSet<MethodContext> contexts = mapDescriptorToAllMethodContexts.get( d );
-    Iterator<MethodContext> 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<MethodContext, Integer>                  mapMethodContextToNumUpdates;
   private Hashtable<Descriptor,    HashSet<MethodContext> >  mapDescriptorToAllMethodContexts;
   private Hashtable<MethodContext, HashSet<MethodContext> >  mapMethodContextToDependentContexts;
+  private Hashtable<Integer,       AllocationSite>           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<Descriptor, Integer>();
 
+    mapHrnIdToAllocationSite =
+      new Hashtable<Integer, AllocationSite>();
+
 
     if( writeAllDOTs ) {
       mapMethodContextToNumUpdates = new Hashtable<MethodContext, Integer>();
@@ -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 (file)
index 0000000..69900a0
--- /dev/null
@@ -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<Integer> 
+    getHeapRegionNodeIDs( Integer paramIndex ) {
+    return null;
+  }
+
+  public Set<HeapRegionNode> 
+    getHeapRegionNodes( Integer paramIndex ) {
+    return null;
+  }
+
+  public Set<AllocationSite> 
+    getAllocationSites( Integer paramIndex ) {
+    return null;
+  }
+
+  public Set<TypeDescriptor> 
+    getTypeDescriptors( Integer paramIndex ) {
+    return null;
+  }
+
+}
index 4c3eeb0e73e40aed2510b78c70a5655d5406bcd8..35b1bc32d494c3095ba2ad57764b66f2b7f36678 100644 (file)
@@ -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                                               \