On Thu, 23 Oct 2025 12:12:03 GMT, Frederic Parain <[email protected]> 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

Reply via email to