1.1 --- a/src/share/vm/runtime/thread.cpp Mon May 16 14:21:16 2011 -0700 1.2 +++ b/src/share/vm/runtime/thread.cpp Mon May 16 22:16:44 2011 -0700 1.3 @@ -2942,12 +2942,22 @@ 1.4 _queue = queue; 1.5 _counters = counters; 1.6 _buffer_blob = NULL; 1.7 + _scanned_nmethod = NULL; 1.8 1.9 #ifndef PRODUCT 1.10 _ideal_graph_printer = NULL; 1.11 #endif 1.12 } 1.13 1.14 +void CompilerThread::oops_do(OopClosure* f, CodeBlobClosure* cf) { 1.15 + JavaThread::oops_do(f, cf); 1.16 + if (_scanned_nmethod != NULL && cf != NULL) { 1.17 + // Safepoints can occur when the sweeper is scanning an nmethod so 1.18 + // process it here to make sure it isn't unloaded in the middle of 1.19 + // a scan. 1.20 + cf->do_code_blob(_scanned_nmethod); 1.21 + } 1.22 +} 1.23 1.24 // ======= Threads ======== 1.25