On Thu, 25 Jun 2026 11:18:19 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).
>
> Joel Sikström has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   Add twi_0 + isync after read_flat_field in templateTable_ppc_64.cpp
>   
>   Co-authored-by: Martin Doerr <[email protected]>

LGTM

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

Marked as reviewed by fparain (Committer).

PR Review: 
https://git.openjdk.org/valhalla/pull/2581#pullrequestreview-4572725672

Reply via email to