Search in sources :

Example 21 with TruffleFromLibGraal

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);
}
Also used : InstalledCode(jdk.vm.ci.code.InstalledCode) HotSpotTruffleCompilerRuntime(org.graalvm.compiler.truffle.common.hotspot.HotSpotTruffleCompilerRuntime) TruffleFromLibGraal(org.graalvm.compiler.truffle.common.hotspot.libgraal.TruffleFromLibGraal)

Example 22 with TruffleFromLibGraal

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);
}
Also used : JNIEnv(org.graalvm.jniutils.JNI.JNIEnv) TruffleFromLibGraal(org.graalvm.compiler.truffle.common.hotspot.libgraal.TruffleFromLibGraal)

Example 23 with TruffleFromLibGraal

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);
}
Also used : JObject(org.graalvm.jniutils.JNI.JObject) JNIEnv(org.graalvm.jniutils.JNI.JNIEnv) TruffleFromLibGraal(org.graalvm.compiler.truffle.common.hotspot.libgraal.TruffleFromLibGraal)

Example 24 with TruffleFromLibGraal

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);
    }
}
Also used : JNIMethodScope(org.graalvm.jniutils.JNIMethodScope) JObject(org.graalvm.jniutils.JNI.JObject) TruffleFromLibGraal(org.graalvm.compiler.truffle.common.hotspot.libgraal.TruffleFromLibGraal)

Example 25 with TruffleFromLibGraal

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());
    }
}
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)29 JNIEnv (org.graalvm.jniutils.JNI.JNIEnv)18 JObject (org.graalvm.jniutils.JNI.JObject)15 HotSpotTruffleCompilerRuntime (org.graalvm.compiler.truffle.common.hotspot.HotSpotTruffleCompilerRuntime)5 JString (org.graalvm.jniutils.JNI.JString)5 TruffleCompilerRuntime (org.graalvm.compiler.truffle.common.TruffleCompilerRuntime)4 ResolvedJavaMethod (jdk.vm.ci.meta.ResolvedJavaMethod)3 JNIMethodScope (org.graalvm.jniutils.JNIMethodScope)3 ResolvedJavaField (jdk.vm.ci.meta.ResolvedJavaField)2 ResolvedJavaType (jdk.vm.ci.meta.ResolvedJavaType)2 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 Method (java.lang.reflect.Method)1 InstalledCode (jdk.vm.ci.code.InstalledCode)1 HotSpotSpeculationLog (jdk.vm.ci.hotspot.HotSpotSpeculationLog)1 JavaConstant (jdk.vm.ci.meta.JavaConstant)1 TruffleCallNode (org.graalvm.compiler.truffle.common.TruffleCallNode)1 Id (org.graalvm.compiler.truffle.common.hotspot.libgraal.TruffleFromLibGraal.Id)1 AsJavaConstant (org.graalvm.compiler.truffle.common.hotspot.libgraal.TruffleFromLibGraal.Id.AsJavaConstant)1