[lworld] RFR: 8343420: [lworld] compiler/gcbarriers/TestG1BarrierGeneration.java after merging JDK-8334060 in jdk-24+18
Damon Fenacci
dfenacci at openjdk.org
Thu May 22 06:43:14 UTC 2025
On Tue, 20 May 2025 08:15:25 GMT, Tobias Hartmann <thartmann at openjdk.org> wrote:
>> `TestG1BarrierGeneration.testGetAndSet*` tests fail after [JDK-8351569](https://bugs.openjdk.org/browse/JDK-8351569). These tests check that `VarHandle::getAndSet` with G1 a particular `GetAndSetP` or `GetAndSetN` node is created with a barrier before and after.
>> [JDK-8351569](https://bugs.openjdk.org/browse/JDK-8351569) refactored `Unsafe::getAndSet` (which is used by `VarHandle::getAndSet`) to take value-classes into account, which implies that checks must be introduced to see if the target and argument objects are value-classes. This is done with a new overloaded `getAndSet` method that is now called instead of the old one. This method is not intrinsified (only inlined) and doesn't result in a `GetAndSet` node. It instead relies on the `compareAndSet` method (which gets intrinsified) and results in a `CompareAndSwap` node.
>>
>> As the goal of the test is mainly to check for G1 barrier creation, the sensible fix for now seems to be to modify the `TestG1BarrierGeneration.testGetAndSet*` tests to make them check for `CompareAndSwap` instead of `GetAndSet` nodes.
>
> Thanks for investigating this Damon! The fix looks good to me.
Thanks for the review @TobiHartmann!
-------------
PR Comment: https://git.openjdk.org/valhalla/pull/1462#issuecomment-2900086773
More information about the valhalla-dev
mailing list