use of org.graalvm.compiler.truffle.compiler.hotspot.HotSpotTruffleCompilerImpl in project graal by oracle.
the class TruffleToLibGraalEntryPoints method openDebugContext.
@TruffleToLibGraal(OpenDebugContext)
@CEntryPoint(name = "Java_org_graalvm_compiler_truffle_runtime_hotspot_libgraal_TruffleToLibGraalCalls_openDebugContext")
@SuppressWarnings({ "unused", "try" })
public static long openDebugContext(JNIEnv env, JClass hsClazz, @CEntryPoint.IsolateThreadContext long isolateThreadId, long compilerHandle, long compilationHandle, JByteArray hsOptions) {
try (JNIMethodScope s = LibGraalUtil.openScope(TruffleToLibGraalEntryPoints.class, OpenDebugContext, env)) {
HotSpotTruffleCompilerImpl compiler = LibGraalObjectHandles.resolve(compilerHandle, HotSpotTruffleCompilerImpl.class);
TruffleCompilation compilation = LibGraalObjectHandles.resolve(compilationHandle, TruffleCompilation.class);
Map<String, Object> options = decodeOptions(env, hsOptions);
TruffleDebugContext debugContext = compiler.openDebugContext(options, compilation);
long handle = LibGraalObjectHandles.create(debugContext);
return handle;
} catch (Throwable t) {
JNIExceptionWrapper.throwInHotSpot(env, t);
return 0;
}
}
use of org.graalvm.compiler.truffle.compiler.hotspot.HotSpotTruffleCompilerImpl in project graal by oracle.
the class TruffleToLibGraalEntryPoints method installTruffleReservedOopMethod.
@TruffleToLibGraal(Id.InstallTruffleReservedOopMethod)
@SuppressWarnings({ "unused", "try" })
@CEntryPoint(name = "Java_org_graalvm_compiler_truffle_runtime_hotspot_libgraal_TruffleToLibGraalCalls_installTruffleReservedOopMethod")
public static void installTruffleReservedOopMethod(JNIEnv env, JClass hsClazz, @CEntryPoint.IsolateThreadContext long isolateThreadId, long handle, long methodHandle) {
try (JNIMethodScope s = LibGraalUtil.openScope(TruffleToLibGraalEntryPoints.class, Id.InstallTruffleReservedOopMethod, env)) {
HotSpotTruffleCompilerImpl compiler = LibGraalObjectHandles.resolve(handle, HotSpotTruffleCompilerImpl.class);
compiler.installTruffleReservedOopMethod(LibGraal.unhand(ResolvedJavaMethod.class, methodHandle));
} catch (Throwable t) {
JNIExceptionWrapper.throwInHotSpot(env, t);
}
}
use of org.graalvm.compiler.truffle.compiler.hotspot.HotSpotTruffleCompilerImpl in project graal by oracle.
the class TruffleToLibGraalEntryPoints method openCompilation.
@TruffleToLibGraal(OpenCompilation)
@SuppressWarnings({ "unused", "try" })
@CEntryPoint(name = "Java_org_graalvm_compiler_truffle_runtime_hotspot_libgraal_TruffleToLibGraalCalls_openCompilation")
public static long openCompilation(JNIEnv env, JClass hsClazz, @CEntryPoint.IsolateThreadContext long isolateThreadId, long handle, JObject hsCompilable) {
JNIMethodScope scope = LibGraalUtil.openScope(TruffleToLibGraalEntryPoints.class, OpenCompilation, env);
try (JNIMethodScope s = scope) {
HotSpotTruffleCompilerImpl compiler = LibGraalObjectHandles.resolve(handle, HotSpotTruffleCompilerImpl.class);
CompilableTruffleAST compilable = new HSCompilableTruffleAST(env, hsCompilable);
TruffleCompilation compilation = compiler.openCompilation(compilable);
assert compilation instanceof TruffleCompilationIdentifier;
return LibGraalObjectHandles.create(compilation);
} catch (Throwable t) {
JNIExceptionWrapper.throwInHotSpot(env, t);
return 0;
}
}
use of org.graalvm.compiler.truffle.compiler.hotspot.HotSpotTruffleCompilerImpl in project graal by oracle.
the class TruffleToLibGraalEntryPoints method installTruffleCallBoundaryMethod.
@TruffleToLibGraal(InstallTruffleCallBoundaryMethod)
@SuppressWarnings({ "unused", "try" })
@CEntryPoint(name = "Java_org_graalvm_compiler_truffle_runtime_hotspot_libgraal_TruffleToLibGraalCalls_installTruffleCallBoundaryMethod")
public static void installTruffleCallBoundaryMethod(JNIEnv env, JClass hsClazz, @CEntryPoint.IsolateThreadContext long isolateThreadId, long handle, long methodHandle) {
try (JNIMethodScope s = LibGraalUtil.openScope(TruffleToLibGraalEntryPoints.class, InstallTruffleCallBoundaryMethod, env)) {
HotSpotTruffleCompilerImpl compiler = LibGraalObjectHandles.resolve(handle, HotSpotTruffleCompilerImpl.class);
compiler.installTruffleCallBoundaryMethod(LibGraal.unhand(ResolvedJavaMethod.class, methodHandle));
} catch (Throwable t) {
JNIExceptionWrapper.throwInHotSpot(env, t);
}
}
Aggregations