< prev index next >

src/hotspot/share/prims/jvmtiCodeBlobEvents.cpp

Print this page

        

*** 201,211 **** // First collect all the code blobs. This has to be done in a // single pass over the code cache with CodeCache_lock held because // there isn't any safe way to iterate over regular CodeBlobs since // they can be freed at any point. { ! MutexLocker mu(CodeCache_lock, Mutex::_no_safepoint_check_flag); collector.collect(); } // iterate over the collected list and post an event for each blob JvmtiCodeBlobDesc* blob = collector.first(); --- 201,211 ---- // First collect all the code blobs. This has to be done in a // single pass over the code cache with CodeCache_lock held because // there isn't any safe way to iterate over regular CodeBlobs since // they can be freed at any point. { ! MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag); collector.collect(); } // iterate over the collected list and post an event for each blob JvmtiCodeBlobDesc* blob = collector.first();
*** 223,244 **** // Walk the CodeCache notifying for live nmethods. The code cache // may be changing while this is happening which is ok since newly // created nmethod will notify normally and nmethods which are freed // can be safely skipped. ! MutexLocker mu(CodeCache_lock, Mutex::_no_safepoint_check_flag); // Iterate over non-profiled and profiled nmethods NMethodIterator iter(NMethodIterator::only_alive_and_not_unloading); while(iter.next()) { nmethod* current = iter.method(); // Lock the nmethod so it can't be freed nmethodLocker nml(current); // Don't hold the lock over the notify or jmethodID creation ! MutexUnlocker mu(CodeCache_lock, Mutex::_no_safepoint_check_flag); current->get_and_cache_jmethod_id(); ! JvmtiExport::post_compiled_method_load(env, current); } return JVMTI_ERROR_NONE; } --- 223,244 ---- // Walk the CodeCache notifying for live nmethods. The code cache // may be changing while this is happening which is ok since newly // created nmethod will notify normally and nmethods which are freed // can be safely skipped. ! MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag); // Iterate over non-profiled and profiled nmethods NMethodIterator iter(NMethodIterator::only_alive_and_not_unloading); while(iter.next()) { nmethod* current = iter.method(); // Lock the nmethod so it can't be freed nmethodLocker nml(current); // Don't hold the lock over the notify or jmethodID creation ! MutexUnlockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag); current->get_and_cache_jmethod_id(); ! JvmtiExport::post_compiled_method_load(current); } return JVMTI_ERROR_NONE; }
< prev index next >