|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mmtk.vm.ObjectModel
org.jikesrvm.mm.mmtk.ObjectModel
public final class ObjectModel
| Field Summary |
|---|
| Fields inherited from interface org.jikesrvm.Constants |
|---|
NOT_REACHED, REFLECTION_FPRS_BITS, REFLECTION_FPRS_MASK, REFLECTION_GPRS_BITS, REFLECTION_GPRS_MASK |
| Fields inherited from interface org.jikesrvm.objectmodel.ThinLockConstants |
|---|
NUM_BITS_RC, NUM_BITS_TID, TL_FAT_LOCK_MASK, TL_LOCK_COUNT_MASK, TL_LOCK_COUNT_SHIFT, TL_LOCK_COUNT_UNIT, TL_LOCK_ID_MASK, TL_LOCK_ID_SHIFT, TL_THREAD_ID_MASK, TL_THREAD_ID_SHIFT, TL_UNLOCK_MASK |
| Fields inherited from interface org.jikesrvm.SizeConstants |
|---|
BITS_IN_BOOLEAN, BITS_IN_CHAR, BITS_IN_DOUBLE, BITS_IN_FLOAT, BITS_IN_LONG, BYTES_IN_BOOLEAN, BYTES_IN_CHAR, BYTES_IN_DOUBLE, BYTES_IN_FLOAT, BYTES_IN_LONG, LOG_BITS_IN_BOOLEAN, LOG_BITS_IN_CHAR, LOG_BITS_IN_DOUBLE, LOG_BITS_IN_FLOAT, LOG_BITS_IN_LONG, LOG_BYTES_IN_BOOLEAN, LOG_BYTES_IN_CHAR, LOG_BYTES_IN_DOUBLE, LOG_BYTES_IN_FLOAT, LOG_BYTES_IN_LONG |
| Fields inherited from interface org.jikesrvm.objectmodel.TIBLayoutConstants |
|---|
IMT_METHOD_SLOTS, NEEDS_DYNAMIC_LINK, TIB_ARRAY_ELEMENT_TIB_INDEX, TIB_DOES_IMPLEMENT_INDEX, TIB_FIRST_SPECIALIZED_METHOD_INDEX, TIB_FIRST_VIRTUAL_METHOD_INDEX, TIB_INTERFACE_DISPATCH_TABLE_INDEX, TIB_SUPERCLASS_IDS_INDEX, TIB_TYPE_INDEX |
| Fields inherited from interface org.jikesrvm.HeapLayoutConstants |
|---|
BAD_MAP_COMPRESSION, BOOT_IMAGE_CODE_END, BOOT_IMAGE_CODE_SIZE, BOOT_IMAGE_CODE_START, BOOT_IMAGE_DATA_END, BOOT_IMAGE_DATA_SIZE, BOOT_IMAGE_DATA_START, BOOT_IMAGE_END, BOOT_IMAGE_RMAP_END, BOOT_IMAGE_RMAP_START, MAX_BOOT_IMAGE_RMAP_SIZE, MAXIMUM_MAPPABLE |
| Constructor Summary | |
|---|---|
ObjectModel()
|
|
| Method Summary | |
|---|---|
boolean |
attemptAvailableBits(ObjectReference object,
Word oldVal,
Word newVal)
Attempts to set the bits available for memory manager use in an object. |
ObjectReference |
copy(ObjectReference from,
int allocator)
Copy an object using a plan's allocCopy to get space and install the forwarding pointer. |
private ObjectReference |
copyArray(ObjectReference from,
TIB tib,
RVMArray type,
int allocator)
|
private ObjectReference |
copyScalar(ObjectReference from,
TIB tib,
RVMClass type,
int allocator)
|
Address |
copyTo(ObjectReference from,
ObjectReference to,
Address region)
Copy an object to be pointer to by the to address. |
void |
dumpObject(ObjectReference object)
Dump debugging information for an object. |
Offset |
GC_HEADER_OFFSET()
Gets the offset of the memory management header from the object reference address. |
int |
getAlignOffsetWhenCopied(ObjectReference object)
Return the alignment offset requirements for a copy of this object |
int |
getAlignWhenCopied(ObjectReference object)
Return the alignment requirement for a copy of this object |
protected Offset |
getArrayBaseOffset()
|
int |
getArrayLength(ObjectReference object)
Get the length of an array object. |
int |
getCurrentSize(ObjectReference object)
Return the size used by an object |
ObjectReference |
getNextObject(ObjectReference object)
Return the next object in the heap under contiguous allocation |
Address |
getObjectEndAddress(ObjectReference object)
Gets a pointer to the address just past the end of the object. |
ObjectReference |
getObjectFromStartAddress(Address start)
Return an object reference from knowledge of the low order word |
(package private) static int |
getObjectSize(ObjectReference object)
Return the size of a given object, in bytes |
ObjectReference |
getReferenceWhenCopiedTo(ObjectReference from,
Address to)
Return the reference that an object will be refered to after it is copied to the specified region. |
int |
getSizeWhenCopied(ObjectReference object)
Return the size required to copy an object |
byte[] |
getTypeDescriptor(ObjectReference ref)
Get the type descriptor for an object. |
boolean |
isAcyclic(ObjectReference typeRef)
Checks if a reference of the given type in another object is inherently acyclic. |
boolean |
isArray(ObjectReference object)
Is the passed object an array? |
boolean |
isPrimitiveArray(ObjectReference object)
Is the passed object a primitive array? |
Address |
objectStartRef(ObjectReference object)
Returns the lowest address of the storage associated with an object. |
Word |
prepareAvailableBits(ObjectReference object)
Gets the value of bits available for memory manager use in an object, in preparation for setting those bits. |
Word |
readAvailableBitsWord(ObjectReference object)
Read the bits available for memory manager use in an object. |
byte |
readAvailableByte(ObjectReference object)
Read the byte available for memory manager use in an object. |
Address |
refToAddress(ObjectReference object)
Returns an address guaranteed to be inside the storage assocatied with and object. |
void |
setAvailableBit(ObjectReference object,
int idx,
boolean flag)
Sets a bit available for memory manager use in an object. |
boolean |
testAvailableBit(ObjectReference object,
int idx)
Tests a bit available for memory manager use in an object. |
void |
writeAvailableBitsWord(ObjectReference object,
Word val)
Sets the bits available for memory manager use in an object. |
void |
writeAvailableByte(ObjectReference object,
byte val)
Sets the byte available for memory manager use in an object. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ObjectModel()
| Method Detail |
|---|
protected Offset getArrayBaseOffset()
getArrayBaseOffset in class ObjectModel
public ObjectReference copy(ObjectReference from,
int allocator)
from must have
been reserved for copying by the caller. This method calls the
plan's getStatusForCopy() method to establish a new
status word for the copied object and postCopy() to
allow the plan to perform any post copy actions.
copy in class ObjectModelfrom - the address of the object to be copiedallocator - The allocator to use.
private ObjectReference copyScalar(ObjectReference from,
TIB tib,
RVMClass type,
int allocator)
private ObjectReference copyArray(ObjectReference from,
TIB tib,
RVMArray type,
int allocator)
static int getObjectSize(ObjectReference object)
object - The object whose size is being queried
public Address copyTo(ObjectReference from,
ObjectReference to,
Address region)
copyTo in class ObjectModelfrom - the address of the object to be copiedto - The target location.region - The start (or an address less than) the region that was reserved for this object.
public ObjectReference getReferenceWhenCopiedTo(ObjectReference from,
Address to)
getReferenceWhenCopiedTo in class ObjectModelfrom - The object to be copied.to - The region to be copied to.
public Address getObjectEndAddress(ObjectReference object)
getObjectEndAddress in class ObjectModelobject - The objecty.public int getSizeWhenCopied(ObjectReference object)
getSizeWhenCopied in class ObjectModelobject - The object whose size is to be queried
objpublic int getAlignWhenCopied(ObjectReference object)
getAlignWhenCopied in class ObjectModelobject - The object whose size is to be queried
objpublic int getAlignOffsetWhenCopied(ObjectReference object)
getAlignOffsetWhenCopied in class ObjectModelobject - The object whose size is to be queried
objpublic int getCurrentSize(ObjectReference object)
getCurrentSize in class ObjectModelobject - The object whose size is to be queried
objpublic ObjectReference getNextObject(ObjectReference object)
getNextObject in class ObjectModelpublic ObjectReference getObjectFromStartAddress(Address start)
getObjectFromStartAddress in class ObjectModelpublic byte[] getTypeDescriptor(ObjectReference ref)
getTypeDescriptor in class ObjectModelref - address of the object
public int getArrayLength(ObjectReference object)
ObjectModel
getArrayLength in class ObjectModelobject - address of the object
public boolean isArray(ObjectReference object)
isArray in class ObjectModelobject - address of the objectpublic boolean isPrimitiveArray(ObjectReference object)
isPrimitiveArray in class ObjectModelobject - address of the object
public boolean testAvailableBit(ObjectReference object,
int idx)
object - the address of the objectidx - the index of the bit
public void setAvailableBit(ObjectReference object,
int idx,
boolean flag)
object - the address of the objectidx - the index of the bitflag - true to set the bit to 1,
false to set it to 0
public boolean attemptAvailableBits(ObjectReference object,
Word oldVal,
Word newVal)
oldVal. The comparison with the
current value and setting are atomic with respect to other
allocators.
attemptAvailableBits in class ObjectModelobject - the address of the objectoldVal - the required current value of the bitsnewVal - the desired new value of the bits
true if the bits were set,
false otherwisepublic Word prepareAvailableBits(ObjectReference object)
prepareAvailableBits in class ObjectModelobject - the address of the object
public void writeAvailableByte(ObjectReference object,
byte val)
writeAvailableByte in class ObjectModelobject - the address of the objectval - the new value of the bytepublic byte readAvailableByte(ObjectReference object)
readAvailableByte in class ObjectModelobject - the address of the object
public void writeAvailableBitsWord(ObjectReference object,
Word val)
writeAvailableBitsWord in class ObjectModelobject - the address of the objectval - the new value of the bitspublic Word readAvailableBitsWord(ObjectReference object)
readAvailableBitsWord in class ObjectModelobject - the address of the object
public Offset GC_HEADER_OFFSET()
GC_HEADER_OFFSET in class ObjectModelpublic Address objectStartRef(ObjectReference object)
objectStartRef in class ObjectModelobject - the reference address of the object
public Address refToAddress(ObjectReference object)
refToAddress in class ObjectModelobject - the reference address of the object
public boolean isAcyclic(ObjectReference typeRef)
isAcyclic in class ObjectModeltrue if a reference of the type is
inherently acyclicpublic void dumpObject(ObjectReference object)
dumpObject in class ObjectModelobject - The object whose information is to be dumped
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||