Search in sources :

Example 1 with HotSpotCompilationRequestResult

use of jdk.vm.ci.hotspot.HotSpotCompilationRequestResult in project graal by oracle.

the class GraalOSRTestBase method compile.

protected static void compile(DebugContext debug, ResolvedJavaMethod method, int bci) {
    HotSpotJVMCIRuntimeProvider runtime = HotSpotJVMCIRuntime.runtime();
    long jvmciEnv = 0L;
    HotSpotCompilationRequest request = new HotSpotCompilationRequest((HotSpotResolvedJavaMethod) method, bci, jvmciEnv);
    HotSpotGraalCompiler compiler = (HotSpotGraalCompiler) runtime.getCompiler();
    CompilationTask task = new CompilationTask(runtime, compiler, request, true, true, debug.getOptions());
    if (method instanceof HotSpotResolvedJavaMethod) {
        HotSpotGraalRuntimeProvider graalRuntime = compiler.getGraalRuntime();
        GraalHotSpotVMConfig config = graalRuntime.getVMConfig();
        if (((HotSpotResolvedJavaMethod) method).hasCodeAtLevel(bci, config.compilationLevelFullOptimization)) {
            return;
        }
    }
    HotSpotCompilationRequestResult result = task.runCompilation(debug);
    if (result.getFailure() != null) {
        throw new GraalError(result.getFailureMessage());
    }
}
Also used : HotSpotGraalCompiler(org.graalvm.compiler.hotspot.HotSpotGraalCompiler) HotSpotResolvedJavaMethod(jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod) GraalError(org.graalvm.compiler.debug.GraalError) HotSpotCompilationRequestResult(jdk.vm.ci.hotspot.HotSpotCompilationRequestResult) HotSpotGraalRuntimeProvider(org.graalvm.compiler.hotspot.HotSpotGraalRuntimeProvider) HotSpotCompilationRequest(jdk.vm.ci.hotspot.HotSpotCompilationRequest) CompilationTask(org.graalvm.compiler.hotspot.CompilationTask) GraalHotSpotVMConfig(org.graalvm.compiler.hotspot.GraalHotSpotVMConfig) HotSpotJVMCIRuntimeProvider(jdk.vm.ci.hotspot.HotSpotJVMCIRuntimeProvider)

Aggregations

HotSpotCompilationRequest (jdk.vm.ci.hotspot.HotSpotCompilationRequest)1 HotSpotCompilationRequestResult (jdk.vm.ci.hotspot.HotSpotCompilationRequestResult)1 HotSpotJVMCIRuntimeProvider (jdk.vm.ci.hotspot.HotSpotJVMCIRuntimeProvider)1 HotSpotResolvedJavaMethod (jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod)1 GraalError (org.graalvm.compiler.debug.GraalError)1 CompilationTask (org.graalvm.compiler.hotspot.CompilationTask)1 GraalHotSpotVMConfig (org.graalvm.compiler.hotspot.GraalHotSpotVMConfig)1 HotSpotGraalCompiler (org.graalvm.compiler.hotspot.HotSpotGraalCompiler)1 HotSpotGraalRuntimeProvider (org.graalvm.compiler.hotspot.HotSpotGraalRuntimeProvider)1