Class SignatureLibrary

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

public abstract class SignatureLibrary extends com.oracle.truffle.api.library.Library
  • 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
    bind(Object signature, Object functionPointer)
    Create an executable interop object from a signature and a function pointer.
    abstract Object
    call(Object signature, Object functionPointer, Object... args)
    Interpret a pointer as function pointer with the given signature and call it.
    abstract Object
    createClosure(Object signature, Object executable)
    Create a native closure object with the given signature.
    static com.oracle.truffle.api.library.LibraryFactory<SignatureLibrary>
     
     

    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

    • SignatureLibrary

      public SignatureLibrary()
  • 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
      Interpret a pointer as function pointer with the given signature and call it.
      Throws:
      com.oracle.truffle.api.interop.ArityException
      com.oracle.truffle.api.interop.UnsupportedTypeException
      com.oracle.truffle.api.interop.UnsupportedMessageException
    • bind

      public abstract Object bind(Object signature, Object functionPointer)
      Create an executable interop object from a signature and a function pointer. Sending the InteropLibrary.execute(java.lang.Object, java.lang.Object...) message to the returned object is equivalent to calling call(java.lang.Object, java.lang.Object, java.lang.Object...).
    • createClosure

      public abstract Object createClosure(Object signature, Object executable)
      Create a native closure object with the given signature. The returned object is a function pointer that sends the InteropLibrary.execute(java.lang.Object, java.lang.Object...) message to the executable object when called.
    • getFactory

      public static com.oracle.truffle.api.library.LibraryFactory<SignatureLibrary> getFactory()
    • getUncached

      public static SignatureLibrary getUncached()