# HG changeset patch # User coleenp # Date 1554412985 14400 # Node ID ad9fa99fa48ecf44d2fcaff8cb1bf21d291c1dcd # Parent fb25cd198a1006b4e3c3d4d4852cc26971d77103 8221992: Fix old method replacement in ResolvedMethodTable Summary: Use method get_new_method() which is used in other call sites. Reviewed-by: sspitsyn diff -r fb25cd198a10 -r ad9fa99fa48e src/hotspot/share/prims/resolvedMethodTable.cpp --- a/src/hotspot/share/prims/resolvedMethodTable.cpp Thu Apr 04 14:19:29 2019 -0700 +++ b/src/hotspot/share/prims/resolvedMethodTable.cpp Thu Apr 04 17:23:05 2019 -0400 @@ -126,17 +126,14 @@ Method* method = m(); // Check if method has been redefined while taking out ResolvedMethodTable_lock, if so - // use new method. The old method won't be deallocated because it's passed in as a Handle. + // use new method in the ResolvedMethodName. The old method won't be deallocated + // yet because it's passed in as a Handle. if (method->is_old()) { - // Replace method with redefined version - InstanceKlass* holder = method->method_holder(); - method = holder->method_with_idnum(method->method_idnum()); - if (method == NULL) { - // Replace deleted method with NSME. - method = Universe::throw_no_such_method_error(); - } + method = (method->is_deleted()) ? Universe::throw_no_such_method_error() : + method->get_new_method(); java_lang_invoke_ResolvedMethodName::set_vmtarget(resolved_method_name(), method); } + // Set flag in class to indicate this InstanceKlass has entries in the table // to avoid walking table during redefinition if none of the redefined classes // have any membernames in the table.