diff --git a/src/share/vm/runtime/sweeper.cpp b/src/share/vm/runtime/sweeper.cpp index 5d7b244728e87618f21b508eb0410c30583703d9..fc0bc6e30e650f4e316fbf19ffdc58b8647e5e69 100644 --- a/src/share/vm/runtime/sweeper.cpp +++ b/src/share/vm/runtime/sweeper.cpp @@ -26,7 +26,7 @@ # include "incls/_sweeper.cpp.incl" long NMethodSweeper::_traversals = 0; // No. of stack traversals performed -CodeBlob* NMethodSweeper::_current = NULL; // Current nmethod +nmethod* NMethodSweeper::_current = NULL; // Current nmethod int NMethodSweeper::_seen = 0 ; // No. of blobs we have currently processed in current pass of CodeCache int NMethodSweeper::_invocations = 0; // No. of invocations left until we are completed with this pass @@ -171,20 +171,16 @@ void NMethodSweeper::sweep_code_cache() { // Since we will give up the CodeCache_lock, always skip ahead to an nmethod. // Other blobs can be deleted by other threads // Read next before we potentially delete current - CodeBlob* next = CodeCache::next_nmethod(_current); + nmethod* next = CodeCache::next_nmethod(_current); // Now ready to process nmethod and give up CodeCache_lock { MutexUnlockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag); - process_nmethod((nmethod *)_current); + process_nmethod(_current); } _seen++; _current = next; } - - // Skip forward to the next nmethod (if any). Code blobs other than nmethods - // can be freed async to us and make _current invalid while we sleep. - _current = CodeCache::next_nmethod(_current); } if (_current == NULL && !_rescan && (_locked_seen || _not_entrant_seen_on_stack)) { diff --git a/src/share/vm/runtime/sweeper.hpp b/src/share/vm/runtime/sweeper.hpp index 7e7efba41f87dfda8504fa345759b6ec40677bd5..19ae03a34cc63695045df5cbcbd81404e2931b2a 100644 --- a/src/share/vm/runtime/sweeper.hpp +++ b/src/share/vm/runtime/sweeper.hpp @@ -29,7 +29,7 @@ class NMethodSweeper : public AllStatic { static long _traversals; // Stack traversal count - static CodeBlob* _current; // Current nmethod + static nmethod* _current; // Current nmethod static int _seen; // Nof. nmethod we have currently processed in current pass of CodeCache static int _invocations; // No. of invocations left until we are completed with this pass