On Thu, 25 Jun 2026 09:43:06 GMT, Joel Sikström <[email protected]> wrote:
> Hello, > > This is (yet another) cleanup to remove redundant memory barriers after the > new ValuePayload abstraction API in the runtime. The ValuePayload API's > (including FlatValuePayload::read) does the necessary calls to order stores > of the copy before the oop is published (OrderAccess::storestore), making the > platform-specific memory barriers redundant. > > I don't have hardware access to RISCV or PPC, but looking at the runtime > implementations of OrderAccess::storestore, they achieve the same thing as > the platform-specific memory barriers that I suggest we remove in this PR. > ~~GHA will show that this compiles at least.~~ Edit: looks like > linux-cross-compile is not enabled for the lworld branch yet. > > `membar(Assembler::StoreStore | Assembler::LoadLoad);` and > `OrderAccess::storestore()` both boil down to `lwsync` on PPC. > > The C1 call to `load_flat_array` already omits the memory barrier, so we > don't need to remove it here. > > Testing: > * Oracle's tier1-3 linux-aarch64 > * GHA > > --------- > - [x] I confirm that I make this contribution in accordance with the [OpenJDK > Interim AI Policy](https://openjdk.org/legal/ai). This pull request has now been integrated. Changeset: b508893c Author: Joel Sikström <[email protected]> URL: https://git.openjdk.org/valhalla/commit/b508893ccb62ad1b9cbc3a1ed9a8251dc5738a54 Stats: 13 lines in 6 files changed: 1 ins; 11 del; 1 mod 8386889: [lworld] Redundant StoreStore membar after FlatValuePayload::read Reviewed-by: mdoerr, aboldtch, fparain ------------- PR: https://git.openjdk.org/valhalla/pull/2581
