hotspot/src/share/vm/code/nmethod.cpp
// ------------------------------------------------------------------
// post_compiled_method_load_event
// new method for install_code() path
// Transfer information from compilation to jvmti
void nmethod::post_compiled_method_load_event() {
{- -------------------------------------------
(1) (変数宣言など)
---------------------------------------- -}
methodOop moop = method();
{- -------------------------------------------
(1) (DTrace のフック点)
---------------------------------------- -}
HS_DTRACE_PROBE8(hotspot, compiled__method__load,
moop->klass_name()->bytes(),
moop->klass_name()->utf8_length(),
moop->name()->bytes(),
moop->name()->utf8_length(),
moop->signature()->bytes(),
moop->signature()->utf8_length(),
insts_begin(), insts_size());
{- -------------------------------------------
(1) (JVMTI のフック点用の処理)
(CompiledMethodLoad イベントまたは CompiledMethodUnload イベントを投げる必要があれば,
(nmethod::get_and_cache_jmethod_id() を呼んで jmethod_id を記録しておく)
---------------------------------------- -}
if (JvmtiExport::should_post_compiled_method_load() ||
JvmtiExport::should_post_compiled_method_unload()) {
get_and_cache_jmethod_id();
}
{- -------------------------------------------
(1) (JVMTI のフック点用の処理)
(CompiledMethodLoad イベントを投げる必要があれば,
新しい JvmtiDeferredEvent オブジェクトを作成し
JvmtiDeferredEventQueue::enqueue() を呼んで
JvmtiDeferredEventQueue の中に登録しておく.
このイベントは, 後で ServiceThread によって通知される. (See: [here](no3718UPQ.html) for details))
---------------------------------------- -}
if (JvmtiExport::should_post_compiled_method_load()) {
// Let the Service thread (which is a real Java thread) post the event
MutexLockerEx ml(Service_lock, Mutex::_no_safepoint_check_flag);
JvmtiDeferredEventQueue::enqueue(
JvmtiDeferredEvent::compiled_method_load_event(this));
}
}
This document is available under the GNU GENERAL PUBLIC LICENSE Version 2.