RFR: 8373801: Adopt arraycopy OopCopyResult from the lworld branch [v2]

Stefan Karlsson stefank at openjdk.org
Tue Dec 16 15:04:44 UTC 2025


> In the Valhalla project there's code to restrict nulls in object arrays. In the GC arraycopy barrier we there have to both do null checks in addition to the already existing cast checks. If one of these two failed the code needs to propagate this up through the callers to the code that asked to do the checks. There it will throw the suitable exception. Previously, it was enough to say success or failed, and a boolean was enough. Now we need three states. So the bool was replaced with an OopCopyResult enum.
> 
> See: https://github.com/openjdk/valhalla/pull/1792
> 
> I propose that we bring this over to the mainline to lower the diff between lworld and the openjdk/jdk.

Stefan Karlsson has updated the pull request incrementally with one additional commit since the last revision:

  Remove throw NPE function

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/28850/files
  - new: https://git.openjdk.org/jdk/pull/28850/files/41ff47bd..25c24e3d

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

  Stats: 9 lines in 1 file changed: 0 ins; 9 del; 0 mod
  Patch: https://git.openjdk.org/jdk/pull/28850.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/28850/head:pull/28850

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


More information about the shenandoah-dev mailing list