--- old/src/share/vm/code/codeCache.cpp Thu Mar 17 20:39:55 2011 +++ new/src/share/vm/code/codeCache.cpp Thu Mar 17 20:39:54 2011 @@ -337,7 +337,6 @@ if (is_live) { // Perform cur->oops_do(f), maybe just once per nmethod. f->do_code_blob(cur); - cur->fix_oop_relocations(); } } @@ -551,6 +550,19 @@ assert(!nmethod::oops_do_marking_is_active(), "oops_do_marking_prologue must be called"); } + +void CodeCache::verify_oops() { + MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag); + VerifyOopClosure voc; + FOR_ALL_ALIVE_BLOBS(cb) { + if (cb->is_nmethod()) { + nmethod *nm = (nmethod*)cb; + nm->oops_do(&voc); + nm->verify_oop_relocations(); + } + } +} + address CodeCache::first_address() { assert_locked_or_safepoint(CodeCache_lock);