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

NFIBackendSignatureLibrary

Javaabstract classin com.oracle.truffle.nfi.backend.spi

public abstract class NFIBackendSignatureLibrary extends Library
Inheritance
  1. Object
  2. Node
  3. Library
  4. NFIBackendSignatureLibrary

Library that specifies the protocol between the Truffle NFI and its backend implementations.

Constructors1

NFIBackendSignatureLibrary()

NFIBackendSignatureLibrary

implicit
public NFIBackendSignatureLibrary()

Creates a new NFIBackendSignatureLibrary instance.

Methods2

Object call(Object, Object, Object...)

call

abstract
public abstract Object call(
    Object signature,
    Object functionPointer,
    Object... args
) throws ArityException, UnsupportedTypeException, UnsupportedMessageException

Call a native function with this signature.

Parameters

signatureObject
No description.
functionPointerObject
No description.
argsObject...
No description.

Returns

Object
No description.

Throws

ArityException
No description.
Object createClosure(Object, Object)

createClosure

abstract
public abstract Object createClosure(Object signature, Object executable)

Create a function pointer closure that calls back into an executable object. This message must return something that's compatible with NativeSimpleType.POINTER. The returned pointer should be a function pointer. Calling that function pointer sends the InteropLibrary.execute message to the executable object. The returned object should not be executable. NFI backends can assume that the execute message of the executable object will never throw. Exceptions are instead stored as "pending" and rethrown at the next managed frame. Before an upcall, backends must save and clear any earlier pending exception using NFIState.savePendingException(). They must restore it using NFIState.restorePendingException(Throwable) in a finally block after the upcall. This scope must include argument and return conversion so nested native calls see a clean exception state and successful upcalls still return their results to native code. An earlier pending exception takes precedence over an exception from the new upcall.

Parameters

signatureObject
No description.
executableObject
No description.

Returns

Object
No description.

Inherited members

From class Library

accepts