hotspot/src/share/vm/prims/nativeLookup.cpp
address NativeLookup::lookup(methodHandle method, bool& in_base_library, TRAPS) {
{- -------------------------------------------
(1) (もし既にダイナミックリンクが終わっているなら, 以下の処理は省略)
---------------------------------------- -}
if (!method->has_native_function()) {
{- -------------------------------------------
(1) NativeLookup::lookup_base() で関数ポインタを取得する.
---------------------------------------- -}
address entry = lookup_base(method, in_base_library, CHECK_NULL);
{- -------------------------------------------
(1) methodOopDesc::set_native_function() で, 取得した関数ポインタを methodOop 内にセットする.
---------------------------------------- -}
method->set_native_function(entry,
methodOopDesc::native_bind_event_is_interesting);
{- -------------------------------------------
(1) (トレース出力)
---------------------------------------- -}
// -verbose:jni printing
if (PrintJNIResolving) {
ResourceMark rm(THREAD);
tty->print_cr("[Dynamic-linking native method %s.%s ... JNI]",
Klass::cast(method->method_holder())->external_name(),
method->name()->as_C_string());
}
}
{- -------------------------------------------
(1) リターン.
---------------------------------------- -}
return method->native_function();
}
This document is available under the GNU GENERAL PUBLIC LICENSE Version 2.