From b9a37e48e2e1d28d3be9d0aa4baa22dae9eb06c7 Mon Sep 17 00:00:00 2001 From: Nick Gasson Date: Thu, 20 Aug 2020 09:32:01 +0800 Subject: [PATCH] 8251923: "Invalid JNI handle" assertion failure in JVMCICompiler::force_comp_at_level_simple() Reviewed-by: kvn, dnsimon --- src/hotspot/share/jvmci/jvmciRuntime.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/hotspot/share/jvmci/jvmciRuntime.cpp b/src/hotspot/share/jvmci/jvmciRuntime.cpp index f4bda1ebd7a..27a67457d59 100644 --- a/src/hotspot/share/jvmci/jvmciRuntime.cpp +++ b/src/hotspot/share/jvmci/jvmciRuntime.cpp @@ -893,8 +893,11 @@ void JVMCIRuntime::initialize_HotSpotJVMCIRuntime(JVMCI_TRAPS) { // This should only be called in the context of the JVMCI class being initialized JVMCIObject result = JVMCIENV->call_HotSpotJVMCIRuntime_runtime(JVMCI_CHECK); + result = JVMCIENV->make_global(result); + + OrderAccess::storestore(); // Ensure handle is fully constructed before publishing + _HotSpotJVMCIRuntime_instance = result; - _HotSpotJVMCIRuntime_instance = JVMCIENV->make_global(result); JVMCI::_is_initialized = true; }