[lworld] RFR: 8370450: [lworld] Alternate implementation of the substitutability test method [v2]

Coleen Phillimore coleenp at openjdk.org
Thu Oct 23 20:29:40 UTC 2025


On Thu, 23 Oct 2025 12:12:03 GMT, Frederic Parain <fparain at openjdk.org> wrote:

>> src/java.base/share/classes/java/lang/runtime/ValueObjectMethods.java line 1417:
>> 
>>> 1415:         int size = map[i * 2 + 2];
>>> 1416:         int nlong = size / 8;
>>> 1417:         for (int j = 0; j < nlong; j++) {
>> 
>> Are we sure that for all value objects with `size >= 8`, they are always 8-byte aligned?
>
> There's a processing during the map generation that ensures this property (see last loop in FieldLayoutBuilder::generate_acmp_maps().

I hate to ask but doesn't memcmp do this, ie optimize the sizes for comparison?  Or is there a Java API that does this compare a, b for size and compare long first?

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

PR Review Comment: https://git.openjdk.org/valhalla/pull/1695#discussion_r2457012287


More information about the valhalla-dev mailing list