Search in sources :

Example 16 with HotSpotResolvedJavaMethod

use of jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod 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

HotSpotResolvedJavaMethod (jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod)16 HotSpotCompilationRequest (jdk.vm.ci.hotspot.HotSpotCompilationRequest)6 HotSpotResolvedObjectType (jdk.vm.ci.hotspot.HotSpotResolvedObjectType)4 CompilationTask (org.graalvm.compiler.hotspot.CompilationTask)4 HotSpotDirectCallTargetNode (org.graalvm.compiler.hotspot.nodes.HotSpotDirectCallTargetNode)4 HotSpotJVMCIRuntimeProvider (jdk.vm.ci.hotspot.HotSpotJVMCIRuntimeProvider)3 ResolvedJavaMethod (jdk.vm.ci.meta.ResolvedJavaMethod)3 InvokeKind (org.graalvm.compiler.nodes.CallTargetNode.InvokeKind)3 OptionValues (org.graalvm.compiler.options.OptionValues)3 Reference (java.lang.ref.Reference)2 WeakReference (java.lang.ref.WeakReference)2 HotSpotResolvedJavaType (jdk.vm.ci.hotspot.HotSpotResolvedJavaType)2 ResolvedJavaType (jdk.vm.ci.meta.ResolvedJavaType)2 HotSpotGraalCompiler (org.graalvm.compiler.hotspot.HotSpotGraalCompiler)2 FloatingReadNode (org.graalvm.compiler.nodes.memory.FloatingReadNode)2 ReadNode (org.graalvm.compiler.nodes.memory.ReadNode)2 File (java.io.File)1 Method (java.lang.reflect.Method)1 URLClassLoader (java.net.URLClassLoader)1 ByteBuffer (java.nio.ByteBuffer)1