1 salcianu 1.1 // ChainedAllocationProperties.java, created Sat Feb  8 16:39:04 2003 by salcianu
 2 salcianu 1.1 // Copyright (C) 2000 Alexandru Salcianu <salcianu@MIT.EDU>
 3 salcianu 1.1 // Licensed under the terms of the GNU GPL; see COPYING for details.
 4 salcianu 1.1 package harpoon.Analysis;
 5 salcianu 1.1 
 6 salcianu 1.1 import harpoon.Analysis.Maps.AllocationInformation.AllocationProperties;
 7 salcianu 1.1 
 8 salcianu 1.1 import harpoon.ClassFile.HClass;
 9 salcianu 1.2 import harpoon.Temp.Label;
10 salcianu 1.1 import harpoon.Temp.Temp;
11 salcianu 1.1 
12 salcianu 1.1 /** <code>ChainedAllocationProperties</code> allows us to change
13 salcianu 1.1     several properties of an already existing
14 salcianu 1.1     <code>AllocationProperties</code>.  By default, it forwards each
15 salcianu 1.1     request to the original <code>AllocationProperties</code> that
16 salcianu 1.1     it's chained with (that object is passed to the
17 salcianu 1.1     <code>ChainedAllocationProperties</code> constructor).  By
18 salcianu 1.1     overriding some of its methods, we can change only several
19 salcianu 1.1     allocation properties attached with a specific allocation site.
20 salcianu 1.1 
21 salcianu 1.1     @author  Alexandru Salcianu <salcianu@MIT.EDU>
22 salcianu 1.2     @version $Id: ChainedAllocationProperties.java,v 1.2 2003/03/03 23:41:27 salcianu Exp $ */
23 salcianu 1.1 public class ChainedAllocationProperties implements AllocationProperties {
24 salcianu 1.1 
25 salcianu 1.1     /** Createsv a new <code>ChainedAllocationProperties</code>
26 salcianu 1.1         object 
27 salcianu 1.1 
28 salcianu 1.1         @param oap original <code>AllocationProperties</code>; the
29 salcianu 1.1         created <code>ChainedAllocationProperties</code> is chained
30 salcianu 1.1         with <code>oap</code>.  By default, all method calls are
31 salcianu 1.1         forwarded toward <code>oap</code>.  */
32 salcianu 1.1     public ChainedAllocationProperties(AllocationProperties oap) {
33 salcianu 1.1         this.oap = oap;
34 salcianu 1.1     }
35 salcianu 1.1     private final AllocationProperties oap;
36 salcianu 1.1     public boolean hasInteriorPointers() {
37 salcianu 1.1         return oap.hasInteriorPointers();
38 salcianu 1.1     }
39 salcianu 1.1     public boolean canBeStackAllocated() {
40 salcianu 1.1         return oap.canBeStackAllocated();
41 salcianu 1.1     }
42 salcianu 1.1     public boolean canBeThreadAllocated() {
43 salcianu 1.1         return oap.canBeThreadAllocated();
44 salcianu 1.1     }
45 salcianu 1.1     public boolean makeHeap() { return oap.makeHeap(); }
46 salcianu 1.1     public Temp allocationHeap() { return oap.allocationHeap(); }
47 salcianu 1.1     public HClass actualClass() {return oap.actualClass(); }
48 salcianu 1.1     public boolean noSync() { return oap.noSync(); }
49 salcianu 1.1     public boolean setDynamicWBFlag() { return oap.setDynamicWBFlag(); }
50 salcianu 1.2     public Label getLabelOfPtrToMemoryChunk() {
51 salcianu 1.2         return oap.getLabelOfPtrToMemoryChunk();
52 salcianu 1.1     }
53 salcianu 1.1     public int getUniqueID() { return oap.getUniqueID(); }
54 salcianu 1.1 }