Elide GraalVM25.6.0-elide.4
All types
Versions and modules

NFIState

Javaclassin com.oracle.truffle.nfi.backend.spi

public final class NFIState
Inheritance
  1. Object
  2. NFIState

Thread-local state of the NFI that is shared between different backends. All methods should only be called from the corresponding thread to which this state belongs (for thread-safety reasons and because the SVM NFI backend relies on it by using a FastThreadLocalBytes for the errno pointer, which means the errno pointer points inside the IsolateThread), except the constructor and dispose() which may be called from another thread, as Truffle hooks which call those are not guaranteed to be called from the corresponding thread.

Constructors1

NFIState(Thread)No description.

NFIState

public NFIState(Thread thread)

No description.

Parameters

threadThread
No description.

Methods8

int getNFIErrno()No description.

getNFIErrno

public int getNFIErrno()

No description.

Returns

int
No description.
void setNFIErrno(int)No description.

setNFIErrno

public void setNFIErrno(int nfiErrno)

No description.

Parameters

nfiErrnoint
No description.
Throwable getPendingException()No description.

getPendingException

public Throwable getPendingException()

No description.

Returns

Throwable
No description.
void setPendingException(Throwable)No description.

setPendingException

public void setPendingException(Throwable t)

No description.

Parameters

tThrowable
No description.
void clearPendingException()No description.

clearPendingException

public void clearPendingException()

No description.

Throwable savePendingException()

savePendingException

since 25.6
public Throwable savePendingException()

Saves and clears the pending exception so an upcall and its nested calls see a clean state. Pair this with restorePendingException(Throwable) in a finally block.

Returns

Throwable
the previous pending exception, or null
void restorePendingException(Throwable)

restorePendingException

since 25.6
public void restorePendingException(Throwable saved)

Restores a non-null saved exception, replacing any exception produced by the upcall. If saved is null, leaves the current pending exception untouched so a new exception can propagate to the enclosing downcall.

Parameters

savedThrowable
the exception returned by savePendingException()
void dispose()No description.

dispose

public void dispose()

No description.

Inherited members