Class LibGraalIsolate

java.lang.Object
com.oracle.truffle.runtime.hotspot.libgraal.LibGraalIsolate

public final class LibGraalIsolate extends Object
Represents a single libgraal isolate. All LibGraalObjects have a LibGraalIsolate context.
  • Method Details

    • getId

      public long getId()
    • current

      public static LibGraalIsolate 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

      public <T> T getSingleton(Class<T> key, Supplier<T> supplier)
      Gets the value corresponding to key from a key-value store of singleton objects. If no value corresponding to key currently exists, then it is computed with supplier and 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 the JavaVM associated with isolate has been destroyed. All subsequent accesses to objects in the isolate will throw an DestroyedIsolateException. Called by LibGraalFeature#shutdownLibGraal using JNI.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • isValid

      public boolean isValid()