public class AlignedHeapChunk extends HeapChunk
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 HeapChunk fields can be accessed via methods from HeapChunk, or more type-specifically via methods defined here. But the CardTable and the FirstObjectTable and the start of the Objects are just computed addresses. The two tables each need 1/512th of the size of the space for Objects, so I conservatively compute them as 1/512th of the size of the chunk.
Modifier and Type | Class and Description |
---|---|
static interface |
AlignedHeapChunk.AlignedHeader
Additional fields beyond what is in
HeapChunk.Header . |
protected static class |
AlignedHeapChunk.MemoryWalkerAccessImpl
Methods for a MemoryWalker to access an aligned heap chunk.
|
static class |
AlignedHeapChunk.TestingBackDoor
Expose some methods that should be protected.
|
HeapChunk.Header<T extends HeapChunk.Header<T>>
Constructor and Description |
---|
AlignedHeapChunk() |
Modifier and Type | Method and Description |
---|---|
static void |
dirtyCardForObjectOfAlignedHeapChunk(Object object,
boolean verifyOnly)
Dirty the card corresponding to the given Object.
|
static org.graalvm.word.UnsignedWord |
getAlignedHeapOverhead()
The overhead of an aligned chunk.
|
static MemoryWalker.HeapChunkAccess<AlignedHeapChunk.AlignedHeader> |
getMemoryWalkerAccess() |
protected static org.graalvm.word.UnsignedWord |
usedObjectMemoryOfAlignedHeapChunk(AlignedHeapChunk.AlignedHeader that)
How much space is used for the objects in an AlignedHeapChunk?
|
asPointer, availableObjectMemory, setTopCarefully, walkObjectsFrom
public static org.graalvm.word.UnsignedWord getAlignedHeapOverhead()
protected static org.graalvm.word.UnsignedWord usedObjectMemoryOfAlignedHeapChunk(AlignedHeapChunk.AlignedHeader that)
public static void dirtyCardForObjectOfAlignedHeapChunk(Object object, boolean verifyOnly)
public static MemoryWalker.HeapChunkAccess<AlignedHeapChunk.AlignedHeader> getMemoryWalkerAccess()