Search in sources :

Example 16 with JObject

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

the class HSTruffleCompilerListener method onGraalTierFinished.

@TruffleFromLibGraal(OnGraalTierFinished)
@Override
public void onGraalTierFinished(CompilableTruffleAST compilable, GraphInfo graph) {
    JObject hsCompilable = ((HSCompilableTruffleAST) compilable).getHandle();
    JNIEnv env = JNIMethodScope.env();
    try (LibGraalObjectHandleScope graphInfoScope = LibGraalObjectHandleScope.forObject(graph)) {
        callOnGraalTierFinished(env, getHandle(), hsCompilable, graphInfoScope.getHandle());
    }
}
Also used : JObject(org.graalvm.jniutils.JNI.JObject) JNIEnv(org.graalvm.jniutils.JNI.JNIEnv) TruffleFromLibGraal(org.graalvm.compiler.truffle.common.hotspot.libgraal.TruffleFromLibGraal)

Example 17 with JObject

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

the class HSTruffleCompilerListener method onTruffleTierFinished.

@TruffleFromLibGraal(OnTruffleTierFinished)
@Override
public void onTruffleTierFinished(CompilableTruffleAST compilable, TruffleInliningData inliningPlan, GraphInfo graph) {
    JObject hsCompilable = ((HSCompilableTruffleAST) compilable).getHandle();
    JObject hsInliningPlan = ((HSTruffleInliningData) inliningPlan).getHandle();
    JNIEnv env = JNIMethodScope.env();
    try (LibGraalObjectHandleScope graphInfoScope = LibGraalObjectHandleScope.forObject(graph)) {
        callOnTruffleTierFinished(env, getHandle(), hsCompilable, hsInliningPlan, graphInfoScope.getHandle());
    }
}
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 JObject

use of org.graalvm.jniutils.JNI.JObject 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 19 with JObject

use of org.graalvm.jniutils.JNI.JObject 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 20 with JObject

use of org.graalvm.jniutils.JNI.JObject 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

JObject (org.graalvm.jniutils.JNI.JObject)20 TruffleFromLibGraal (org.graalvm.compiler.truffle.common.hotspot.libgraal.TruffleFromLibGraal)15 JNIEnv (org.graalvm.jniutils.JNI.JNIEnv)12 JNIMethodScope (org.graalvm.jniutils.JNIMethodScope)5 JString (org.graalvm.jniutils.JNI.JString)3 TruffleToLibGraal (org.graalvm.compiler.truffle.common.hotspot.libgraal.TruffleToLibGraal)2 GetSuppliedString (org.graalvm.compiler.truffle.common.hotspot.libgraal.TruffleToLibGraal.Id.GetSuppliedString)2 HotSpotTruffleCompilerImpl (org.graalvm.compiler.truffle.compiler.hotspot.HotSpotTruffleCompilerImpl)2 HSObject (org.graalvm.jniutils.HSObject)2 JNIUtil.createHSString (org.graalvm.jniutils.JNIUtil.createHSString)2 JNIUtil.createString (org.graalvm.jniutils.JNIUtil.createString)2 CEntryPoint (org.graalvm.nativeimage.c.function.CEntryPoint)2 CompilationContext (org.graalvm.compiler.hotspot.CompilationContext)1 CompilableTruffleAST (org.graalvm.compiler.truffle.common.CompilableTruffleAST)1 TruffleCallNode (org.graalvm.compiler.truffle.common.TruffleCallNode)1 TruffleCompilationTask (org.graalvm.compiler.truffle.common.TruffleCompilationTask)1 TruffleCompilerListener (org.graalvm.compiler.truffle.common.TruffleCompilerListener)1 TruffleDebugContext (org.graalvm.compiler.truffle.common.TruffleDebugContext)1 TruffleCompilationIdentifier (org.graalvm.compiler.truffle.compiler.TruffleCompilationIdentifier)1 TruffleCompilerImpl (org.graalvm.compiler.truffle.compiler.TruffleCompilerImpl)1