--- old/src/share/vm/prims/jvmtiCodeBlobEvents.cpp 2014-06-03 09:37:23.040392969 +0200 +++ new/src/share/vm/prims/jvmtiCodeBlobEvents.cpp 2014-06-03 09:37:22.588392955 +0200 @@ -228,9 +228,10 @@ // 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) { - // Only notify for live nmethods + // Iterate over non-profiled and profiled nmethods + NMethodIterator iter; + while(iter.next()) { + nmethod* current = iter.method(); if (current->is_alive()) { // Lock the nmethod so it can't be freed nmethodLocker nml(current); @@ -240,7 +241,6 @@ current->get_and_cache_jmethod_id(); JvmtiExport::post_compiled_method_load(current); } - current = CodeCache::next_nmethod(current); } return JVMTI_ERROR_NONE; }