[lworld] RFR: 8313667: [lworld] XBarrierSetC2::clone_at_expansion() uses wrong array copy stub for cloning flat primitive type arrays [v2]

Christian Hagedorn chagedorn at openjdk.org
Tue Sep 5 14:40:41 UTC 2023


> The singlegen ZGC version of `XBarrierSetC2::clone_at_expansion()` uses the wrong array copy stub for flat primitive type arrays when expanding an `ArrayCopyNode` for cloning. It wrongly treats a flat array of primitive types as flat array of oop pointers. This leads to intermittent wrong executions and crashes in ZGC because we are interpreting primitive values as oops.
> 
> The fix is straight forward to special case flat arrays in `XBarrierSetC2::clone_at_expansion()` similar to what we already do in `ZBarrierSetC2::clone_at_expansion()`:
> https://github.com/openjdk/valhalla/blob/3b4cc5fdb038a7363e5ac8a704adacd70701c1ff/src/hotspot/share/gc/z/c2/zBarrierSetC2.cpp#L457-L465
> 
> Thanks,
> Christian

Christian Hagedorn has updated the pull request incrementally with one additional commit since the last revision:

  Remove braces

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

Changes:
  - all: https://git.openjdk.org/valhalla/pull/924/files
  - new: https://git.openjdk.org/valhalla/pull/924/files/acdbd737..41fa08dc

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=valhalla&pr=924&range=01
 - incr: https://webrevs.openjdk.org/?repo=valhalla&pr=924&range=00-01

  Stats: 2 lines in 2 files changed: 0 ins; 0 del; 2 mod
  Patch: https://git.openjdk.org/valhalla/pull/924.diff
  Fetch: git fetch https://git.openjdk.org/valhalla.git pull/924/head:pull/924

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



More information about the valhalla-dev mailing list