Capturing stable state.
[IRC.git] / Robust / src / Analysis / OwnershipAnalysis / AllocationSite.java
index 2b84766e92ace7fd83f70a31744ec2e721863548..9a8ac2e689bf414c283a2a80bc00c719157f0d67 100644 (file)
@@ -4,31 +4,45 @@ import IR.*;
 import IR.Flat.*;
 import java.util.*;
 
+// allocation sites are independent of any particular
+// ownership graph, unlike most of the other elements
+// of the ownership analysis.  An allocation site is
+// simply a collection of heap region identifiers that
+// are associated with a single allocation site in the
+// program under analysis.
+
+// So two different ownership graphs may incorporate
+// nodes that represent the memory from one allocation
+// site.  In this case there are two different sets of
+// HeapRegionNode objects, but they have the same
+// node identifiers, and there is one AllocationSite
+// object associated with the FlatNew node that gives
+// the graphs the identifiers in question.
+
 public class AllocationSite {
-    /*
-    protected int newDepthK;
-    protected Vector<HeapRegionNode> ithOldest;
 
-    public NewCluster( int newDepthK ) {
-       assert newDepthK >= 3;
+    protected int allocationDepth;
+    protected Vector<Integer> ithOldest;
 
-       this.newDepthK = newDepthK;
-       ithOldest = new Vector<HeapRegionNode>( newDepthK );
+    public AllocationSite( int allocationDepth ) {
+       assert allocationDepth >= 3;
+
+       this.allocationDepth = allocationDepth;
+       ithOldest = new Vector<Integer>( allocationDepth );
     }
     
-    public void setIthOldest( int i, HeapRegionNode hrn ) {
-       assert i >= 0;
-       assert i < newDepthK;
-       assert hrn != null;
+    public void setIthOldest( int i, Integer id ) {
+       assert i  >= 0;
+       assert i  <  allocationDepth;
+       assert id != null;
 
-       ithOldest.add( i, hrn );
+       ithOldest.add( i, id );
     }
 
-    public HeapRegionNode getIthOldest( int i ) {
+    public Integer getIthOldest( int i ) {
        assert i >= 0;
-       assert i < newDepthK;
+       assert i <  allocationDepth;
 
        return ithOldest.get( i );
     }
-    */
 }