[lworld] RFR: 8334546: [lworld] C2: Calling clone() on non-allocated inline types fails with "Should have been buffered"

Christian Hagedorn chagedorn at openjdk.org
Thu Jun 27 13:35:39 UTC 2024


We are currently not handling inline types in the `clone()` instrinsic because it was not possible for a value class to implement `Cloneable`. This changed with [JDK-8332243](https://bugs.openjdk.org/browse/JDK-8332243). A value class now trivially returns the inline type because it has no identity. We need to do the same in the C2 intrinsic for `clone()` when we have an inline type (currently, we are hitting an assert later).

Thanks,
Christian

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

Commit messages:
 - 8334546: [lworld] C2: Calling clone() on non-allocated inline types fails with "Should have been buffered"

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

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


More information about the valhalla-dev mailing list