Search in sources :

Example 6 with HotSpotJVMCIRuntimeProvider

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

the class MemoryUsageBenchmark method allocSpyCompilation.

@SuppressWarnings("try")
private void allocSpyCompilation(String methodName) {
    if (AllocSpy.isEnabled()) {
        HotSpotResolvedJavaMethod method = (HotSpotResolvedJavaMethod) getResolvedJavaMethod(methodName);
        // invalidate any existing compiled code
        method.reprofile();
        long jvmciEnv = 0L;
        try (AllocSpy as = AllocSpy.open(methodName)) {
            HotSpotJVMCIRuntimeProvider runtime = HotSpotJVMCIRuntime.runtime();
            HotSpotCompilationRequest request = new HotSpotCompilationRequest(method, JVMCICompiler.INVOCATION_ENTRY_BCI, jvmciEnv);
            HotSpotGraalCompiler compiler = (HotSpotGraalCompiler) runtime.getCompiler();
            OptionValues options = getInitialOptions();
            CompilationTask task = new CompilationTask(runtime, compiler, request, true, false, options);
            task.runCompilation();
        }
    }
}
Also used : HotSpotGraalCompiler(org.graalvm.compiler.hotspot.HotSpotGraalCompiler) HotSpotResolvedJavaMethod(jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod) AllocSpy(org.graalvm.compiler.core.test.AllocSpy) OptionValues(org.graalvm.compiler.options.OptionValues) HotSpotCompilationRequest(jdk.vm.ci.hotspot.HotSpotCompilationRequest) CompilationTask(org.graalvm.compiler.hotspot.CompilationTask) HotSpotJVMCIRuntimeProvider(jdk.vm.ci.hotspot.HotSpotJVMCIRuntimeProvider)

Aggregations

HotSpotJVMCIRuntimeProvider (jdk.vm.ci.hotspot.HotSpotJVMCIRuntimeProvider)6 HotSpotCompilationRequest (jdk.vm.ci.hotspot.HotSpotCompilationRequest)3 HotSpotResolvedJavaMethod (jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod)3 CompilationTask (org.graalvm.compiler.hotspot.CompilationTask)3 HotSpotGraalCompiler (org.graalvm.compiler.hotspot.HotSpotGraalCompiler)3 OptionValues (org.graalvm.compiler.options.OptionValues)3 DefaultTruffleRuntime (com.oracle.truffle.api.impl.DefaultTruffleRuntime)1 HotSpotCompilationRequestResult (jdk.vm.ci.hotspot.HotSpotCompilationRequestResult)1 HotSpotVMConfigAccess (jdk.vm.ci.hotspot.HotSpotVMConfigAccess)1 ExceptionAction (org.graalvm.compiler.core.CompilationWrapper.ExceptionAction)1 AllocSpy (org.graalvm.compiler.core.test.AllocSpy)1 GraalCompilerTest (org.graalvm.compiler.core.test.GraalCompilerTest)1 GraalError (org.graalvm.compiler.debug.GraalError)1 GraalHotSpotVMConfig (org.graalvm.compiler.hotspot.GraalHotSpotVMConfig)1 HotSpotGraalRuntimeProvider (org.graalvm.compiler.hotspot.HotSpotGraalRuntimeProvider)1 OptionKey (org.graalvm.compiler.options.OptionKey)1 Test (org.junit.Test)1