|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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 |
---|
TL_DEDICATED_U16_OFFSET, TL_DEDICATED_U16_SHIFT, TL_LOCK_COUNT_MASK, TL_LOCK_COUNT_SHIFT, TL_LOCK_COUNT_UNIT, TL_LOCK_ID_MASK, TL_LOCK_ID_SHIFT, TL_NUM_BITS_RC, TL_NUM_BITS_STAT, TL_NUM_BITS_TID, TL_STAT_BIASABLE, TL_STAT_FAT, TL_STAT_MASK, TL_STAT_SHIFT, TL_STAT_THIN, TL_THREAD_ID_MASK, TL_THREAD_ID_SHIFT, TL_UNLOCK_MASK |
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 referred 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)
ObjectModel
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 ObjectModel
from
- 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)
ObjectModel
copyTo
in class ObjectModel
region
- The start (or an address less than) the region that was reserved for this object.from
- the address of the object to be copiedto
- The target location.
public ObjectReference getReferenceWhenCopiedTo(ObjectReference from, Address to)
ObjectModel
getReferenceWhenCopiedTo
in class ObjectModel
from
- The object to be copied.to
- The region to be copied to.
public Address getObjectEndAddress(ObjectReference object)
ObjectModel
getObjectEndAddress
in class ObjectModel
object
- The objecty.public int getSizeWhenCopied(ObjectReference object)
ObjectModel
getSizeWhenCopied
in class ObjectModel
object
- The object whose size is to be queried
obj
public int getAlignWhenCopied(ObjectReference object)
ObjectModel
getAlignWhenCopied
in class ObjectModel
object
- The object whose size is to be queried
obj
public int getAlignOffsetWhenCopied(ObjectReference object)
ObjectModel
getAlignOffsetWhenCopied
in class ObjectModel
object
- The object whose size is to be queried
obj
public int getCurrentSize(ObjectReference object)
ObjectModel
getCurrentSize
in class ObjectModel
object
- The object whose size is to be queried
obj
public ObjectReference getNextObject(ObjectReference object)
ObjectModel
getNextObject
in class ObjectModel
public ObjectReference getObjectFromStartAddress(Address start)
ObjectModel
getObjectFromStartAddress
in class ObjectModel
public byte[] getTypeDescriptor(ObjectReference ref)
ObjectModel
getTypeDescriptor
in class ObjectModel
ref
- address of the object
public int getArrayLength(ObjectReference object)
ObjectModel
getArrayLength
in class ObjectModel
object
- address of the object
public boolean isArray(ObjectReference object)
ObjectModel
isArray
in class ObjectModel
object
- address of the objectpublic boolean isPrimitiveArray(ObjectReference object)
ObjectModel
isPrimitiveArray
in class ObjectModel
object
- address of the objectpublic boolean testAvailableBit(ObjectReference object, int idx)
object
- the address of the objectidx
- the index of the bitpublic 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 0public boolean attemptAvailableBits(ObjectReference object, Word oldVal, Word newVal)
ObjectModel
oldVal
. The comparison with the
current value and setting are atomic with respect to other
allocators.
attemptAvailableBits
in class ObjectModel
object
- 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)
ObjectModel
prepareAvailableBits
in class ObjectModel
object
- the address of the object
public void writeAvailableByte(ObjectReference object, byte val)
ObjectModel
writeAvailableByte
in class ObjectModel
object
- the address of the objectval
- the new value of the bytepublic byte readAvailableByte(ObjectReference object)
ObjectModel
readAvailableByte
in class ObjectModel
object
- the address of the object
public void writeAvailableBitsWord(ObjectReference object, Word val)
ObjectModel
writeAvailableBitsWord
in class ObjectModel
object
- the address of the objectval
- the new value of the bitspublic Word readAvailableBitsWord(ObjectReference object)
ObjectModel
readAvailableBitsWord
in class ObjectModel
object
- the address of the object
public Offset GC_HEADER_OFFSET()
ObjectModel
GC_HEADER_OFFSET
in class ObjectModel
public Address objectStartRef(ObjectReference object)
ObjectModel
objectStartRef
in class ObjectModel
object
- the reference address of the object
public Address refToAddress(ObjectReference object)
ObjectModel
refToAddress
in class ObjectModel
object
- the reference address of the object
public boolean isAcyclic(ObjectReference typeRef)
ObjectModel
isAcyclic
in class ObjectModel
true
if a reference of the type is
inherently acyclicpublic void dumpObject(ObjectReference object)
ObjectModel
dumpObject
in class ObjectModel
object
- The object whose information is to be dumped
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |