Class LibGraalIsolate
java.lang.Object
com.oracle.truffle.runtime.hotspot.libgraal.LibGraalIsolate
Represents a single libgraal isolate. All
LibGraalObjects have a LibGraalIsolate
context.-
Method Summary
Modifier and TypeMethodDescriptionstatic LibGraalIsolatecurrent()Gets the isolate associated with the current thread.longgetId()<T> TgetSingleton(Class<T> key, Supplier<T> supplier) Gets the value corresponding tokeyfrom a key-value store of singleton objects.booleanisValid()toString()static voidunregister(long isolateId) Notifies that theJavaVMassociated withisolatehas been destroyed.
-
Method Details
-
getId
public long getId() -
current
Gets the isolate associated with the current thread. The current thread must be in an opened scope.- Throws:
IllegalStateException- if the current thread is not attached to libgraal
-
getSingleton
Gets the value corresponding tokeyfrom a key-value store of singleton objects. If no value corresponding tokeycurrently exists, then it is computed withsupplierand inserted in the store. This is used to obtain objects whose lifetime is bound to the isolate represented by this object. -
unregister
public static void unregister(long isolateId) Notifies that theJavaVMassociated withisolatehas been destroyed. All subsequent accesses to objects in the isolate will throw anDestroyedIsolateException. Called byLibGraalFeature#shutdownLibGraalusing JNI. -
toString
-
isValid
public boolean isValid()
-