[lworld] RFR: 8258412: [lworld] TestArrays::test73 fails due to unexpected result

Tobias Hartmann thartmann at openjdk.java.net
Tue Dec 15 17:28:19 UTC 2020


`TestArrays::test73` spuriously failed (only) with a product build. I finally figured out that with a product build the `-XX:-MonomorphicArrayCheck` flag specified by the test is ignored which is required to trigger the problem. Instead of adding yet another scenario to our tests, I've added a `PreferCommandLineFlags` option to the framework to allow overwriting scenario flags by flags set via the command line. I'll use it for testing some more flag combinations in the CI.

The root cause of the issue is that for a flat array store the `MonomorphicArrayCheck` optimization updates the array type to the exact (flat) type but does not update the corresponding element type. As a result, `elemtype->inline_klass()->is_empty()` returns true in product leading to incorrect execution and hits an assert in debug because `elemtype` is general `java.lang.Object`.

I've also fixed another issue in `Parse::array_store_check()` and added some asserts to catch similar issues earlier in the future.

Thanks,
Tobias

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

Commit messages:
 - 8258412: [lworld] TestArrays::test73 fails due to unexpected result

Changes: https://git.openjdk.java.net/valhalla/pull/303/files
 Webrev: https://webrevs.openjdk.java.net/?repo=valhalla&pr=303&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8258412
  Stats: 80 lines in 6 files changed: 40 ins; 30 del; 10 mod
  Patch: https://git.openjdk.java.net/valhalla/pull/303.diff
  Fetch: git fetch https://git.openjdk.java.net/valhalla pull/303/head:pull/303

PR: https://git.openjdk.java.net/valhalla/pull/303


More information about the valhalla-dev mailing list