Search in sources :

Example 16 with JNIEnv

use of org.graalvm.jniutils.JNI.JNIEnv in project graal by oracle.

the class HSTruffleCompilerListener method onFailure.

@TruffleFromLibGraal(OnFailure)
@Override
public void onFailure(CompilableTruffleAST compilable, String serializedException, boolean bailout, boolean permanentBailout, int tier) {
    JObject hsCompilable = ((HSCompilableTruffleAST) compilable).getHandle();
    JNIEnv env = JNIMethodScope.env();
    JString hsReason = createHSString(env, serializedException);
    callOnFailure(env, getHandle(), hsCompilable, hsReason, bailout, permanentBailout, tier);
}
Also used : JObject(org.graalvm.jniutils.JNI.JObject) JNIEnv(org.graalvm.jniutils.JNI.JNIEnv) JString(org.graalvm.jniutils.JNI.JString) TruffleFromLibGraal(org.graalvm.compiler.truffle.common.hotspot.libgraal.TruffleFromLibGraal)

Example 17 with JNIEnv

use of org.graalvm.jniutils.JNI.JNIEnv in project graal by oracle.

the class HSTruffleInliningData method findCallNode.

@TruffleFromLibGraal(FindCallNode)
@Override
public TruffleCallNode findCallNode(JavaConstant callNode) {
    long nodeHandle = LibGraal.translate(callNode);
    JNIEnv env = scope.getEnv();
    JObject res = callFindCallNode(env, getHandle(), nodeHandle);
    if (res.isNull()) {
        return null;
    }
    return new HSTruffleCallNode(scope, res);
}
Also used : JObject(org.graalvm.jniutils.JNI.JObject) JNIEnv(org.graalvm.jniutils.JNI.JNIEnv) TruffleFromLibGraal(org.graalvm.compiler.truffle.common.hotspot.libgraal.TruffleFromLibGraal)

Example 18 with JNIEnv

use of org.graalvm.jniutils.JNI.JNIEnv in project graal by oracle.

the class HSTruffleInliningData method addTargetToDequeue.

@TruffleFromLibGraal(AddTargetToDequeue)
@Override
public void addTargetToDequeue(CompilableTruffleAST target) {
    JObject hsCompilable = ((HSCompilableTruffleAST) target).getHandle();
    JNIEnv env = scope.getEnv();
    callAddTargetToDequeue(env, getHandle(), hsCompilable);
}
Also used : JObject(org.graalvm.jniutils.JNI.JObject) JNIEnv(org.graalvm.jniutils.JNI.JNIEnv) TruffleFromLibGraal(org.graalvm.compiler.truffle.common.hotspot.libgraal.TruffleFromLibGraal)

Aggregations

TruffleFromLibGraal (org.graalvm.compiler.truffle.common.hotspot.libgraal.TruffleFromLibGraal)18 JNIEnv (org.graalvm.jniutils.JNI.JNIEnv)18 JObject (org.graalvm.jniutils.JNI.JObject)12 JString (org.graalvm.jniutils.JNI.JString)5 CompilableToString (org.graalvm.compiler.truffle.common.hotspot.libgraal.TruffleFromLibGraal.Id.CompilableToString)2 HSCompilableTruffleASTGen.callCompilableToString (org.graalvm.compiler.truffle.compiler.hotspot.libgraal.HSCompilableTruffleASTGen.callCompilableToString)2 JNIUtil.createString (org.graalvm.jniutils.JNIUtil.createString)2 TruffleCallNode (org.graalvm.compiler.truffle.common.TruffleCallNode)1 TruffleCompilerImpl (org.graalvm.compiler.truffle.compiler.TruffleCompilerImpl)1 JObjectArray (org.graalvm.jniutils.JNI.JObjectArray)1 JNIMethodScope (org.graalvm.jniutils.JNIMethodScope)1