public final class UnalignedHeapChunk extends Object
An UnalignedHeapChunk does not have a way to map from a Pointer to (or into) the Object they contain to the UnalignedHeapChunk that contains them.
An Object in a UnalignedHeapChunk needs to have a bit set in its DynamicHub to identify it as an Object in a UnalignedHeapChunk, so things like write-barriers don't try to update meta-data. Also so things like the getEnclosingHeapChunk(Object) can tell that the object is in an UnalignedHeapChunk.
Only a slow-path allocation method is available for UnalignedHeapChunks. This is acceptable because UnalignedHeapChunks are for large objects, so the cost of initializing the object dwarfs the cost of slow-path allocation.
The Object in an UnalignedHeapChunk can be promoted from one Space to another by moving the UnalignedHeapChunk from one Space to the other, rather than copying the Object out of the HeapChunk in one Space and into a destination HeapChunk in the other Space. That saves some amount of copying cost for these large objects. An UnalignedHeapChunk is laid out:
+=================+-------+-------------------------------------+ | UnalignedHeader | Card | Object | | Fields | Table | | +=================+-------+-------------------------------------+The HeapChunk fields can be accessed as declared fields, but the card "table" and the location of the Object are just computed as Pointers. In this implementation, I am only implementing precise card remembered sets, so I only need one entry for the whole Object. But for consistency I am treating it as a 1-element table.
Modifier and Type | Class and Description |
---|---|
static class |
UnalignedHeapChunk.TestingBackDoor |
static interface |
UnalignedHeapChunk.UnalignedHeader
Additional fields beyond what is in
HeapChunk.Header . |
Modifier and Type | Method and Description |
---|---|
static org.graalvm.word.Pointer |
allocateMemory(UnalignedHeapChunk.UnalignedHeader that,
org.graalvm.word.UnsignedWord size)
Allocate uninitialized memory within this AlignedHeapChunk.
|
static void |
dirtyCardForObject(Object obj,
boolean verifyOnly) |
static org.graalvm.word.UnsignedWord |
getCommittedObjectMemory(UnalignedHeapChunk.UnalignedHeader that) |
static MemoryWalker.HeapChunkAccess<UnalignedHeapChunk.UnalignedHeader> |
getMemoryWalkerAccess() |
static org.graalvm.word.UnsignedWord |
getOverhead() |
static boolean |
walkDirtyObjects(UnalignedHeapChunk.UnalignedHeader that,
ObjectVisitor visitor,
boolean clean) |
static boolean |
walkObjects(UnalignedHeapChunk.UnalignedHeader that,
ObjectVisitor visitor) |
static boolean |
walkObjectsInline(UnalignedHeapChunk.UnalignedHeader that,
ObjectVisitor visitor) |
public static org.graalvm.word.UnsignedWord getOverhead()
public static org.graalvm.word.Pointer allocateMemory(UnalignedHeapChunk.UnalignedHeader that, org.graalvm.word.UnsignedWord size)
public static boolean walkObjects(UnalignedHeapChunk.UnalignedHeader that, ObjectVisitor visitor)
public static boolean walkObjectsInline(UnalignedHeapChunk.UnalignedHeader that, ObjectVisitor visitor)
public static void dirtyCardForObject(Object obj, boolean verifyOnly)
public static boolean walkDirtyObjects(UnalignedHeapChunk.UnalignedHeader that, ObjectVisitor visitor, boolean clean)
public static org.graalvm.word.UnsignedWord getCommittedObjectMemory(UnalignedHeapChunk.UnalignedHeader that)
public static MemoryWalker.HeapChunkAccess<UnalignedHeapChunk.UnalignedHeader> getMemoryWalkerAccess()