Class NFIBackendSignatureLibrary

java.lang.Object
com.oracle.truffle.api.nodes.Node
com.oracle.truffle.api.library.Library
com.oracle.truffle.nfi.backend.spi.NFIBackendSignatureLibrary
All Implemented Interfaces:
com.oracle.truffle.api.nodes.NodeInterface, Cloneable

public abstract class NFIBackendSignatureLibrary extends com.oracle.truffle.api.library.Library
Library that specifies the protocol between the Truffle NFI and its backend implementations.
  • Nested Class Summary

    Nested classes/interfaces inherited from class com.oracle.truffle.api.nodes.Node

    com.oracle.truffle.api.nodes.Node.Child, com.oracle.truffle.api.nodes.Node.Children
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract Object
    call(Object signature, Object functionPointer, Object... args)
    Call a native function with this signature.
    abstract Object
    createClosure(Object signature, Object executable)
    Create a function pointer closure that calls back into an executable object.

    Methods inherited from class com.oracle.truffle.api.library.Library

    accepts

    Methods inherited from class com.oracle.truffle.api.nodes.Node

    accept, adoptChildren, atomic, atomic, copy, deepCopy, getChildren, getCost, getDebugProperties, getDescription, getEncapsulatingSourceSection, getLock, getParent, getRootNode, getSourceSection, insert, insert, isAdoptable, isSafelyReplaceableBy, notifyInserted, onReplace, replace, replace, reportPolymorphicSpecialize, toString

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • NFIBackendSignatureLibrary

      public NFIBackendSignatureLibrary()
  • Method Details

    • call

      public abstract Object call(Object signature, Object functionPointer, Object... args) throws com.oracle.truffle.api.interop.ArityException, com.oracle.truffle.api.interop.UnsupportedTypeException, com.oracle.truffle.api.interop.UnsupportedMessageException
      Call a native function with this signature.
      Throws:
      com.oracle.truffle.api.interop.ArityException
      com.oracle.truffle.api.interop.UnsupportedTypeException
      com.oracle.truffle.api.interop.UnsupportedMessageException
    • createClosure

      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(java.lang.Object, java.lang.Object...) 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.