use of org.graalvm.compiler.truffle.common.hotspot.libgraal.TruffleFromLibGraal in project graal by oracle.
the class HSTruffleCompilerListener method onCompilationRetry.
@TruffleFromLibGraal(OnCompilationRetry)
@Override
public void onCompilationRetry(CompilableTruffleAST compilable, TruffleCompilationTask task) {
JObject hsCompilable = ((HSCompilableTruffleAST) compilable).getHandle();
JObject hsTask = ((HSTruffleCompilationTask) ((TruffleCompilerImpl.CancellableTruffleCompilationTask) task).getDelegate()).getHandle();
JNIEnv env = JNIMethodScope.env();
callOnCompilationRetry(env, getHandle(), hsCompilable, hsTask);
}
use of org.graalvm.compiler.truffle.common.hotspot.libgraal.TruffleFromLibGraal in project graal by oracle.
the class HSTruffleCompilerListener method onSuccess.
@TruffleFromLibGraal(OnSuccess)
@Override
public void onSuccess(CompilableTruffleAST compilable, TruffleInliningData inliningPlan, GraphInfo graphInfo, CompilationResultInfo compilationResultInfo, int tier) {
JObject hsCompilable = ((HSCompilableTruffleAST) compilable).getHandle();
JObject hsInliningPlan = ((HSTruffleInliningData) inliningPlan).getHandle();
JNIEnv env = JNIMethodScope.env();
try (LibGraalObjectHandleScope graphInfoScope = LibGraalObjectHandleScope.forObject(graphInfo);
LibGraalObjectHandleScope compilationResultInfoScope = LibGraalObjectHandleScope.forObject(compilationResultInfo)) {
callOnSuccess(env, getHandle(), hsCompilable, hsInliningPlan, graphInfoScope.getHandle(), compilationResultInfoScope.getHandle(), tier);
}
}
use of org.graalvm.compiler.truffle.common.hotspot.libgraal.TruffleFromLibGraal in project graal by oracle.
the class HSTruffleInliningData method getPosition.
@TruffleFromLibGraal(GetPosition)
@Override
public TruffleSourceLanguagePosition getPosition(JavaConstant node) {
long nodeHandle = LibGraal.translate(node);
JNIEnv env = scope.getEnv();
JObject res = callGetPosition(env, getHandle(), nodeHandle);
if (res.isNull()) {
return null;
}
return new HSTruffleSourceLanguagePosition(scope, res);
}
use of org.graalvm.compiler.truffle.common.hotspot.libgraal.TruffleFromLibGraal in project graal by oracle.
the class HSTruffleInliningData method addInlinedTarget.
@TruffleFromLibGraal(AddInlinedTarget)
@Override
public void addInlinedTarget(CompilableTruffleAST target) {
JObject hsCompilable = ((HSCompilableTruffleAST) target).getHandle();
callAddInlinedTarget(scope.getEnv(), getHandle(), hsCompilable);
}
use of org.graalvm.compiler.truffle.common.hotspot.libgraal.TruffleFromLibGraal in project graal by oracle.
the class TruffleFromLibGraalEntryPoints method getCallTargetForCallNode.
@TruffleFromLibGraal(GetCallTargetForCallNode)
static long getCallTargetForCallNode(Object truffleRuntime, long callNodeHandle) {
JavaConstant callNode = LibGraal.unhand(JavaConstant.class, callNodeHandle);
JavaConstant callTarget = ((TruffleCompilerRuntime) truffleRuntime).getCallTargetForCallNode(callNode);
return LibGraal.translate(callTarget);
}
Aggregations