< prev index next >

src/share/vm/ci/ciEnv.cpp

Print this page




 780     Symbol* sig_sym  = cpool->signature_ref_at(index);
 781 
 782     if (cpool->has_preresolution()
 783         || ((holder == ciEnv::MethodHandle_klass() || holder == ciEnv::VarHandle_klass()) &&
 784             MethodHandles::is_signature_polymorphic_name(holder->get_Klass(), name_sym))) {
 785       // Short-circuit lookups for JSR 292-related call sites.
 786       // That is, do not rely only on name-based lookups, because they may fail
 787       // if the names are not resolvable in the boot class loader (7056328).
 788       switch (bc) {
 789       case Bytecodes::_invokevirtual:
 790       case Bytecodes::_invokeinterface:
 791       case Bytecodes::_invokespecial:
 792       case Bytecodes::_invokestatic:
 793         {
 794           Method* m = ConstantPool::method_at_if_loaded(cpool, index);
 795           if (m != NULL) {
 796             return get_method(m);
 797           }
 798         }
 799         break;


 800       }
 801     }
 802 
 803     if (holder_is_accessible) {  // Our declared holder is loaded.
 804       constantTag tag = cpool->tag_ref_at(index);
 805       assert(accessor->get_instanceKlass() == cpool->pool_holder(), "not the pool holder?");
 806       Method* m = lookup_method(accessor, holder, name_sym, sig_sym, bc, tag);
 807       if (m != NULL &&
 808           (bc == Bytecodes::_invokestatic
 809            ?  m->method_holder()->is_not_initialized()
 810            : !m->method_holder()->is_loaded())) {
 811         m = NULL;
 812       }
 813 #ifdef ASSERT
 814       if (m != NULL && ReplayCompiles && !ciReplay::is_loaded(m)) {
 815         m = NULL;
 816       }
 817 #endif
 818       if (m != NULL) {
 819         // We found the method.




 780     Symbol* sig_sym  = cpool->signature_ref_at(index);
 781 
 782     if (cpool->has_preresolution()
 783         || ((holder == ciEnv::MethodHandle_klass() || holder == ciEnv::VarHandle_klass()) &&
 784             MethodHandles::is_signature_polymorphic_name(holder->get_Klass(), name_sym))) {
 785       // Short-circuit lookups for JSR 292-related call sites.
 786       // That is, do not rely only on name-based lookups, because they may fail
 787       // if the names are not resolvable in the boot class loader (7056328).
 788       switch (bc) {
 789       case Bytecodes::_invokevirtual:
 790       case Bytecodes::_invokeinterface:
 791       case Bytecodes::_invokespecial:
 792       case Bytecodes::_invokestatic:
 793         {
 794           Method* m = ConstantPool::method_at_if_loaded(cpool, index);
 795           if (m != NULL) {
 796             return get_method(m);
 797           }
 798         }
 799         break;
 800       default:
 801         break;
 802       }
 803     }
 804 
 805     if (holder_is_accessible) {  // Our declared holder is loaded.
 806       constantTag tag = cpool->tag_ref_at(index);
 807       assert(accessor->get_instanceKlass() == cpool->pool_holder(), "not the pool holder?");
 808       Method* m = lookup_method(accessor, holder, name_sym, sig_sym, bc, tag);
 809       if (m != NULL &&
 810           (bc == Bytecodes::_invokestatic
 811            ?  m->method_holder()->is_not_initialized()
 812            : !m->method_holder()->is_loaded())) {
 813         m = NULL;
 814       }
 815 #ifdef ASSERT
 816       if (m != NULL && ReplayCompiles && !ciReplay::is_loaded(m)) {
 817         m = NULL;
 818       }
 819 #endif
 820       if (m != NULL) {
 821         // We found the method.


< prev index next >