public abstract class JavaVMOperation extends VMOperation implements VMOperationControl.JavaAllocationFreeQueue.Element<JavaVMOperation>
NativeVMOperation). JavaVMOperation objects should be short lived and only
enqueued/executed once. For increased thread safety, it is prohibited to allocate
JavaVMOperations that live in the image heap (see note below).
Note: the VM operation infrastructure supports that JavaVMOperations are reused and
executed multiple times. However, extra care must be taken as each VM operation object can only
be in the VM operation queue once. Therefore, it must be guaranteed that the VM operation is
executed before it is enqueued again. Otherwise, this could result in various race conditions,
especially if SubstrateOptions.UseDedicatedVMOperationThread is enabled.
| Modifier and Type | Class and Description |
|---|---|
static class |
JavaVMOperation.ThunkOperation
A VMOperation that executes a thunk.
|
VMOperation.SystemEffect| Modifier and Type | Field and Description |
|---|---|
protected org.graalvm.nativeimage.IsolateThread |
queuingThread |
| Modifier | Constructor and Description |
|---|---|
protected |
JavaVMOperation(String name,
VMOperation.SystemEffect systemEffect) |
| Modifier and Type | Method and Description |
|---|---|
void |
enqueue() |
static void |
enqueueBlockingNoSafepoint(String name,
SubstrateUtil.Thunk thunk)
Convenience method for thunks that can be run by allocating a VMOperation.
|
static void |
enqueueBlockingSafepoint(String name,
SubstrateUtil.Thunk thunk)
Convenience method for thunks that can be run by allocating a VMOperation.
|
JavaVMOperation |
getNext() |
protected org.graalvm.nativeimage.IsolateThread |
getQueuingThread(NativeVMOperationData data) |
protected boolean |
hasWork() |
protected boolean |
hasWork(NativeVMOperationData data)
Used to determine if a VM operation must be executed or if it can be skipped.
|
protected boolean |
isFinished(NativeVMOperationData data) |
protected abstract void |
operate() |
void |
operate(NativeVMOperationData data) |
protected void |
setFinished(NativeVMOperationData data,
boolean value) |
void |
setNext(JavaVMOperation value) |
protected void |
setQueuingThread(NativeVMOperationData data,
org.graalvm.nativeimage.IsolateThread thread) |
execute, getCausesSafepoint, getName, guaranteeGCInProgress, guaranteeInProgress, guaranteeInProgressAtSafepoint, guaranteeNotInProgress, isGC, isGCInProgress, isInProgress, isInProgressAtSafepointprotected JavaVMOperation(String name, VMOperation.SystemEffect systemEffect)
public JavaVMOperation getNext()
getNext in interface VMOperationControl.JavaAllocationFreeQueue.Element<JavaVMOperation>public void setNext(JavaVMOperation value)
setNext in interface VMOperationControl.JavaAllocationFreeQueue.Element<JavaVMOperation>public void enqueue()
protected org.graalvm.nativeimage.IsolateThread getQueuingThread(NativeVMOperationData data)
getQueuingThread in class VMOperationprotected void setQueuingThread(NativeVMOperationData data, org.graalvm.nativeimage.IsolateThread thread)
setQueuingThread in class VMOperationprotected boolean isFinished(NativeVMOperationData data)
isFinished in class VMOperationprotected void setFinished(NativeVMOperationData data, boolean value)
setFinished in class VMOperationprotected final boolean hasWork(NativeVMOperationData data)
VMOperationhasWork in class VMOperationprotected boolean hasWork()
public static void enqueueBlockingSafepoint(String name, SubstrateUtil.Thunk thunk)
public static void enqueueBlockingNoSafepoint(String name, SubstrateUtil.Thunk thunk)
public final void operate(NativeVMOperationData data)
operate in class VMOperationprotected abstract void operate()