public abstract class ObjectModel extends Object
| Constructor and Description |
|---|
ObjectModel() |
| Modifier and Type | Method and Description |
|---|---|
(package private) static Offset |
arrayBaseOffsetTrapdoor(ObjectModel o) |
abstract boolean |
attemptAvailableBits(ObjectReference object,
Word oldVal,
Word newVal)
Attempts to set the bits available for memory manager use in an
object.
|
abstract ObjectReference |
copy(ObjectReference from,
int allocator)
Copy an object using a plan's allocCopy to get space and install
the forwarding pointer.
|
abstract Address |
copyTo(ObjectReference from,
ObjectReference to,
Address region)
Copy an object to be pointer to by the to address.
|
abstract void |
dumpObject(ObjectReference object)
Dump debugging information for an object.
|
abstract Offset |
GC_HEADER_OFFSET()
Gets the offset of the memory management header from the object
reference address.
|
abstract int |
getAlignOffsetWhenCopied(ObjectReference object)
Return the alignment offset requirements for a copy of this object
|
abstract int |
getAlignWhenCopied(ObjectReference object)
Return the alignment requirement for a copy of this object
|
protected abstract Offset |
getArrayBaseOffset() |
abstract int |
getArrayLength(ObjectReference object)
Get the length of an array object.
|
abstract int |
getCurrentSize(ObjectReference object)
Return the size used by an object
|
abstract ObjectReference |
getNextObject(ObjectReference object) |
abstract Address |
getObjectEndAddress(ObjectReference object)
Gets a pointer to the address just past the end of the object.
|
abstract ObjectReference |
getObjectFromStartAddress(Address start) |
abstract ObjectReference |
getReferenceWhenCopiedTo(ObjectReference from,
Address to)
Return the reference that an object will be referred to after it is copied
to the specified region.
|
abstract int |
getSizeWhenCopied(ObjectReference object)
Return the size required to copy an object
|
abstract byte[] |
getTypeDescriptor(ObjectReference ref)
Get the type descriptor for an object.
|
abstract boolean |
isAcyclic(ObjectReference typeRef)
Checks if a reference of the given type in another object is
inherently acyclic.
|
abstract boolean |
isArray(ObjectReference object) |
abstract boolean |
isPrimitiveArray(ObjectReference object) |
abstract Address |
objectStartRef(ObjectReference object)
Returns the lowest address of the storage associated with an object.
|
abstract Word |
prepareAvailableBits(ObjectReference object)
Gets the value of bits available for memory manager use in an
object, in preparation for setting those bits.
|
abstract Word |
readAvailableBitsWord(ObjectReference object)
Read the bits available for memory manager use in an object.
|
abstract byte |
readAvailableByte(ObjectReference object)
Read the byte available for memory manager use in an object.
|
abstract Address |
refToAddress(ObjectReference object)
Returns an address guaranteed to be inside the storage assocatied
with and object.
|
abstract void |
writeAvailableBitsWord(ObjectReference object,
Word val)
Sets the bits available for memory manager use in an object.
|
abstract void |
writeAvailableByte(ObjectReference object,
byte val)
Sets the byte available for memory manager use in an object.
|
public ObjectModel()
public abstract 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.from - the address of the object to be copiedallocator - The allocator to use.public abstract Address copyTo(ObjectReference from, ObjectReference to, Address region)
from - the address of the object to be copiedto - The target location.region - The start of the region that was reserved for this objectpublic abstract ObjectReference getReferenceWhenCopiedTo(ObjectReference from, Address to)
from - The object to be copied.to - The region to be copied to.public abstract int getSizeWhenCopied(ObjectReference object)
object - The object whose size is to be queriedobjpublic abstract int getAlignWhenCopied(ObjectReference object)
object - The object whose size is to be queriedobjpublic abstract int getAlignOffsetWhenCopied(ObjectReference object)
object - The object whose size is to be queriedobjpublic abstract int getCurrentSize(ObjectReference object)
object - The object whose size is to be queriedobjpublic abstract ObjectReference getNextObject(ObjectReference object)
object - the current objectpublic abstract ObjectReference getObjectFromStartAddress(Address start)
start - the start address of the objectpublic abstract Address getObjectEndAddress(ObjectReference object)
object - The objectpublic abstract byte[] getTypeDescriptor(ObjectReference ref)
ref - address of the objectpublic abstract boolean isArray(ObjectReference object)
object - address of the objectpublic abstract boolean isPrimitiveArray(ObjectReference object)
object - address of the objectpublic abstract int getArrayLength(ObjectReference object)
object - address of the objectpublic abstract boolean attemptAvailableBits(ObjectReference object, Word oldVal, Word newVal)
oldVal. The comparison with the
current value and setting are atomic with respect to other
allocators.object - the address of the objectoldVal - the required current value of the bitsnewVal - the desired new value of the bitstrue if the bits were set,
false otherwisepublic abstract Word prepareAvailableBits(ObjectReference object)
object - the address of the objectpublic abstract void writeAvailableByte(ObjectReference object, byte val)
object - the address of the objectval - the new value of the bytepublic abstract byte readAvailableByte(ObjectReference object)
object - the address of the objectpublic abstract void writeAvailableBitsWord(ObjectReference object, Word val)
object - the address of the objectval - the new value of the bitspublic abstract Word readAvailableBitsWord(ObjectReference object)
object - the address of the objectpublic abstract Offset GC_HEADER_OFFSET()
public abstract Address objectStartRef(ObjectReference object)
object - the reference address of the objectpublic abstract Address refToAddress(ObjectReference object)
object - the reference address of the objectpublic abstract boolean isAcyclic(ObjectReference typeRef)
typeRef - the type of the reference (as a TIB)true if a reference of the type is
inherently acyclicpublic abstract void dumpObject(ObjectReference object)
object - The object whose information is to be dumpedprotected abstract Offset getArrayBaseOffset()
static Offset arrayBaseOffsetTrapdoor(ObjectModel o)