[lworld] RFR: 8343420: [lworld] compiler/gcbarriers/TestG1BarrierGeneration.java after merging JDK-8334060 in jdk-24+18

Damon Fenacci dfenacci at openjdk.org
Mon May 19 11:50:17 UTC 2025


`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.

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

Commit messages:
 - Merge branch 'lworld' into JDK-8343420
 - JDK-8343420: [lworld] compiler/gcbarriers/TestG1BarrierGeneration.java after merging JDK-8334060 in jdk-24+18

Changes: https://git.openjdk.org/valhalla/pull/1462/files
  Webrev: https://webrevs.openjdk.org/?repo=valhalla&pr=1462&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8343420
  Stats: 17 lines in 2 files changed: 0 ins; 1 del; 16 mod
  Patch: https://git.openjdk.org/valhalla/pull/1462.diff
  Fetch: git fetch https://git.openjdk.org/valhalla.git pull/1462/head:pull/1462

PR: https://git.openjdk.org/valhalla/pull/1462


More information about the valhalla-dev mailing list