[lworld] RFR: 8364191: [lworld] Accesses to atomic flat fields prevent scalar replacement [v2]

Tobias Hartmann thartmann at openjdk.org
Sat Oct 18 19:31:22 UTC 2025


On Thu, 16 Oct 2025 02:54:36 GMT, Quan Anh Mai <qamai at openjdk.org> wrote:

>> @merykitty Hi Quan-Anh, sorry for the delay, I missed this message. 
>> 
>>> I only see that being handled for G1GC with StoreLSpecialNode
>> 
>> G1 is handled specially because of late barrier expansion:
>> https://github.com/openjdk/valhalla/blob/c1774b0b6b129623f77fbb7096d332565f148677/src/hotspot/share/opto/inlinetypenode.cpp#L660-L693
>> 
>> For the other GCs, we emit the barriers already during parsing (the information is propagated via `C2ParseAccess`):
>> https://github.com/openjdk/valhalla/blob/c1774b0b6b129623f77fbb7096d332565f148677/src/hotspot/share/gc/shared/c1/modRefBarrierSetC1.cpp#L40-L53
>> and
>> https://github.com/openjdk/valhalla/blob/c1774b0b6b129623f77fbb7096d332565f148677/src/hotspot/share/gc/shared/c2/modRefBarrierSetC2.cpp#L59-L70
>> 
>> I added this with https://github.com/openjdk/valhalla/pull/1318 and as mentioned in the PR, this is a bit of a hacky first implementation. We should refactor / improve this later (tracked by [JDK-8350865](https://bugs.openjdk.org/browse/JDK-8350865)).
>> 
>> Does that help?
>> 
>> If you get a chance, could you merge this PR with latest `lworld`? We see some issues that look similar to this and would like to verify if your patch helps. Thanks!
>
> @TobiHartmann Thanks a lot for your help, I am working on this. However, I think that would mean Shenandoah is broken as I see no similar handling in `ShenandoahBarrierSetC2`?

@merykitty Yes, I think that's true. I only implemented Oracle-supported builds/configurations for now. Thank you!

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

PR Comment: https://git.openjdk.org/valhalla/pull/1518#issuecomment-3409764019


More information about the valhalla-dev mailing list