RFR: 8359359: AArch64: share trampolines between static calls to the same method [v3]

Mikhail Ablakatov mablakatov at openjdk.org
Fri Aug 1 16:05:42 UTC 2025


> Modify the C2 compiler to share trampoline stubs between static calls that resolve to the same callee method. Since the relocation target for all static calls is initially set to the static call resolver stub, the call's target alone cannot be used to distinguish between different static method calls. Instead, trampoline stubs should be shared based on the actual callee.
> 
> The `SharedTrampolineTest.java` was designed to verify the sharing of trampolines among static calls. However, due to imprecise log analysis, the test currently passes even when trampolines are not shared. Additionally, comments within the test suggest ambiguity regarding whether it was intended to assess trampoline sharing for static calls or runtime calls. To address these issues and eliminate ambiguity, this patch renames and updates the existing test. Furthermore, a new test is introduced, using the existing one as a foundation, to accurately evaluate trampoline sharing for both static and runtime calls.
> 
> This has passed tier1-3 and jcstress testing on AArch64.

Mikhail Ablakatov has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains five commits:

 - Merge branch 'master'
 - Address review comments from @theRealAph and @eastig
   - use relocInfo::relocType instead of TrampolineCallKind
   - move rtype from keys to values; reduce the footprint of the patch
 - Lift the vm.opt.TieredCompilation == null requirement from the tests
 - Combine the two shared trampoline request hash tables
 - 8359359: AArch64: share trampolines between static calls to the same method
   
   Modify the C2 compiler to share trampoline stubs between static calls
   that resolve to the same callee method. Since the relocation target for
   all static calls is initially set to the static call resolver stub, the
   call's target alone cannot be used to distinguish between different
   static method calls. Instead, trampoline stubs should be shared based
   on the actual callee.
   
   The `SharedTrampolineTest.java` was designed to verify the sharing of
   trampolines among static calls. However, due to imprecise log analysis,
   the test currently passes even when trampolines are not shared.
   Additionally, comments within the test suggest ambiguity regarding
   whether it was intended to assess trampoline sharing for static calls
   or runtime calls. To address these issues and eliminate ambiguity, this
   patch renames and updates the existing test. Furthermore, a new test is
   introduced, using the existing one as a foundation, to accurately
   evaluate trampoline sharing for both static and runtime calls.

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

Changes: https://git.openjdk.org/jdk/pull/25954/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=25954&range=02
  Stats: 431 lines in 9 files changed: 311 ins; 110 del; 10 mod
  Patch: https://git.openjdk.org/jdk/pull/25954.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/25954/head:pull/25954

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


More information about the hotspot-dev mailing list