1 package Analysis.OwnershipAnalysis;
7 // allocation sites are independent of any particular
8 // ownership graph, unlike most of the other elements
9 // of the ownership analysis. An allocation site is
10 // simply a collection of heap region identifiers that
11 // are associated with a single allocation site in the
12 // program under analysis.
14 // So two different ownership graphs may incorporate
15 // nodes that represent the memory from one allocation
16 // site. In this case there are two different sets of
17 // HeapRegionNode objects, but they have the same
18 // node identifiers, and there is one AllocationSite
19 // object associated with the FlatNew node that gives
20 // the graphs the identifiers in question.
22 public class AllocationSite {
24 protected int allocationDepth;
25 protected Vector<Integer> ithOldest;
26 protected Integer summary;
28 public AllocationSite( int allocationDepth ) {
29 assert allocationDepth >= 3;
31 this.allocationDepth = allocationDepth;
32 ithOldest = new Vector<Integer>( allocationDepth );
35 public void setIthOldest( int i, Integer id ) {
37 assert i < allocationDepth;
40 ithOldest.add( i, id );
43 public Integer getIthOldest( int i ) {
45 assert i < allocationDepth;
47 return ithOldest.get( i );
50 public Integer getOldest() {
51 return ithOldest.get( allocationDepth - 1 );
54 public void setSummary( Integer id ) {
59 public Integer getSummary() {