--- old/src/share/vm/prims/jvmtiCodeBlobEvents.cpp 2013-10-10 17:08:09.504891877 +0200 +++ new/src/share/vm/prims/jvmtiCodeBlobEvents.cpp 2013-10-10 17:08:08.472891916 +0200 @@ -211,10 +211,11 @@ // created nmethod will notify normally and nmethods which are freed // can be safely skipped. MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag); - nmethod* current = CodeCache::first_nmethod(); - while (current != NULL) { + // Iterate over non-profiled and profiled nmethods + for (int code_blob_type = CodeBlobType::MethodNoProfile; code_blob_type <= CodeBlobType::MethodProfile; ++code_blob_type) { // Only notify for live nmethods - if (current->is_alive()) { + nmethod* current = (nmethod*) CodeCache::first_alive_blob(code_blob_type); + while (current != NULL) { // Lock the nmethod so it can't be freed nmethodLocker nml(current); @@ -222,8 +223,9 @@ MutexUnlockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag); current->get_and_cache_jmethod_id(); JvmtiExport::post_compiled_method_load(current); + + current = (nmethod*) CodeCache::next_alive_blob(current, code_blob_type); } - current = CodeCache::next_nmethod(current); } return JVMTI_ERROR_NONE; }