6767587: missing call to make_not_entrant after deoptimizing for patching volatiles
authornever
Fri, 12 Dec 2008 19:53:25 -0800
changeset 1672 ae4d91125c2d
parent 1671 eb19833101ad
child 1673 fe654c35dfe2
6767587: missing call to make_not_entrant after deoptimizing for patching volatiles Reviewed-by: rasbold, kvn
hotspot/src/share/vm/c1/c1_Runtime1.cpp
--- a/hotspot/src/share/vm/c1/c1_Runtime1.cpp	Fri Dec 12 15:37:46 2008 -0800
+++ b/hotspot/src/share/vm/c1/c1_Runtime1.cpp	Fri Dec 12 19:53:25 2008 -0800
@@ -842,6 +842,13 @@
     if (TracePatching) {
       tty->print_cr("Deoptimizing for patching volatile field reference");
     }
+    // It's possible the nmethod was invalidated in the last
+    // safepoint, but if it's still alive then make it not_entrant.
+    nmethod* nm = CodeCache::find_nmethod(caller_frame.pc());
+    if (nm != NULL) {
+      nm->make_not_entrant();
+    }
+
     VM_DeoptimizeFrame deopt(thread, caller_frame.id());
     VMThread::execute(&deopt);