RFR: 8363620: AArch64: reimplement emit_static_call_stub() [v3]
Fei Gao
fgao at openjdk.org
Fri Dec 5 15:32:34 UTC 2025
On Thu, 4 Dec 2025 11:54:31 GMT, Andrew Haley <aph at openjdk.org> wrote:
>> src/hotspot/cpu/aarch64/compiledIC_aarch64.cpp line 180:
>>
>>> 178: nativeCallTrampolineStub_at(trampoline_stub_addr)->set_destination(stub);
>>> 179: }
>>> 180:
>>
>> Suggestion:
>>
>>
>> // This code is executed while other threads are running. We must
>> // ensure that at all times there is a valid path of execution. A
>> // racing thread either observes a call (possibly via a trampoline)
>> // to SharedRuntime::resolve_static_call_C or a complete call to the
>> // interpreter.
>> //
>> // If a racing thread observes an updated direct branch at a call
>> // site, it must also observe all of the updated instructions in the
>> // static interpreter stub.
>> //
>> // To ensure this, we first update the static interpreter stub, then
>> // the trampoline, then the direct branch at the call site.
>> // ...
>
> Here's my thinking:
>
> First say what you want to achieve and why.
>
> Be definite about what you say in comments. Avoid words like "generally", for example. Always use the strongest words you can. For example, "because" is stronger than "since".
>
> Be concise. The purpose of all code is to ensure correctness, so you don't have to say so.
>
> This comment is not perfect, so feel free to amend anything that is unclear.
@theRealAph Many thanks for your feedback and your time!
I’ve updated the commit with your suggestion. I made a small adjustment on top of what you proposed—hope it’s not unnecessary.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/26638#discussion_r2593083821
More information about the hotspot-dev
mailing list