[lworld] RFR: 8376059: [lworld] Aarch64: StoreLSpecial with 1 oop does not save register in pre-barrier [v2]
Quan Anh Mai
qamai at openjdk.org
Mon Feb 2 17:23:39 UTC 2026
> Hi,
>
> Many thanks to @stefank for finding the issue and helping investigating it. This PR fixes a couple of issues:
>
> - `g1StoreLSpecialOneOop` does not save `mem` and `src` during the GC pre-barrier, this risks clobber these values, which may lead to crashes or memory corruption when doing the store instruction.
> - It seems that the value passed to the post-barrier should be an uncompressed oop, this requires us to decode the narrow oop instead of simply zero-extending it.
> - Relax the restriction on the `src` register to be an arbitrary register.
> - Split the rule into 2 so that we can avoid cloberring an additional register when the offset of the oop inside the payload is 0.
>
> Testing:
> - [x] tier1, linux-aarch64, with `-XX:+StressGCM -XX:InitiatingHeapOccupancyPercent=0 -Xmn10m`
> - [x] tier1-4, valhalla-comp-stress, linux-aarch64
> - [x] tier1-4, valhalla-comp-stress, linux-aarch64, with `-XX:+StressGCM -XX:InitiatingHeapOccupancyPercent=0 -Xmn10m`
>
> Please take a look and leave your reviews, thanks a lot.
Quan Anh Mai has updated the pull request incrementally with two additional commits since the last revision:
- Saving the register in the slow path instead
- recompute tmp4 instead of saving it
-------------
Changes:
- all: https://git.openjdk.org/valhalla/pull/2013/files
- new: https://git.openjdk.org/valhalla/pull/2013/files/0f61cdc6..fb475fc6
Webrevs:
- full: https://webrevs.openjdk.org/?repo=valhalla&pr=2013&range=01
- incr: https://webrevs.openjdk.org/?repo=valhalla&pr=2013&range=00-01
Stats: 3 lines in 1 file changed: 0 ins; 2 del; 1 mod
Patch: https://git.openjdk.org/valhalla/pull/2013.diff
Fetch: git fetch https://git.openjdk.org/valhalla.git pull/2013/head:pull/2013
PR: https://git.openjdk.org/valhalla/pull/2013
More information about the valhalla-dev
mailing list