947 JvmtiHideSingleStepping jhss(thread); 948 LinkResolver::resolve_invoke(info, receiver, pool, 949 get_index_u2_cpcache(thread, bytecode), bytecode, 950 CHECK); 951 if (JvmtiExport::can_hotswap_or_post_breakpoint()) { 952 int retry_count = 0; 953 while (info.resolved_method()->is_old()) { 954 // It is very unlikely that method is redefined more than 100 times 955 // in the middle of resolve. If it is looping here more than 100 times 956 // means then there could be a bug here. 957 guarantee((retry_count++ < 100), 958 "Could not resolve to latest version of redefined method"); 959 // method is redefined in the middle of resolve so re-try. 960 LinkResolver::resolve_invoke(info, receiver, pool, 961 get_index_u2_cpcache(thread, bytecode), bytecode, 962 CHECK); 963 } 964 } 965 } // end JvmtiHideSingleStepping 966 967 // check if link resolution caused cpCache to be updated 968 ConstantPoolCacheEntry* cp_cache_entry = cache_entry(thread); 969 if (cp_cache_entry->is_resolved(bytecode)) return; 970 971 #ifdef ASSERT 972 if (bytecode == Bytecodes::_invokeinterface) { 973 if (info.resolved_method()->method_holder() == 974 SystemDictionary::Object_klass()) { 975 // NOTE: THIS IS A FIX FOR A CORNER CASE in the JVM spec 976 // (see also CallInfo::set_interface for details) 977 assert(info.call_kind() == CallInfo::vtable_call || 978 info.call_kind() == CallInfo::direct_call, ""); 979 methodHandle rm = info.resolved_method(); 980 assert(rm->is_final() || info.has_vtable_index(), 981 "should have been set already"); 982 } else if (!info.resolved_method()->has_itable_index()) { 983 // Resolved something like CharSequence.toString. Use vtable not itable. 984 assert(info.call_kind() != CallInfo::itable_call, ""); 985 } else { 986 // Setup itable entry | 947 JvmtiHideSingleStepping jhss(thread); 948 LinkResolver::resolve_invoke(info, receiver, pool, 949 get_index_u2_cpcache(thread, bytecode), bytecode, 950 CHECK); 951 if (JvmtiExport::can_hotswap_or_post_breakpoint()) { 952 int retry_count = 0; 953 while (info.resolved_method()->is_old()) { 954 // It is very unlikely that method is redefined more than 100 times 955 // in the middle of resolve. If it is looping here more than 100 times 956 // means then there could be a bug here. 957 guarantee((retry_count++ < 100), 958 "Could not resolve to latest version of redefined method"); 959 // method is redefined in the middle of resolve so re-try. 960 LinkResolver::resolve_invoke(info, receiver, pool, 961 get_index_u2_cpcache(thread, bytecode), bytecode, 962 CHECK); 963 } 964 } 965 } // end JvmtiHideSingleStepping 966 967 assert(!(bytecode == Bytecodes::_invokedirect && info.call_kind() != CallInfo::direct_call), 968 "the target of a invokedirect bytecode must be a direct call"); 969 970 // check if link resolution caused cpCache to be updated 971 ConstantPoolCacheEntry* cp_cache_entry = cache_entry(thread); 972 if (cp_cache_entry->is_resolved(bytecode)) return; 973 974 #ifdef ASSERT 975 if (bytecode == Bytecodes::_invokeinterface) { 976 if (info.resolved_method()->method_holder() == 977 SystemDictionary::Object_klass()) { 978 // NOTE: THIS IS A FIX FOR A CORNER CASE in the JVM spec 979 // (see also CallInfo::set_interface for details) 980 assert(info.call_kind() == CallInfo::vtable_call || 981 info.call_kind() == CallInfo::direct_call, ""); 982 methodHandle rm = info.resolved_method(); 983 assert(rm->is_final() || info.has_vtable_index(), 984 "should have been set already"); 985 } else if (!info.resolved_method()->has_itable_index()) { 986 // Resolved something like CharSequence.toString. Use vtable not itable. 987 assert(info.call_kind() != CallInfo::itable_call, ""); 988 } else { 989 // Setup itable entry |