hotspot/src/share/vm/interpreter/linkResolver.cpp
//------------------------------------------------------------------------------------------------------------------------
// Method resolution
//
// According to JVM spec. $5.4.3c & $5.4.3d
void LinkResolver::lookup_method_in_klasses(methodHandle& result, KlassHandle klass, Symbol* name, Symbol* signature, TRAPS) {
{- -------------------------------------------
(1) instanceKlass::uncached_lookup_method() を呼んで, 対象メソッドを探す.
---------------------------------------- -}
methodOop result_oop = klass->uncached_lookup_method(name, signature);
{- -------------------------------------------
(1) もし解決結果が以下のどれかだった場合は,
特別な関数にリンクさせる必要があるので
(結果を引数にセットせずに) ここでリターン.
* java.lang.invoke.MethodHandle.invokeExact()
* java.lang.invoke.MethodHandle.invokeGeneric()
* java.lang.invoke.MethodHandle.invokeDynamic()
---------------------------------------- -}
if (EnableInvokeDynamic && result_oop != NULL) {
switch (result_oop->intrinsic_id()) {
case vmIntrinsics::_invokeExact:
case vmIntrinsics::_invokeGeneric:
case vmIntrinsics::_invokeDynamic:
// Do not link directly to these. The VM must produce a synthetic one using lookup_implicit_method.
return;
}
}
{- -------------------------------------------
(1) 結果を handle 化し, result 引数で指定された箇所にセット
---------------------------------------- -}
result = methodHandle(THREAD, result_oop);
}
This document is available under the GNU GENERAL PUBLIC LICENSE Version 2.