Search in sources :

Example 1 with ClientHandle

use of com.oracle.svm.graal.isolated.ClientHandle in project graal by oracle.

the class IsolatedTruffleRuntimeSupport method isSuppressedFailure0.

@CEntryPoint(include = CEntryPoint.NotIncludedAutomatically.class)
@CEntryPointOptions(publishAs = CEntryPointOptions.Publish.NotPublished)
private static boolean isSuppressedFailure0(@SuppressWarnings("unused") ClientIsolateThread client, ClientHandle<SubstrateCompilableTruffleAST> ast, CompilerHandle<Supplier<String>> serializedExceptionHandle) {
    Supplier<String> serializedException = () -> {
        ClientHandle<String> resultHandle = getReasonAndStackTrace0(IsolatedCompileClient.get().getCompiler(), serializedExceptionHandle);
        return IsolatedCompileClient.get().unhand(resultHandle);
    };
    SubstrateTruffleRuntime runtime = (SubstrateTruffleRuntime) SubstrateTruffleRuntime.getRuntime();
    return runtime.isSuppressedFailure(IsolatedCompileClient.get().unhand(ast), serializedException);
}
Also used : ClientHandle(com.oracle.svm.graal.isolated.ClientHandle) SubstrateTruffleRuntime(com.oracle.svm.truffle.api.SubstrateTruffleRuntime) CEntryPoint(org.graalvm.nativeimage.c.function.CEntryPoint) CEntryPointOptions(com.oracle.svm.core.c.function.CEntryPointOptions)

Example 2 with ClientHandle

use of com.oracle.svm.graal.isolated.ClientHandle in project graal by oracle.

the class IsolatedCompilableTruffleAST method getCallNodes0.

@CEntryPoint(include = CEntryPoint.NotIncludedAutomatically.class)
@CEntryPointOptions(publishAs = CEntryPointOptions.Publish.NotPublished)
private static CompilerHandle<IsolatedTruffleCallNode[]> getCallNodes0(@SuppressWarnings("unused") ClientIsolateThread client, ClientHandle<SubstrateCompilableTruffleAST> compilableHandle) {
    SubstrateCompilableTruffleAST compilable = IsolatedCompileClient.get().unhand(compilableHandle);
    TruffleCallNode[] nodes = compilable.getCallNodes();
    ClientHandle<?>[] nodeHandles = new ClientHandle<?>[nodes.length];
    for (int i = 0; i < nodes.length; i++) {
        nodeHandles[i] = IsolatedCompileClient.get().hand(nodes[i]);
    }
    try (PinnedObject pinnedNodeHandles = PinnedObject.create(nodeHandles)) {
        return getCallNodes1(IsolatedCompileClient.get().getCompiler(), pinnedNodeHandles.addressOfArrayElement(0), nodeHandles.length);
    }
}
Also used : SubstrateCompilableTruffleAST(com.oracle.svm.truffle.api.SubstrateCompilableTruffleAST) TruffleCallNode(org.graalvm.compiler.truffle.common.TruffleCallNode) PinnedObject(org.graalvm.nativeimage.PinnedObject) ClientHandle(com.oracle.svm.graal.isolated.ClientHandle) CEntryPoint(org.graalvm.nativeimage.c.function.CEntryPoint) CEntryPoint(org.graalvm.nativeimage.c.function.CEntryPoint) CEntryPointOptions(com.oracle.svm.core.c.function.CEntryPointOptions)

Aggregations

CEntryPointOptions (com.oracle.svm.core.c.function.CEntryPointOptions)2 ClientHandle (com.oracle.svm.graal.isolated.ClientHandle)2 CEntryPoint (org.graalvm.nativeimage.c.function.CEntryPoint)2 SubstrateCompilableTruffleAST (com.oracle.svm.truffle.api.SubstrateCompilableTruffleAST)1 SubstrateTruffleRuntime (com.oracle.svm.truffle.api.SubstrateTruffleRuntime)1 TruffleCallNode (org.graalvm.compiler.truffle.common.TruffleCallNode)1 PinnedObject (org.graalvm.nativeimage.PinnedObject)1