[lworld] RFR: 8329218: [lworld] Arrays.copyOf and Arrays.copyOfRange support for null-restricted arrays

Chen Liang liach at openjdk.org
Wed Apr 3 17:15:08 UTC 2024


On Wed, 3 Apr 2024 16:21:29 GMT, Mandy Chung <mchung at openjdk.org> wrote:

> `Arrays::copyOf` and `Arrays::copyOfRange` should return a null-restricted array if the input array is null-restricted.   The intrinsification for these methods will need to be updated ([JDK-8329218](https://bugs.openjdk.org/browse/JDK-8329218)).  Three test cases in `test/hotspot/jtreg/compiler/valhalla/inlinetypes/TestArrays.java` are commented out until JDK-8329218 is resolved.

Just a few questions about current state of NR arrays:
1. Does NR (inlined) array share the same class as their null-friendly (reference) counterparts? Since they have totally different layouts, they probably are distinct enough to guarantee a class split (like a value class with 3 Integer fields vs one with 3 Integer! fields), and how about their System.arraycopy behavior?
2. If they share the same class, will there be overloads of Arrays.copyOf taking `CheckedType`?

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

PR Comment: https://git.openjdk.org/valhalla/pull/1070#issuecomment-2035145542



More information about the valhalla-dev mailing list