diff src/share/vm/runtime/thread.cpp @ 3384:f52ed367b66d

6996747: SIGSEGV in nmethod::cleanup_inline_caches / CompiledIC::verify Reviewed-by: kvn, iveresov
author never
date Mon, 16 May 2011 22:16:44 -0700
parents 2e038ad0c1d0
children a80577f854f9
line wrap: on
line diff
--- a/src/share/vm/runtime/thread.cpp	Mon May 16 14:21:16 2011 -0700
+++ b/src/share/vm/runtime/thread.cpp	Mon May 16 22:16:44 2011 -0700
@@ -2942,12 +2942,22 @@
   _queue = queue;
   _counters = counters;
   _buffer_blob = NULL;
+  _scanned_nmethod = NULL;
 
 #ifndef PRODUCT
   _ideal_graph_printer = NULL;
 #endif
 }
 
+void CompilerThread::oops_do(OopClosure* f, CodeBlobClosure* cf) {
+  JavaThread::oops_do(f, cf);
+  if (_scanned_nmethod != NULL && cf != NULL) {
+    // Safepoints can occur when the sweeper is scanning an nmethod so
+    // process it here to make sure it isn't unloaded in the middle of
+    // a scan.
+    cf->do_code_blob(_scanned_nmethod);
+  }
+}
 
 // ======= Threads ========