702 // name, signature, and bytecode. |
702 // name, signature, and bytecode. |
703 Method* ciEnv::lookup_method(InstanceKlass* accessor, |
703 Method* ciEnv::lookup_method(InstanceKlass* accessor, |
704 InstanceKlass* holder, |
704 InstanceKlass* holder, |
705 Symbol* name, |
705 Symbol* name, |
706 Symbol* sig, |
706 Symbol* sig, |
707 Bytecodes::Code bc, |
707 Bytecodes::Code bc) { |
708 constantTag tag) { |
|
709 EXCEPTION_CONTEXT; |
708 EXCEPTION_CONTEXT; |
710 KlassHandle h_accessor(THREAD, accessor); |
709 KlassHandle h_accessor(THREAD, accessor); |
711 KlassHandle h_holder(THREAD, holder); |
710 KlassHandle h_holder(THREAD, holder); |
712 LinkResolver::check_klass_accessability(h_accessor, h_holder, KILL_COMPILE_ON_FATAL_(NULL)); |
711 LinkResolver::check_klass_accessability(h_accessor, h_holder, KILL_COMPILE_ON_FATAL_(NULL)); |
713 methodHandle dest_method; |
712 methodHandle dest_method; |
714 LinkInfo link_info(h_holder, name, sig, h_accessor, LinkInfo::needs_access_check, tag); |
713 LinkInfo link_info(h_holder, name, sig, h_accessor, /*check_access*/true); |
715 switch (bc) { |
714 switch (bc) { |
716 case Bytecodes::_invokestatic: |
715 case Bytecodes::_invokestatic: |
717 dest_method = |
716 dest_method = |
718 LinkResolver::resolve_static_call_or_null(link_info); |
717 LinkResolver::resolve_static_call_or_null(link_info); |
719 break; |
718 break; |
795 } |
794 } |
796 } |
795 } |
797 |
796 |
798 if (holder_is_accessible) { // Our declared holder is loaded. |
797 if (holder_is_accessible) { // Our declared holder is loaded. |
799 InstanceKlass* lookup = declared_holder->get_instanceKlass(); |
798 InstanceKlass* lookup = declared_holder->get_instanceKlass(); |
800 constantTag tag = cpool->tag_ref_at(index); |
799 Method* m = lookup_method(accessor->get_instanceKlass(), lookup, name_sym, sig_sym, bc); |
801 assert(accessor->get_instanceKlass() == cpool->pool_holder(), "not the pool holder?"); |
|
802 Method* m = lookup_method(accessor->get_instanceKlass(), lookup, name_sym, sig_sym, bc, tag); |
|
803 if (m != NULL && |
800 if (m != NULL && |
804 (bc == Bytecodes::_invokestatic |
801 (bc == Bytecodes::_invokestatic |
805 ? m->method_holder()->is_not_initialized() |
802 ? m->method_holder()->is_not_initialized() |
806 : !m->method_holder()->is_loaded())) { |
803 : !m->method_holder()->is_loaded())) { |
807 m = NULL; |
804 m = NULL; |