public final class AlignedHeapChunk extends Object
This is the key to the chunk-allocated heap: Because these chunks are allocated on aligned boundaries, I can map from a Pointer to (or into) an Object to the AlignedChunk that contains it. From there I can get to the meta-data the AlignedChunk contains, without a table lookup on the Pointer.
Most allocation within a AlignedHeapChunk is via fast-path allocation snippets, but a slow-path allocation method is available.
Objects in a AlignedHeapChunk have to be promoted by copying from their current HeapChunk to a destination HeapChunk.
An AlignedHeapChunk is laid out:
+===============+-------+--------+----------------------+ | AlignedHeader | Card | First | Object ... | | Fields | Table | Object | | | | | Table | | +===============+-------+--------+----------------------+The size of both the CardTable and the FirstObjectTable depends on the used
RememberedSet
implementation and may even be zero.Modifier and Type | Class and Description |
---|---|
static interface |
AlignedHeapChunk.AlignedHeader
Additional fields beyond what is in
HeapChunk.Header . |
Modifier and Type | Method and Description |
---|---|
static AlignedHeapChunk.AlignedHeader |
getEnclosingChunk(Object obj) |
static AlignedHeapChunk.AlignedHeader |
getEnclosingChunkFromObjectPointer(org.graalvm.word.Pointer ptr) |
static org.graalvm.word.UnsignedWord |
getObjectOffset(AlignedHeapChunk.AlignedHeader that,
org.graalvm.word.Pointer objectPointer)
Return the offset of an object within the objects part of a chunk.
|
static org.graalvm.word.Pointer |
getObjectsStart(AlignedHeapChunk.AlignedHeader that) |
static org.graalvm.word.UnsignedWord |
getObjectsStartOffset() |
static void |
initialize(AlignedHeapChunk.AlignedHeader chunk,
org.graalvm.word.UnsignedWord chunkSize) |
static void |
reset(AlignedHeapChunk.AlignedHeader chunk) |
public static void initialize(AlignedHeapChunk.AlignedHeader chunk, org.graalvm.word.UnsignedWord chunkSize)
public static void reset(AlignedHeapChunk.AlignedHeader chunk)
public static org.graalvm.word.Pointer getObjectsStart(AlignedHeapChunk.AlignedHeader that)
public static AlignedHeapChunk.AlignedHeader getEnclosingChunk(Object obj)
public static AlignedHeapChunk.AlignedHeader getEnclosingChunkFromObjectPointer(org.graalvm.word.Pointer ptr)
public static org.graalvm.word.UnsignedWord getObjectOffset(AlignedHeapChunk.AlignedHeader that, org.graalvm.word.Pointer objectPointer)
public static org.graalvm.word.UnsignedWord getObjectsStartOffset()