745 if (JvmtiExport::can_hotswap_or_post_breakpoint()) { 746 int retry_count = 0; 747 while (info.resolved_method()->is_old()) { 748 // It is very unlikely that method is redefined more than 100 times 749 // in the middle of resolve. If it is looping here more than 100 times 750 // means then there could be a bug here. 751 guarantee((retry_count++ < 100), 752 "Could not resolve to latest version of redefined method"); 753 // method is redefined in the middle of resolve so re-try. 754 LinkResolver::resolve_invoke(info, receiver, pool, 755 get_index_u2_cpcache(thread, bytecode), bytecode, 756 CHECK); 757 } 758 } 759 } // end JvmtiHideSingleStepping 760 761 // check if link resolution caused cpCache to be updated 762 ConstantPoolCacheEntry* cp_cache_entry = cache_entry(thread); 763 if (cp_cache_entry->is_resolved(bytecode)) return; 764 765 if (bytecode == Bytecodes::_invokeinterface) { 766 if (log_develop_is_enabled(Trace, itables)) { 767 ResourceMark rm(thread); 768 log_develop_trace(itables)("Resolving: klass: %s to method: %s", 769 info.resolved_klass()->name()->as_C_string(), 770 info.resolved_method()->name()->as_C_string()); 771 } 772 } 773 #ifdef ASSERT 774 if (bytecode == Bytecodes::_invokeinterface) { 775 if (info.resolved_method()->method_holder() == 776 SystemDictionary::Object_klass()) { 777 // NOTE: THIS IS A FIX FOR A CORNER CASE in the JVM spec 778 // (see also CallInfo::set_interface for details) 779 assert(info.call_kind() == CallInfo::vtable_call || 780 info.call_kind() == CallInfo::direct_call, ""); 781 methodHandle rm = info.resolved_method(); 782 assert(rm->is_final() || info.has_vtable_index(), 783 "should have been set already"); 784 } else if (!info.resolved_method()->has_itable_index()) { 785 // Resolved something like CharSequence.toString. Use vtable not itable. 786 assert(info.call_kind() != CallInfo::itable_call, ""); 787 } else { 788 // Setup itable entry 789 assert(info.call_kind() == CallInfo::itable_call, ""); 790 int index = info.resolved_method()->itable_index(); 791 assert(info.itable_index() == index, ""); 792 } | 745 if (JvmtiExport::can_hotswap_or_post_breakpoint()) { 746 int retry_count = 0; 747 while (info.resolved_method()->is_old()) { 748 // It is very unlikely that method is redefined more than 100 times 749 // in the middle of resolve. If it is looping here more than 100 times 750 // means then there could be a bug here. 751 guarantee((retry_count++ < 100), 752 "Could not resolve to latest version of redefined method"); 753 // method is redefined in the middle of resolve so re-try. 754 LinkResolver::resolve_invoke(info, receiver, pool, 755 get_index_u2_cpcache(thread, bytecode), bytecode, 756 CHECK); 757 } 758 } 759 } // end JvmtiHideSingleStepping 760 761 // check if link resolution caused cpCache to be updated 762 ConstantPoolCacheEntry* cp_cache_entry = cache_entry(thread); 763 if (cp_cache_entry->is_resolved(bytecode)) return; 764 765 #ifdef ASSERT 766 if (bytecode == Bytecodes::_invokeinterface) { 767 if (info.resolved_method()->method_holder() == 768 SystemDictionary::Object_klass()) { 769 // NOTE: THIS IS A FIX FOR A CORNER CASE in the JVM spec 770 // (see also CallInfo::set_interface for details) 771 assert(info.call_kind() == CallInfo::vtable_call || 772 info.call_kind() == CallInfo::direct_call, ""); 773 methodHandle rm = info.resolved_method(); 774 assert(rm->is_final() || info.has_vtable_index(), 775 "should have been set already"); 776 } else if (!info.resolved_method()->has_itable_index()) { 777 // Resolved something like CharSequence.toString. Use vtable not itable. 778 assert(info.call_kind() != CallInfo::itable_call, ""); 779 } else { 780 // Setup itable entry 781 assert(info.call_kind() == CallInfo::itable_call, ""); 782 int index = info.resolved_method()->itable_index(); 783 assert(info.itable_index() == index, ""); 784 } |