RFR: 8360654: AArch64: Remove redundant dmb from C1 compareAndSet
Andrew Haley
aph at openjdk.org
Tue Jul 15 12:39:39 UTC 2025
On Tue, 15 Jul 2025 12:20:27 GMT, Samuel Chee <duke at openjdk.org> wrote:
> Great! Glad you're convinced of its correctness.
>
> > we can remove trailing DMBs from most CASALs.
>
> Just do bear in mind that CASAL doesn't emit release semantics if the compare fails so I imagine there might be cases where a trailing dmb might still necessary.
Yes, that's what the change log in the link I posted says too. We don't care about such assumptions in Java code, but in some C++ code which assumes that CAS implies a full barrier. I don't think anyone really knows every bit of C++ code in HotSpot which does assume this, so we tend to assume the worst.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/26000#issuecomment-3073435357
More information about the hotspot-compiler-dev
mailing list