RFR: 8363620: AArch64: reimplement emit_static_call_stub()
Andrew Haley
aph at openjdk.org
Tue Aug 12 13:45:20 UTC 2025
On Tue, 12 Aug 2025 13:11:44 GMT, Mikhail Ablakatov <mablakatov at openjdk.org> wrote:
> > There may still be a race in set_to_clean(), which doesn't zero out the [method, entry} fields in the stub. I'd fix that, to be safe. It'd be tricky to test.
>
> It appears that `CompiledDirectCall::set_stub_to_clean` is currently unused.
My mistake. I should have written `CompiledIC::set_to_clean()`, which is used.
I would suggest either leaving it as-is or even better removing it entirely to avoid the risk of someone using it in the future since it's not safe under all conditions.
>
> For example, consider a situation when a system thread is preempted by the OS while executing a static stub. If another thread clears that static stub before the preempted thread resumes, the first thread might execute a partially cleared sequence of `movk`/`movz` instructions.
Indeed.
In fact, it's not safe to clear the stub in any case because stubs are _shared_ between calls to the same method.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/26638#issuecomment-3179400393
More information about the hotspot-dev
mailing list