[lworld] RFR: 8343420: [lworld] compiler/gcbarriers/TestG1BarrierGeneration.java after merging JDK-8334060 in jdk-24+18
Tobias Hartmann
thartmann at openjdk.org
Tue May 20 08:18:04 UTC 2025
On Mon, 19 May 2025 11:00:19 GMT, Damon Fenacci <dfenacci 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.
-------------
Marked as reviewed by thartmann (Committer).
PR Review: https://git.openjdk.org/valhalla/pull/1462#pullrequestreview-2853159616
More information about the valhalla-dev
mailing list