hotspot/src/share/vm/prims/jvmtiImpl.cpp
JvmtiDeferredEvent JvmtiDeferredEvent::compiled_method_unload_event(
nmethod* nm, jmethodID id, const void* code) {
{- -------------------------------------------
(1) 新しい JvmtiDeferredEvent を作成し, フィールドを初期化した後, リターンする.
(ついでに, 作成したイベントが ServiceThread によって通知されるまでの間に
処理対象の nmethod が削除されないよう,
nmethodLocker を使ってここで処理対象の nmethod のロックを取っている.)
---------------------------------------- -}
JvmtiDeferredEvent event = JvmtiDeferredEvent(TYPE_COMPILED_METHOD_UNLOAD);
event._event_data.compiled_method_unload.nm = nm;
event._event_data.compiled_method_unload.method_id = id;
event._event_data.compiled_method_unload.code_begin = code;
// Keep the nmethod alive until the ServiceThread can process
// this deferred event. This will keep the memory for the
// generated code from being reused too early. We pass
// zombie_ok == true here so that our nmethod that was just
// made into a zombie can be locked.
nmethodLocker::lock_nmethod(nm, true /* zombie_ok */);
return event;
}
This document is available under the GNU GENERAL PUBLIC LICENSE Version 2.