RFR: 8249880 - JVMCI calling register_nmethod without CodeCache lock

Bob Vandette bob.vandette at oracle.com
Wed Jul 22 15:07:53 UTC 2020


Please review this fix which adds a CodeCache lock around registering an nmethod with
the collector.   This is causing a guarantee to fire when the nmethod sweeper runs during
a CompileTheWorld test.

BUG:
https://bugs.openjdk.java.net/browse/JDK-8249880

PATCH:

diff --git a/src/hotspot/share/jvmci/jvmciRuntime.cpp b/src/hotspot/share/jvmci/jvmciRuntime.cpp 
--- a/src/hotspot/share/jvmci/jvmciRuntime.cpp 
+++ b/src/hotspot/share/jvmci/jvmciRuntime.cpp 
@@ -668,6 +668,7 @@ 
  
   // Since we've patched some oops in the nmethod, 
   // (re)register it with the heap. 
+ MutexLocker ml(CodeCache_lock, Mutex::_no_safepoint_check_flag); 
   Universe::heap()->register_nmethod(nm); 
 } 

Bob.



More information about the hotspot-compiler-dev mailing list