RFR: 8332959: C2: ZGC fails with 'Incorrect load shift' when invoking Object.clone() reflectively on an array

Roberto Castañeda Lozano rcastanedalo at openjdk.org
Fri May 31 04:47:14 UTC 2024


This changeset enforces cloned arrays to be initialized at allocation time when their type is unknown, as expected by ZGC in this scenario (see the [JBS issue](https://bugs.openjdk.org/projects/JDK/issues/JDK-8332959) for further details). Array clones with unknown type may arise from compiling the array-guarded branch of a reflective `Object.clone()` invocation, as illustrated by the included test.

#### Testing
- tier1-5, stress test (windows-x64, linux-x64, linux-aarch64, macosx-x64, macosx-aarch64; release and debug mode).
- tier6-7 (windows-x64, linux-x64, linux-aarch64, macosx-x64, macosx-aarch64; release and debug mode; ZGC tests only).

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

Commit messages:
 - Disable ReduceBulkZeroing for array clones where the source type is unknown
 - Add regression test

Changes: https://git.openjdk.org/jdk/pull/19486/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=19486&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8332959
  Stats: 41 lines in 2 files changed: 37 ins; 0 del; 4 mod
  Patch: https://git.openjdk.org/jdk/pull/19486.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/19486/head:pull/19486

PR: https://git.openjdk.org/jdk/pull/19486


More information about the hotspot-compiler-dev mailing list