use of org.graalvm.compiler.truffle.common.hotspot.libgraal.TruffleFromLibGraal in project graal by oracle.
the class TruffleFromLibGraalEntryPoints method onCodeInstallation.
@TruffleFromLibGraal(OnCodeInstallation)
static void onCodeInstallation(Object truffleRuntime, Object compilable, long installedCodeHandle) {
InstalledCode installedCode = LibGraal.unhand(InstalledCode.class, installedCodeHandle);
((HotSpotTruffleCompilerRuntime) truffleRuntime).onCodeInstallation((CompilableTruffleAST) compilable, installedCode);
}
use of org.graalvm.compiler.truffle.common.hotspot.libgraal.TruffleFromLibGraal 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.compiler.truffle.common.hotspot.libgraal.TruffleFromLibGraal 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.compiler.truffle.common.hotspot.libgraal.TruffleFromLibGraal in project graal by oracle.
the class HSTruffleCallNode method getCurrentCallTarget.
@TruffleFromLibGraal(GetCurrentCallTarget)
@Override
public CompilableTruffleAST getCurrentCallTarget() {
JNIMethodScope scope = JNIMethodScope.scope();
JObject hsCompilable = callGetCurrentCallTarget(scope.getEnv(), getHandle());
if (hsCompilable.isNull()) {
return null;
} else {
return new HSCompilableTruffleAST(scope, hsCompilable);
}
}
use of org.graalvm.compiler.truffle.common.hotspot.libgraal.TruffleFromLibGraal 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());
}
}
Aggregations