hotspot/src/share/vm/ci/ciEnv.cpp
changeset 38719 133bf85c3f36
parent 38133 78b95467b9f1
child 40057 a0511d037cbe
equal deleted inserted replaced
38708:8c27a4f8b242 38719:133bf85c3f36
   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) {
   708   EXCEPTION_CONTEXT;
   709   EXCEPTION_CONTEXT;
   709   KlassHandle h_accessor(THREAD, accessor);
   710   KlassHandle h_accessor(THREAD, accessor);
   710   KlassHandle h_holder(THREAD, holder);
   711   KlassHandle h_holder(THREAD, holder);
   711   LinkResolver::check_klass_accessability(h_accessor, h_holder, KILL_COMPILE_ON_FATAL_(NULL));
   712   LinkResolver::check_klass_accessability(h_accessor, h_holder, KILL_COMPILE_ON_FATAL_(NULL));
   712   methodHandle dest_method;
   713   methodHandle dest_method;
   713   LinkInfo link_info(h_holder, name, sig, h_accessor, /*check_access*/true);
   714   LinkInfo link_info(h_holder, name, sig, h_accessor, LinkInfo::needs_access_check, tag);
   714   switch (bc) {
   715   switch (bc) {
   715   case Bytecodes::_invokestatic:
   716   case Bytecodes::_invokestatic:
   716     dest_method =
   717     dest_method =
   717       LinkResolver::resolve_static_call_or_null(link_info);
   718       LinkResolver::resolve_static_call_or_null(link_info);
   718     break;
   719     break;
   794       }
   795       }
   795     }
   796     }
   796 
   797 
   797     if (holder_is_accessible) {  // Our declared holder is loaded.
   798     if (holder_is_accessible) {  // Our declared holder is loaded.
   798       InstanceKlass* lookup = declared_holder->get_instanceKlass();
   799       InstanceKlass* lookup = declared_holder->get_instanceKlass();
   799       Method* m = lookup_method(accessor->get_instanceKlass(), lookup, name_sym, sig_sym, bc);
   800       constantTag tag = cpool->tag_ref_at(index);
       
   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);
   800       if (m != NULL &&
   803       if (m != NULL &&
   801           (bc == Bytecodes::_invokestatic
   804           (bc == Bytecodes::_invokestatic
   802            ?  m->method_holder()->is_not_initialized()
   805            ?  m->method_holder()->is_not_initialized()
   803            : !m->method_holder()->is_loaded())) {
   806            : !m->method_holder()->is_loaded())) {
   804         m = NULL;
   807         m = NULL;