[lworld] RFR: 8332886: [lworld] TestBasicFunctionality::test21 counts incorrectly

Quan Anh Mai qamai at openjdk.org
Thu May 15 17:24:42 UTC 2025


Hi,

The issue here is that the test counts incorrectly, the test looks like this:

        val1 = MyValue1.createWithFieldsInline(x, y);
        val2 = MyValue2.createWithFieldsInline(x, rD);
        val4 = MyValue1.createWithFieldsInline(x, y);

All of these are reference fields since they are nullable and `MyValue1` and `MyValue2` are both very large. `MyValue1` has an identity field `int[] oa`, so `val1` and `val4` cannot be commoned. As a result, there should be 4 allocations: `val1`, `val4`, `val1.v4` , and `val2`.

Please take a look and leave your reviews, thanks a lot.

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

Commit messages:
 - fix test

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

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


More information about the valhalla-dev mailing list