public final class HeapImpl extends Heap
| Constructor and Description |
|---|
HeapImpl(org.graalvm.nativeimage.hosted.Feature.FeatureAccess access) |
| Modifier and Type | Method and Description |
|---|---|
void |
attachThread(org.graalvm.nativeimage.IsolateThread isolateThread)
Notifies the heap that a new thread was attached to the VM.
|
org.graalvm.compiler.nodes.gc.CardTableBarrierSet |
createBarrierSet(jdk.vm.ci.meta.MetaAccessProvider metaAccess)
Returns a suitable
BarrierSet for the garbage collector that is used for this heap. |
void |
detachThread(org.graalvm.nativeimage.IsolateThread isolateThread)
Notifies the heap that a thread will be detached from the VM.
|
void |
endSafepoint()
Reset the heap to the normal execution state.
|
Reference<?> |
getAndClearReferencePendingList()
Atomically get the list of pending references and clears (resets) it.
|
List<Class<?>> |
getClassList()
Return a list of all the classes in the heap.
|
GC |
getGC() |
static HeapImpl |
getHeapImpl() |
static ImageHeapInfo |
getImageHeapInfo() |
int |
getImageHeapOffsetInAddressSpace()
Returns the offset that the image heap should have when mapping the native image file to the
address space in memory.
|
ObjectHeader |
getObjectHeader()
Get the ObjectHeader implementation that this Heap uses.
|
int |
getPreferredAddressSpaceAlignment()
Returns a multiple to which the heap address space should be aligned to at runtime.
|
boolean |
hasReferencePendingList()
|
boolean |
isAllocationDisallowed() |
boolean |
isInImageHeap(Object obj)
Returns true if the given object is located in the image heap.
|
boolean |
isInImageHeap(org.graalvm.word.Pointer pointer)
Returns true if the object at the given address is located in the image heap.
|
void |
prepareForSafepoint()
Prepare the heap for a safepoint.
|
void |
registerCodeConstants(CodeInfo codeInfo)
Notify the GC that run-time compiled code has embedded references to Java heap objects.
|
void |
registerRuntimeCodeInfo(CodeInfo codeInfo)
Notify the GC that a code metadata object references Java heap objects from native-memory.
|
void |
resumeAllocation() |
void |
suspendAllocation() |
boolean |
tearDown()
Tear down the heap and release its memory.
|
void |
unregisterCodeConstants(CodeInfo info)
Notify the GC that run-time compiled code will be freed that has embedded references to Java
heap objects.
|
void |
unregisterRuntimeCodeInfo(CodeInfo codeInfo)
Notify the GC that a code metadata object will be freed that references Java heap objects
from native-memory.
|
static boolean |
usesImageHeapCardMarking() |
static boolean |
usesImageHeapChunks() |
void |
waitForReferencePendingList()
Blocks until the heap has pending references.
|
void |
wakeUpReferencePendingListWaiters()
Unblocks any threads in
Heap.waitForReferencePendingList(). |
boolean |
walkCollectedHeapObjects(ObjectVisitor visitor)
Walk all heap objects except the native image heap objects.
|
boolean |
walkImageHeapObjects(ObjectVisitor visitor)
Walk all native image heap objects.
|
boolean |
walkObjects(ObjectVisitor visitor)
Walk all the objects in the heap.
|
public HeapImpl(org.graalvm.nativeimage.hosted.Feature.FeatureAccess access)
public static HeapImpl getHeapImpl()
public static ImageHeapInfo getImageHeapInfo()
public boolean isInImageHeap(Object obj)
HeapisInImageHeap in class Heappublic boolean isInImageHeap(org.graalvm.word.Pointer pointer)
HeapisInImageHeap in class Heappublic void suspendAllocation()
suspendAllocation in class Heappublic void resumeAllocation()
resumeAllocation in class Heappublic boolean walkObjects(ObjectVisitor visitor)
HeapwalkObjects in class Heappublic boolean tearDown()
public ObjectHeader getObjectHeader()
HeapgetObjectHeader in class Heappublic boolean isAllocationDisallowed()
isAllocationDisallowed in class Heappublic List<Class<?>> getClassList()
getClassList in class Heappublic void prepareForSafepoint()
HeapprepareForSafepoint in class Heappublic void endSafepoint()
HeapendSafepoint in class Heappublic void attachThread(org.graalvm.nativeimage.IsolateThread isolateThread)
HeapattachThread in class Heappublic void detachThread(org.graalvm.nativeimage.IsolateThread isolateThread)
HeapdetachThread in class Heappublic static boolean usesImageHeapChunks()
public static boolean usesImageHeapCardMarking()
public int getPreferredAddressSpaceAlignment()
HeapgetPreferredAddressSpaceAlignment in class HeapCommittedMemoryProvider.guaranteesHeapPreferredAddressSpaceAlignment()public int getImageHeapOffsetInAddressSpace()
HeapgetImageHeapOffsetInAddressSpace in class Heappublic boolean walkImageHeapObjects(ObjectVisitor visitor)
HeapwalkImageHeapObjects in class Heappublic boolean walkCollectedHeapObjects(ObjectVisitor visitor)
HeapwalkCollectedHeapObjects in class Heappublic org.graalvm.compiler.nodes.gc.CardTableBarrierSet createBarrierSet(jdk.vm.ci.meta.MetaAccessProvider metaAccess)
HeapBarrierSet for the garbage collector that is used for this heap.createBarrierSet in class Heappublic boolean hasReferencePendingList()
HeaphasReferencePendingList in class Heappublic void waitForReferencePendingList()
throws InterruptedException
HeapwaitForReferencePendingList in class HeapInterruptedExceptionpublic void wakeUpReferencePendingListWaiters()
HeapHeap.waitForReferencePendingList().wakeUpReferencePendingListWaiters in class Heappublic Reference<?> getAndClearReferencePendingList()
Heapnull.getAndClearReferencePendingList in class Heappublic void registerRuntimeCodeInfo(CodeInfo codeInfo)
HeapregisterRuntimeCodeInfo in class Heappublic void registerCodeConstants(CodeInfo codeInfo)
HeapregisterCodeConstants in class Heappublic void unregisterCodeConstants(CodeInfo info)
HeapunregisterCodeConstants in class Heappublic void unregisterRuntimeCodeInfo(CodeInfo codeInfo)
HeapunregisterRuntimeCodeInfo in class Heap