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 -
Method Summary
Modifier and TypeMethodDescriptionabstract ObjectCall a native function with this signature.abstract ObjectcreateClosure(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
acceptsMethods 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
-
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.ArityExceptioncom.oracle.truffle.api.interop.UnsupportedTypeExceptioncom.oracle.truffle.api.interop.UnsupportedMessageException
-
createClosure
Create a function pointer closure that calls back into an executable object. This message must return something that's compatible withNativeSimpleType.POINTER. The returned pointer should be a function pointer. Calling that function pointer sends theInteropLibrary.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.
-