On Wed, 11 Feb 2026 22:16:02 GMT, Matias Saavedra Silva <[email protected]>
wrote:
>> With CDS and AOT now fully supported in lworld, we need better test coverage
>> to ensure that flat arrays are archived correctly. This patch adds a test to
>> check that an array of both a migrate value class and a flattenable user
>> defined value class can be archived and restored correctly in a static CDS
>> dump.
>>
>> During the process it was discovered that the object subgraph was
>> overlooking the element class of flat arrays, so proper handling was added
>> courtesy of @iklam.
>>
>> Verified with tier 1-5 tests.
>
> Matias Saavedra Silva has updated the pull request incrementally with one
> additional commit since the last revision:
>
> ioi comment and additional testing
Thanks for doing this. I've left a comment, if you think it is valid this is
also something that can be addressed in a future RFE.
test/hotspot/jtreg/runtime/cds/appcds/cacheObject/ArchivedFlatArrayApp.java
line 34:
> 32: public static class ArchivedData {
> 33: Integer[] intArray;
> 34: CharPair[] charPairArray;
>From a high-level perspective, would it be valuable to additionally also test
>the following?
1. Null-free layouts, doesn't necessarily have to be 8 byte payloads, I think
re-using `CharPair` and parameterizing the below test should be fine.
2. Scenarios where we flatten during archival but not at runtime or vice-versa
(controlled by our flattening flag). I'm not sure if this would even work, but
it feels like it'd be a good sanity test.
-------------
PR Review:
https://git.openjdk.org/valhalla/pull/2081#pullrequestreview-3790001081
PR Review Comment:
https://git.openjdk.org/valhalla/pull/2081#discussion_r2797969322