Search in sources :

Example 71 with InteropLibrary

use of com.oracle.truffle.api.interop.InteropLibrary in project graal by oracle.

the class InteropLibraryBaseTest method assertNoLanguage.

protected final void assertNoLanguage(Object value) {
    InteropLibrary lib = createLibrary(InteropLibrary.class, value);
    assertFalse(lib.hasLanguage(value));
    assertUnsupported(() -> lib.getLanguage(value));
}
Also used : InteropLibrary(com.oracle.truffle.api.interop.InteropLibrary)

Example 72 with InteropLibrary

use of com.oracle.truffle.api.interop.InteropLibrary in project graal by oracle.

the class InteropLibraryBaseTest method assertNoNative.

protected final void assertNoNative(Object value) {
    InteropLibrary lib = createLibrary(InteropLibrary.class, value);
    assertFalse(lib.isPointer(value));
    assertUnsupported(() -> lib.asPointer(value));
    // must not fail.
    lib.toNative(value);
}
Also used : InteropLibrary(com.oracle.truffle.api.interop.InteropLibrary)

Example 73 with InteropLibrary

use of com.oracle.truffle.api.interop.InteropLibrary in project graal by oracle.

the class InteropLibraryBaseTest method assertNoDate.

protected final void assertNoDate(Object value) {
    InteropLibrary lib = createLibrary(InteropLibrary.class, value);
    assertFalse(lib.isDate(value));
    assertUnsupported(() -> lib.asDate(value));
}
Also used : InteropLibrary(com.oracle.truffle.api.interop.InteropLibrary)

Example 74 with InteropLibrary

use of com.oracle.truffle.api.interop.InteropLibrary in project graal by oracle.

the class InteropLibraryBaseTest method assertNoBoolean.

protected final void assertNoBoolean(Object value) {
    InteropLibrary lib = createLibrary(InteropLibrary.class, value);
    assertFalse(lib.isBoolean(value));
    assertUnsupported(() -> lib.asBoolean(value));
}
Also used : InteropLibrary(com.oracle.truffle.api.interop.InteropLibrary)

Example 75 with InteropLibrary

use of com.oracle.truffle.api.interop.InteropLibrary in project graal by oracle.

the class InteropLibraryBaseTest method assertNoSourceLocation.

protected final void assertNoSourceLocation(Object value) {
    InteropLibrary lib = createLibrary(InteropLibrary.class, value);
    assertFalse(lib.hasSourceLocation(value));
    assertUnsupported(() -> lib.getSourceLocation(value));
}
Also used : InteropLibrary(com.oracle.truffle.api.interop.InteropLibrary)

Aggregations

InteropLibrary (com.oracle.truffle.api.interop.InteropLibrary)158 Test (org.junit.Test)76 TruffleObject (com.oracle.truffle.api.interop.TruffleObject)60 UnsupportedMessageException (com.oracle.truffle.api.interop.UnsupportedMessageException)51 UnknownIdentifierException (com.oracle.truffle.api.interop.UnknownIdentifierException)18 UnsupportedTypeException (com.oracle.truffle.api.interop.UnsupportedTypeException)18 ArityException (com.oracle.truffle.api.interop.ArityException)16 TruffleBoundary (com.oracle.truffle.api.CompilerDirectives.TruffleBoundary)15 WasmInstance (org.graalvm.wasm.WasmInstance)15 WebAssembly (org.graalvm.wasm.api.WebAssembly)15 VirtualFrame (com.oracle.truffle.api.frame.VirtualFrame)12 RootNode (com.oracle.truffle.api.nodes.RootNode)12 InteropException (com.oracle.truffle.api.interop.InteropException)11 InvalidArrayIndexException (com.oracle.truffle.api.interop.InvalidArrayIndexException)11 Dictionary (org.graalvm.wasm.api.Dictionary)8 SourceSection (com.oracle.truffle.api.source.SourceSection)6 CallTarget (com.oracle.truffle.api.CallTarget)5 Node (com.oracle.truffle.api.nodes.Node)5 ProxyObject (org.graalvm.polyglot.proxy.ProxyObject)5 WasmJsApiException (org.graalvm.wasm.exception.WasmJsApiException)5