use of org.graalvm.jniutils.JNI.JNIEnv in project graal by oracle.
the class HSTruffleCompilerRuntime method log.
@TruffleFromLibGraal(Log)
@Override
public void log(String loggerId, CompilableTruffleAST compilable, String message) {
JNIEnv env = env();
JString jniLoggerId = JNIUtil.createHSString(env, loggerId);
JString jniMessage = JNIUtil.createHSString(env, message);
callLog(env, getHandle(), jniLoggerId, ((HSCompilableTruffleAST) compilable).getHandle(), jniMessage);
}
use of org.graalvm.jniutils.JNI.JNIEnv in project graal by oracle.
the class HSTruffleCompilerRuntime method getCallTargetForCallNode.
@TruffleFromLibGraal(GetCallTargetForCallNode)
@Override
public JavaConstant getCallTargetForCallNode(JavaConstant callNode) {
long callNodeHandle = LibGraal.translate(callNode);
JNIEnv env = env();
long callTargetHandle = callGetCallTargetForCallNode(env, getHandle(), callNodeHandle);
return LibGraal.unhand(JavaConstant.class, callTargetHandle);
}
use of org.graalvm.jniutils.JNI.JNIEnv in project graal by oracle.
the class HSTruffleCompilerRuntime method registerOptimizedAssumptionDependency.
@TruffleFromLibGraal(RegisterOptimizedAssumptionDependency)
@Override
public Consumer<OptimizedAssumptionDependency> registerOptimizedAssumptionDependency(JavaConstant optimizedAssumption) {
long optimizedAssumptionHandle = LibGraal.translate(optimizedAssumption);
JNIEnv env = env();
JObject assumptionConsumer = callRegisterOptimizedAssumptionDependency(env, getHandle(), optimizedAssumptionHandle);
return assumptionConsumer.isNull() ? null : new HSConsumer(scope(), assumptionConsumer);
}
use of org.graalvm.jniutils.JNI.JNIEnv 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());
}
}
use of org.graalvm.jniutils.JNI.JNIEnv 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());
}
}
Aggregations