RFR: 8338471: Refactor Method::get_new_method() for better NoSuchMethodError handling [v4]

Coleen Phillimore coleenp at openjdk.org
Tue Sep 17 16:19:10 UTC 2024


On Wed, 11 Sep 2024 21:02:41 GMT, Matias Saavedra Silva <matsaave at openjdk.org> wrote:

>> This patch cleans up the use of `get_new_method()` so callers don't have to worry about throwing `NoSuchMethodError`. The method is refactored to throw the error and avoid ever returning nullptr. Verified with tier1-5 tests.
>
> Matias Saavedra Silva has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Coleen suggestion

It is an improvement to not have all the callers have is_deleted() ? NSME : get_new_method(m);  I added the case for LinkResolver for JDK-JDK-8327250 and forgot deleted methods.  We really want something non-null to be returned for the callers of LinkResolver::resolved/selected_method().  This result is stored in various places like the CompiledIC, but I think the compiledIC it's stored in will be for a deoptimized nmethod since that nmethod was a victim of redefinition.

Maybe @fisk and @sspitsyn can comment on this.

I was throwing out the idea of 'fatal' error because we do want people to stop using -XX:+AllowRedefinitionToAddDeleteMethods.  If we wanted to do this, it would be a different PR.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/20874#issuecomment-2356373137


More information about the serviceability-dev mailing list