Class LibGraalScope

java.lang.Object
com.oracle.truffle.runtime.hotspot.libgraal.LibGraalScope
All Implemented Interfaces:
AutoCloseable

public final class LibGraalScope extends Object implements AutoCloseable
Scope for calling CEntryPoints in libgraal. Opening a scope ensures the current thread is attached to libgraal and closing the outer most scope detaches the current thread.
  • Constructor Details

  • Method Details

    • current

      public static LibGraalScope current()
      Gets the current scope.
      Throws:
      IllegalStateException - if the current thread is not in an opened scope
    • getIsolateThread

      public static long getIsolateThread()
      Gets the isolate thread associated with the current thread. The current thread must be in an opened scope.
      Returns:
      a value that can be used for the IsolateThreadContext argument of a native method linked to a CEntryPoint function in libgraal
      Throws:
      IllegalStateException - if the current thread is not attached to libgraal
    • toString

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

      public LibGraalIsolate getIsolate()
      Gets the isolate associated with this scope.
    • getIsolateThreadAddress

      public long getIsolateThreadAddress()
      Gets the address of the isolate thread associated with this scope.
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable