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)
Heap
isInImageHeap
in class Heap
public boolean isInImageHeap(org.graalvm.word.Pointer pointer)
Heap
isInImageHeap
in class Heap
public void suspendAllocation()
suspendAllocation
in class Heap
public void resumeAllocation()
resumeAllocation
in class Heap
public boolean walkObjects(ObjectVisitor visitor)
Heap
walkObjects
in class Heap
public boolean tearDown()
public ObjectHeader getObjectHeader()
Heap
getObjectHeader
in class Heap
public boolean isAllocationDisallowed()
isAllocationDisallowed
in class Heap
public List<Class<?>> getClassList()
getClassList
in class Heap
public void prepareForSafepoint()
Heap
prepareForSafepoint
in class Heap
public void endSafepoint()
Heap
endSafepoint
in class Heap
public void attachThread(org.graalvm.nativeimage.IsolateThread isolateThread)
Heap
attachThread
in class Heap
public void detachThread(org.graalvm.nativeimage.IsolateThread isolateThread)
Heap
detachThread
in class Heap
public static boolean usesImageHeapChunks()
public static boolean usesImageHeapCardMarking()
public int getPreferredAddressSpaceAlignment()
Heap
getPreferredAddressSpaceAlignment
in class Heap
CommittedMemoryProvider.guaranteesHeapPreferredAddressSpaceAlignment()
public int getImageHeapOffsetInAddressSpace()
Heap
getImageHeapOffsetInAddressSpace
in class Heap
public boolean walkImageHeapObjects(ObjectVisitor visitor)
Heap
walkImageHeapObjects
in class Heap
public boolean walkCollectedHeapObjects(ObjectVisitor visitor)
Heap
walkCollectedHeapObjects
in class Heap
public org.graalvm.compiler.nodes.gc.CardTableBarrierSet createBarrierSet(jdk.vm.ci.meta.MetaAccessProvider metaAccess)
Heap
BarrierSet
for the garbage collector that is used for this heap.createBarrierSet
in class Heap
public boolean hasReferencePendingList()
Heap
hasReferencePendingList
in class Heap
public void waitForReferencePendingList() throws InterruptedException
Heap
waitForReferencePendingList
in class Heap
InterruptedException
public void wakeUpReferencePendingListWaiters()
Heap
Heap.waitForReferencePendingList()
.wakeUpReferencePendingListWaiters
in class Heap
public Reference<?> getAndClearReferencePendingList()
Heap
null
.getAndClearReferencePendingList
in class Heap
public void registerRuntimeCodeInfo(CodeInfo codeInfo)
Heap
registerRuntimeCodeInfo
in class Heap
public void registerCodeConstants(CodeInfo codeInfo)
Heap
registerCodeConstants
in class Heap
public void unregisterCodeConstants(CodeInfo info)
Heap
unregisterCodeConstants
in class Heap
public void unregisterRuntimeCodeInfo(CodeInfo codeInfo)
Heap
unregisterRuntimeCodeInfo
in class Heap