RFR: 8300148: Consider using a StoreStore barrier instead of Release barrier on ctor exit [v7]
Aleksey Shipilev
shade at openjdk.org
Thu Apr 4 17:13:11 UTC 2024
On Wed, 3 Apr 2024 19:19:39 GMT, Joshua Cao <duke at openjdk.org> wrote:
>> src/hotspot/share/opto/memnode.cpp line 3438:
>>
>>> 3436: }
>>> 3437: }
>>> 3438: } else if (opc == Op_MemBarRelease || opc == Op_MemBarStoreStore) {
>>
>> Should be protected by a feature flag?
>
> I don't think the feature flag is needed for these cases. These are optimizations to support the changes in code shape introduced by the feature, not the feature itself. If the feature flag is off, there should be no change in behavior.
Extra safety, though. We are fiddling with common path in the aggressively optimizing compiler. I think we want to have the "chicken flag" that rolls back any changes from this PR, and it is provably the same code as before. For this hunk, it would be something like:
} else if (opc == (UseStoreStoreForCtor ? Op_MemBarStoreStore : Op_MemBarRelease)) {
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/18505#discussion_r1552100593
More information about the hotspot-compiler-dev
mailing list