(#Under Construction)
constantPoolOopDesc::klass_at()
-> constantPoolOopDesc::klass_at_impl()
-> (1) 既に一度解決済みかどうかを確認する (= 以前の結果が Constant Pool 中に記録されているかどうか)
-> constantPoolOopDesc::slot_at()
-> CPSlot::is_oop()
(1) 確認結果に応じて分岐
* 解決済みの場合:
(この場合は Constant Pool 中の値をリターンするだけ)
-> CPSlot::get_oop()
* まだ解決されていない場合:
-> (1) クラス名に基づき klassOop を取得する
-> SystemDictionary::resolve_or_fail()
-> (See: here for details)
(1) 解決結果を Constant Pool 中にセットする
-> constantPoolOopDesc::klass_at_put()
LinkResolver::resolve_field(FieldAccessInfo& result, constantPoolHandle pool, int index, Bytecodes::Code byte, bool check_only, TRAPS)
-> LinkResolver::resolve_field(FieldAccessInfo& result, constantPoolHandle pool, int index, Bytecodes::Code byte, bool check_only, bool update_pool, TRAPS)
-> (1) 対象フィールドが属するクラスを取得する.
(クラスが constant pool 中で未解決な場合に解決処理を行うかどうかで2通り)
* 解決処理を行う場合:
-> LinkResolver::resolve_klass()
-> constantPoolOopDesc::klass_ref_at()
-> constantPoolOopDesc::klass_ref_index_at()
-> constantPoolOopDesc::impl_klass_ref_index_at()
-> constantPoolOopDesc::klass_at()
-> (同上)
* 解決処理を行わない場合:
-> LinkResolver::resolve_klass_no_update()
-> constantPoolOopDesc::klass_ref_at_if_loaded_check()
-> constantPoolOopDesc::klass_ref_index_at()
-> (同上)
-> constantPoolOopDesc::klass_ref_index_at()
-> CPSlot::.get_oop() or SystemDictionary::find()
(1) 対象フィールドの情報を取得する
-> instanceKlass::find_field()
-> (Java 仮想マシン仕様に従った順番で探索)
(1) 自分の中で探索
-> instanceKlass::find_local_field()
(1) インターフェースの中で探索
-> instanceKlass::find_interface_field()
-> instanceKlass::find_local_field()
-> instanceKlass::find_interface_field() (superinterface に対して再帰呼び出し)
(1) スーパークラスの中で探索
-> instanceKlass::find_field() (super に対して再帰呼び出し)
(1) アクセス権をチェックする
-> LinkResolver::check_field_accessability()
(1) ロード制約(loading constraints)をチェックする.
-> SystemDictionary::check_signature_loaders()
(1) 引数で渡された FieldAccessInfo オブジェクトに解決結果をセット
-> FieldAccessInfo::set()
LinkResolver::resolve_invoke()
-> バイトコード種別に応じたメソッドで処理を行う
* invokestatic の場合
-> LinkResolver::resolve_invokestatic()
-> (1) 対象メソッドが属するクラス(及びその他の情報)を取得する
-> LinkResolver::resolve_pool()
-> LinkResolver::resolve_klass()
-> constantPoolOopDesc::klass_ref_at()
-> constantPoolOopDesc::klass_ref_index_at()
-> constantPoolOopDesc::impl_klass_ref_index_at()
-> constantPoolOopDesc::klass_at()
-> (同上)
(1) 対象メソッドの解決処理を行う
-> LinkResolver::resolve_static_call()
-> (1) 対象メソッドの情報を取得する
-> LinkResolver::linktime_resolve_static_method()
-> LinkResolver::resolve_method(methodHandle& resolved_method, KlassHandle resolved_klass, Symbol* method_name, Symbol* method_signature, KlassHandle current_klass, bool check_access, TRAPS)
-> (1) 対象メソッドを, 自分及びスーパークラス階層の中で探索
-> LinkResolver::lookup_method_in_klasses()
-> instanceKlass::uncached_lookup_method()
-> instanceKlass::find_method(Symbol* name, Symbol* signature)
-> instanceKlass::find_method(objArrayOop methods, Symbol* name, Symbol* signature)
(1) (対象メソッドが見つからなければ) インターフェース階層の中で探索
-> LinkResolver::lookup_method_in_interfaces()
-> instanceKlass::lookup_method_in_all_interfaces()
-> Klass::lookup_method()
-> instanceKlass::uncached_lookup_method()
-> (同上)
(1) (対象メソッドが見つからなければ)
-> LinkResolver::lookup_implicit_method()
->
(1) アクセス権をチェックする
-> LinkResolver::check_method_accessability()
(1) ロード制約(loading constraints)をチェックする
-> SystemDictionary::check_signature_loaders()
(1) 引数で渡された CallInfo オブジェクトに, 解決結果をセットする
-> CallInfo::set_static()
-> CallInfo::set_common() (※)
* invokespecial の場合
-> LinkResolver::resolve_invokespecial()
-> (1) 対象メソッドが属するクラス(及びその他の情報)を取得する
-> LinkResolver::resolve_pool()
-> (同上)
(1) 対象メソッドの解決処理を行う
-> LinkResolver::resolve_special_call()
-> (1) 対象メソッドの情報を取得する
-> LinkResolver::linktime_resolve_special_method()
-> LinkResolver::resolve_method(methodHandle& resolved_method, KlassHandle resolved_klass, Symbol* method_name, Symbol* method_signature, KlassHandle current_klass, bool check_access, TRAPS)
-> (同上)
(1) 解決結果をチェックし, 問題なければ引数で渡された CallInfo オブジェクトに結果をセットする
-> LinkResolver::runtime_resolve_special_method()
-> CallInfo::set_static()
-> (同上)
* invokevirtual の場合
-> LinkResolver::resolve_invokevirtual()
-> (1) 対象メソッドが属するクラス(及びその他の情報)を取得する
-> LinkResolver::resolve_pool()
-> (同上)
(1) 対象メソッドの解決処理を行う
-> LinkResolver::resolve_virtual_call()
-> (1) 対象メソッドの情報を取得する
-> LinkResolver::linktime_resolve_virtual_method()
-> LinkResolver::resolve_method(methodHandle& resolved_method, KlassHandle resolved_klass, Symbol* method_name, Symbol* method_signature, KlassHandle current_klass, bool check_access, TRAPS)
-> (同上)
(1) 解決結果をチェックし, 問題なければ引数で渡された CallInfo オブジェクトに結果をセットする
-> LinkResolver::runtime_resolve_virtual_method()
-> CallInfo::set_virtual()
-> CallInfo::set_common()
* invokeinterface の場合
-> LinkResolver::resolve_invokeinterface()
-> (1) 対象メソッドが属するクラス(及びその他の情報)を取得する
-> LinkResolver::resolve_pool()
-> (同上)
(1) 対象メソッドの解決処理を行う
-> LinkResolver::resolve_interface_call()
-> (1) 対象メソッドの情報を取得する
-> LinkResolver::linktime_resolve_interface_method()
-> LinkResolver::resolve_interface_method(methodHandle& resolved_method, KlassHandle resolved_klass, Symbol* method_name, Symbol* method_signature, KlassHandle current_klass, bool check_access, TRAPS)
-> (1) 対象メソッドを, 自分及びスーパークラス階層の中で探索
-> LinkResolver::lookup_instance_method_in_klasses()
-> instanceKlass::uncached_lookup_method()
-> (同上)
(1) (対象メソッドが見つからなければ) インターフェース階層の中で探索
-> LinkResolver::lookup_method_in_interfaces()
-> (同上)
(1) ロード制約(loading constraints)をチェックする
-> SystemDictionary::check_signature_loaders()
(1) 解決結果をチェックし, 問題なければ引数で渡された CallInfo オブジェクトに結果をセットする
-> LinkResolver::runtime_resolve_interface_method()
-> CallInfo::set_interface()
-> CallInfo::set_common()
* invokedynamic の場合
-> LinkResolver::resolve_invokedynamic()
->
(※ -Xcomp 時には, この中で CompileBroker::compile_method() を呼んで JIT コンパイルも実行)
constantPoolOopDesc::string_at()
-> constantPoolOopDesc::string_at_impl()
-> (1) 文字列をインターンし, 対応する文字列オブジェクトを取得する
-> StringTable::intern()
(1) 解決結果を Constant Pool 中にセットする
-> constantPoolOopDesc::string_at_put()
See: here for details
See: here for details
(#Under Construction)
(#Under Construction)
(#Under Construction)
(#Under Construction) See: here for details
See: here for details
See: here for details
See: here for details
See: here for details
See: here for details
See: here for details
See: here for details
See: here for details
See: here for details
See: here for details
See: here for details
(#Under Construction)
(#Under Construction)
See: here for details
See: here for details
See: here for details
See: here for details
(#Under Construction) See: here for details
See: here for details
See: here for details
See: here for details
See: here for details
See: here for details
See: here for details
See: here for details
See: here for details
See: here for details
(#Under Construction)
(#Under Construction)
(#Under Construction)
See: here for details
See: here for details
See: here for details
See: here for details
See: here for details
See: here for details
See: here for details
See: here for details
See: here for details
(#Under Construction) See: here for details
See: here for details
See: here for details
See: here for details
See: here for details
See: here for details
(#Under Construction) See: here for details
See: here for details
See: here for details
(#Under Construction)
See: here for details
See: here for details
(#Under Construction)
(#Under Construction) See: here for details
This document is available under the GNU GENERAL PUBLIC LICENSE Version 2.