[lworld] RFR: 8354529: [lworld] Add tests for flat arrays in CDS archive
Ioi Lam
iklam at openjdk.org
Wed Feb 11 18:23:17 UTC 2026
On Wed, 11 Feb 2026 17:03:35 GMT, Matias Saavedra Silva <matsaave at openjdk.org> 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.
You can combine the two "app" classes into one:
class ArchivedData {
public:
Integer[] array1;
CharPair[] array2;
}
}
...
ArchivedData archivedObjects;
...
archivedObjects = new ArchivedData();
archivedObjects.array1 = ...
archivedObjects.array2 = ...
test/hotspot/jtreg/runtime/cds/appcds/cacheObject/ArchivedFlatArrayApp.java line 31:
> 29: static {
> 30: if (archivedObjects == null) {
> 31: System.out.println("Not archived");
Indentation is needed from line 30
-------------
Changes requested by iklam (Committer).
PR Review: https://git.openjdk.org/valhalla/pull/2081#pullrequestreview-3786470843
PR Review Comment: https://git.openjdk.org/valhalla/pull/2081#discussion_r2794767713
More information about the valhalla-dev
mailing list