On Tue, 12 May 2026 20:16:38 GMT, Shiv Shah <[email protected]> wrote:
>> Added OopMapsValue and OopMapsSameGroupValue, mirrors OopMaps tests using >> Integer instances to test contended oop maps with value class objects. >> >> - [x] I confirm that I make this contribution in accordance with the >> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai). > > Shiv Shah has updated the pull request incrementally with one additional > commit since the last revision: > > 8384107: Use small flattened value types and exact type declarations for > contended oop map tests > As they are currently written, these tests don't exercise interactions > between contended or oopmap code and value types. The classes with > `@Contended` annotations are using `j.l.Object` typed fields, which the VM > handles as regular reference fields, not values, for both layout decisions > and oopmap generation. > > To test interactions between `@Contended` and value fields, I'd recommend > declaring a small value types, less than 56 bits, so it can be flattened (the > declared value class Point with two int fields is too big to be flattened), > and then declare contended fields using the _exact_ type of the field, not a > super type. > > To test contended/value types/oopmap interactions, I'd recommend to declare a > value type containing a reference type and a small primitive type (for > instance `value record Opt(Object o, boolean b) { }` ), and then declare > contended fields of this _exact_ type. This kind of value type would be > flattened in VMs using compressed oops, and not flattened in VMs using full > size oops, creating two distinct patterns of field layouts including oops and > contended padding. Updated using Small(int x) for flattened value fields and Opt(Object o, boolean b) for oop map interaction testing, with exact types on all @Contended fields. ------------- PR Comment: https://git.openjdk.org/valhalla/pull/2413#issuecomment-4434424334
