[lworld] RFR: 8374554: [lworld] Field layout assert with UseCompactObjectHeaders

Coleen Phillimore coleenp at openjdk.org
Wed Jan 7 17:31:04 UTC 2026


On Wed, 7 Jan 2026 12:44:23 GMT, Frederic Parain <fparain at openjdk.org> wrote:

> Fix an issue in the logic processing the beginning of a field layout, abstract value class with fields were processing correctly.
> 
> Add more configurations to tests in order to cover compact object headers too.
> Re-enabled some tests that were disabled, an extended them to cover compact object headers too.
> 
> Tested with Mach5 tier 1 to 3.
> 
> Thank you,
> 
> Fred

The VM code changes look good and more understandable than before.  The tests should remove the cases for +COH -CompressedKlassPointers since it's not a valid combination.  And can the test numbers be strings that look like enums, maybe taken from the test id?

test/hotspot/jtreg/runtime/valhalla/inlinetypes/field_layout/FieldAlignmentTest.java line 80:

> 78: 
> 79: /*
> 80:  * @test id=NoCompressedOopsNoCompressKlassPointersCompactHeader

CompactObjectHeaders only works with CompressedKlassPointers so this shouldn't be a valid combination.  Or if it doesn't give an error on invocation it should.

test/hotspot/jtreg/runtime/valhalla/inlinetypes/field_layout/FieldAlignmentTest.java line 219:

> 217:     switch(args[0]) {
> 218:       case "0": compressedOopsArg = null;
> 219:                 compressedKlassPointersArg = null;

Can you make 1-4 an enum or descriptive string?

test/hotspot/jtreg/runtime/valhalla/inlinetypes/field_layout/NullMarkersTest.java line 366:

> 364:                 compressedKlassPointersArg = "-XX:-UseCompressedClassPointers";
> 365:                 compactObjectHeaderArg = "-XX:+UseCompactObjectHeaders";
> 366:                 break;

java -XX:-UseCompressedClassPointers -XX:+UseCompactObjectHeaders -cp ~/work Hello
Java HotSpot(TM) 64-Bit Server VM warning: Temporarily processing option UseCompressedClassPointers; support is scheduled for removal in 27.0
Java HotSpot(TM) 64-Bit Server VM warning: Compact object headers require compressed class pointers. Disabling compact object headers.

This configuration doesn't give an error, it just disables COH.  So it's not useful to test.

test/hotspot/jtreg/runtime/valhalla/inlinetypes/field_layout/ValueFieldInheritanceTest.java line 237:

> 235:       case "5": compressedOopsArg = "-XX:-UseCompressedOops";
> 236:                 compressedKlassPointersArg = "-XX:-UseCompressedClassPointers";
> 237:                 compactObjectHeader = "-XX:+UseCompactObjectHeaders";

Same here.  But above it's 4 and now it's 5?

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

Changes requested by coleenp (Committer).

PR Review: https://git.openjdk.org/valhalla/pull/1862#pullrequestreview-3635937409
PR Review Comment: https://git.openjdk.org/valhalla/pull/1862#discussion_r2669346968
PR Review Comment: https://git.openjdk.org/valhalla/pull/1862#discussion_r2669357415
PR Review Comment: https://git.openjdk.org/valhalla/pull/1862#discussion_r2669378028
PR Review Comment: https://git.openjdk.org/valhalla/pull/1862#discussion_r2669381323


More information about the valhalla-dev mailing list