harpoon.Analysis
Class AllocationInformationMap.AllocationPropertiesImpl

java.lang.Object
  extended by harpoon.Analysis.AllocationInformationMap.AllocationPropertiesImpl
All Implemented Interfaces:
AllocationInformation.AllocationProperties, Serializable
Enclosing class:
AllocationInformationMap<HCE extends HCodeElement>

public static final class AllocationInformationMap.AllocationPropertiesImpl
extends Object
implements AllocationInformation.AllocationProperties, Serializable

A simple implementation of AllocationProperties.

See Also:
Serialized Form

Constructor Summary
AllocationInformationMap.AllocationPropertiesImpl(AllocationInformation.AllocationProperties ap, TempMap tm)
           
AllocationInformationMap.AllocationPropertiesImpl(boolean hasInteriorPointers, boolean canBeStackAllocated, boolean canBeThreadAllocated, boolean makeHeap, boolean noSynchronization, Temp allocationHeap, HClass actualClass, boolean setDynamicWBFlag)
           
AllocationInformationMap.AllocationPropertiesImpl(boolean hasInteriorPointers, boolean canBeStackAllocated, boolean canBeThreadAllocated, boolean makeHeap, boolean noSynchronization, Temp allocationHeap, HClass actualClass, boolean setDynamicWBFlag, Label labelOfPtrToMemoryChunk, int uniqueID)
           
 
Method Summary
 HClass actualClass()
           
 Temp allocationHeap()
           
 boolean canBeStackAllocated()
           
 boolean canBeThreadAllocated()
           
 Label getLabelOfPtrToMemoryChunk()
           
 int getUniqueID()
           
 boolean hasInteriorPointers()
           
 boolean makeHeap()
           
 boolean noSync()
           
 boolean setDynamicWBFlag()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AllocationInformationMap.AllocationPropertiesImpl

public AllocationInformationMap.AllocationPropertiesImpl(boolean hasInteriorPointers,
                                                         boolean canBeStackAllocated,
                                                         boolean canBeThreadAllocated,
                                                         boolean makeHeap,
                                                         boolean noSynchronization,
                                                         Temp allocationHeap,
                                                         HClass actualClass,
                                                         boolean setDynamicWBFlag)

AllocationInformationMap.AllocationPropertiesImpl

public AllocationInformationMap.AllocationPropertiesImpl(boolean hasInteriorPointers,
                                                         boolean canBeStackAllocated,
                                                         boolean canBeThreadAllocated,
                                                         boolean makeHeap,
                                                         boolean noSynchronization,
                                                         Temp allocationHeap,
                                                         HClass actualClass,
                                                         boolean setDynamicWBFlag,
                                                         Label labelOfPtrToMemoryChunk,
                                                         int uniqueID)

AllocationInformationMap.AllocationPropertiesImpl

public AllocationInformationMap.AllocationPropertiesImpl(AllocationInformation.AllocationProperties ap,
                                                         TempMap tm)
Method Detail

hasInteriorPointers

public boolean hasInteriorPointers()
Specified by:
hasInteriorPointers in interface AllocationInformation.AllocationProperties
Returns:
true if the object allocated at this site has interior pointers; that is, it is not a primitive array, and some field in the allocated object is not primitive.

canBeStackAllocated

public boolean canBeStackAllocated()
Specified by:
canBeStackAllocated in interface AllocationInformation.AllocationProperties
Returns:
true if the object can be allocated on the stack; that is, the lifetime of the object does not exceed the execution of the method containing the allocation.

canBeThreadAllocated

public boolean canBeThreadAllocated()
Specified by:
canBeThreadAllocated in interface AllocationInformation.AllocationProperties
Returns:
true if the object can be allocated on a thread-local heap; that is, the lifetime of the object does not exceed the lifetime of the thread object specified by the allocationHeap method.

makeHeap

public boolean makeHeap()
Specified by:
makeHeap in interface AllocationInformation.AllocationProperties
Returns:
true if a thread-local heap should be associated with this object --- typically this means that the allocation site is a thread creation. If this is true and canBeThreadAllocated() is also true, then the new object will be itself allocated on the created heap; otherwise the new object will be globally allocated.

noSync

public boolean noSync()
Specified by:
noSync in interface AllocationInformation.AllocationProperties

allocationHeap

public Temp allocationHeap()
Specified by:
allocationHeap in interface AllocationInformation.AllocationProperties
Returns:
a Temp which at the allocation site contains a reference to either the thread object of a thread-local allocation, or to another object whose lifetime is correlated with that of the (not-yet-created) thread object. Returns null if the allocation should use the heap associated with the "current" thread. If this returns non-null, then makeHeap() should return false and canBeThreadAllocated() should return true.

actualClass

public HClass actualClass()
Specified by:
actualClass in interface AllocationInformation.AllocationProperties
Returns:
the HClass representing the "actual" or instantiated class of the object for which memory is being allocated (as opposed to the declared class).

setDynamicWBFlag

public boolean setDynamicWBFlag()
Specified by:
setDynamicWBFlag in interface AllocationInformation.AllocationProperties
Returns:
true if the dynamic write barrier flag needs to be set when the object is allocated--this typically means that one or more write barriers associated with stores into the object created at this allocation site have been optimistically removed.

getLabelOfPtrToMemoryChunk

public Label getLabelOfPtrToMemoryChunk()
Specified by:
getLabelOfPtrToMemoryChunk in interface AllocationInformation.AllocationProperties
Returns:
a Label for a pointer that points (at runtime) to a preallocated memory chunk to be used for this allocation site. Returns null if we cannot preallocate this allocation site.

getUniqueID

public int getUniqueID()
Specified by:
getUniqueID in interface AllocationInformation.AllocationProperties
Returns:
an unique integer ID for the allocation site. Useful for instrumentation purposes.