8258412: [lworld] TestArrays::test73 fails due to unexpected result #303
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 aPreferCommandLineFlags
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 becauseelemtype
is generaljava.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
Progress
Issue
Download
$ git fetch https://git.openjdk.java.net/valhalla pull/303/head:pull/303
$ git checkout pull/303