RFR: 8363620: AArch64: reimplement emit_static_call_stub()

Andrew Haley aph at openjdk.org
Thu Aug 7 17:04:17 UTC 2025


On Thu, 7 Aug 2025 16:44:11 GMT, Fei Gao <fgao at openjdk.org> wrote:

> My question is: Why isn’t any explicit memory synchronization required before executing the trampoline stub? How do we ensure that any data loaded by the trampoline stub is fully synchronized across multiple threads?

It isn't. Other threads may call the static call resolver multiple times even after it's been patched. The difference is that for a trampoline call there is only one address to load so it can be patched atomically by a single store, and it doesn't matter if the address is stale.

We could read/write the { code; method } pair inside a critical section, thus guaranteeing that the operation is correctly synchronized. It might well be a bit faster, but it would be fiddly, especially on Apple silicon.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/26638#discussion_r2260916337


More information about the hotspot-dev mailing list