changeset 60623:3a405f98e753

8251923: "Invalid JNI handle" assertion failure in JVMCICompiler::force_comp_at_level_simple() Reviewed-by: kvn, dnsimon
author ngasson
date Thu, 20 Aug 2020 09:32:01 +0800
parents fc8e62b399bd
children 17ec3b9a1aef
files src/hotspot/share/jvmci/jvmciRuntime.cpp
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/hotspot/share/jvmci/jvmciRuntime.cpp	Wed Aug 19 13:41:08 2020 -0700
+++ b/src/hotspot/share/jvmci/jvmciRuntime.cpp	Thu Aug 20 09:32:01 2020 +0800
@@ -893,8 +893,11 @@
 
   // 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);
 
-  _HotSpotJVMCIRuntime_instance = JVMCIENV->make_global(result);
+  OrderAccess::storestore();  // Ensure handle is fully constructed before publishing
+  _HotSpotJVMCIRuntime_instance = result;
+
   JVMCI::_is_initialized = true;
 }