RFR: 8333791: Fix memory barriers for @Stable fields [v3]
Quan Anh Mai
qamai at openjdk.org
Fri Aug 16 04:50:58 UTC 2024
On Fri, 16 Aug 2024 04:38:44 GMT, Chen Liang <liach at openjdk.org> wrote:
>> src/hotspot/share/c1/c1_GraphBuilder.cpp line 1752:
>>
>>> 1750: scope()->set_wrote_final();
>>> 1751: }
>>> 1752: if (field->is_stable()) {
>>
>> What if the `field` is a field of another object, not the one in construction? For final fields the verifier ensures that we only write to it in the containing object constructor, but for final fields it is not guaranteed.
>
> Isn't membar additions already checked with `is_object_initializer()` or `method()->name() == ciSymbols::object_initializer_name()`?
Yes we only emit membars at the end of constructors but we do not check if the stable fields being written are of the same objects as the ones being constructed there.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/19635#discussion_r1719296315
More information about the hotspot-dev
mailing list