RFR: 8314850: SharedRuntime::handle_wrong_method() gets called too often when resolving Continuation.enter

Patricio Chilano Mateo pchilanomate at openjdk.org
Wed Aug 23 14:43:40 UTC 2023


Please review the following fix. The check in SharedRuntime::reresolve_call_site() "caller.is_compiled_frame() && !caller.is_deoptimized_frame()" fails when caller is Continuation.enterSpecial because it is a native method. This means that if the static callsite to Continuation.enter was patched to point to an nmethod and then the nmethod was marked non-entrant we will always call SharedRuntime::handle_wrong_method() thereafter when resolving Continuation.enter because the callsite will never be reset back to the clean state. Thanks to @kuksenko for all the performance analysis while debugging this.
I tested the patch by running the test included in the original report (loom-dev mailing list) and verifying the issue is fixed. I also run mach5 tiers1-3 for sanity testing and will run all the upper tiers too.

Thanks,
Patricio

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

Commit messages:
 - v1

Changes: https://git.openjdk.org/jdk/pull/15403/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=15403&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8314850
  Stats: 2 lines in 1 file changed: 1 ins; 0 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/15403.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/15403/head:pull/15403

PR: https://git.openjdk.org/jdk/pull/15403


More information about the hotspot-dev mailing list