RFR: 8312749: Generational ZGC: Tests crash with assert(index == 0 || is_power_of_2(index))
Roberto Castañeda Lozano
rcastanedalo at openjdk.org
Thu Aug 17 12:44:55 UTC 2023
This changeset ensures that the array copy stub underlying the intrinsic implementation of `Object.clone` only copies its (double-word aligned) payload, excluding the remaining object alignment padding words, when a non-default `ObjectAlignmentInBytes` value is used. This prevents the specialized ZGC stubs for `Object[]` array copy from processing undefined object alignment padding words as valid object pointers. For further details about the specific failure, see [initial analysis](https://bugs.openjdk.org/browse/JDK-8312749?focusedCommentId=14600658&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-14600658) by Erik Österlund and Stefan Karlsson and comments in the regression test included in this changeset.
As a side-benefit, the changeset simplifies the array size computation logic in `GraphKit::new_array()` by decoupling computation of header size and alignment padding size.
#### Testing
##### Functionality
- tier1-3 (windows-x64, linux-x64, linux-aarch64, macosx-x64, and macosx-aarch64)
- tier4-5 (windows-x64, linux-x64, linux-aarch64, macosx-x64, and macosx-aarch64; ZGC-specific tests only)
- tier6-9 (linux-x64; ZGC-specific tests only)
- tier1-3, and a few custom examples, applying [JDK-8139457](https://github.com/openjdk/jdk/pull/11044) (under review) on top of this changeset
##### Performance
Tested performance on the following set of OpenJDK micro-benchmarks, on linux-x64 (for both G1 and ZGC, using different ObjectAlignmentInBytes values):
- `openjdk.bench.java.lang.ArrayClone.byteClone`
- `openjdk.bench.java.lang.ArrayClone.intClone`
- `openjdk.bench.java.lang.ArrayFiddle.simple_clone`
- `openjdk.bench.java.lang.Clone.cloneLarge`
- `openjdk.bench.java.lang.Clone.cloneThreeDifferent`
No significant regression was observed.
-------------
Commit messages:
- Remove extra whitespace
- Revert use of UseNewCode
- Revert "TEMPORARY: add additional macro-assembly comments"
- Revert "TEMPORARY: set UseNewCode to true by default"
- Revert "TEMPORARY: print only 'oop_disjoint_arraycopy_uninit' stub code"
- Require GenZGC in the test
- Round up object size at the end of the computation
- Comment and rename for clarity
- Add a regression test
- Remove unused variable
- ... and 8 more: https://git.openjdk.org/jdk/compare/ec2f38fd...5c56a5e5
Changes: https://git.openjdk.org/jdk/pull/15288/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=15288&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8312749
Stats: 114 lines in 4 files changed: 89 ins; 9 del; 16 mod
Patch: https://git.openjdk.org/jdk/pull/15288.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/15288/head:pull/15288
PR: https://git.openjdk.org/jdk/pull/15288
More information about the hotspot-gc-dev
mailing list