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

Coleen Phillimore coleenp at openjdk.org
Mon Oct 27 19:00:50 UTC 2025


On Mon, 27 Oct 2025 17:44:48 GMT, Frederic Parain <fparain at openjdk.org> wrote:

>> This is an alternate version of the substitutability method.
>> To use it, add -Xshare:off -XX:+UseAltSubstitutabilityMethod to the command line of the Valhalla VM in preview mode.
>
> Frederic Parain has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Add comment

src/hotspot/share/classfile/fieldLayoutBuilder.cpp line 1301:

> 1299:   }
> 1300:   last_idx = last_idx == -1 ? 0 : last_idx;
> 1301:   int start = map->adr_at(last_idx)->first > offset ? 0 : last_idx;

last_idx is an optimization to try to prevent searching through the field map to find where to insert {offset,size} for the new entry.  When would it not be ascending?  super classes and inlined classes are inserted in order that they're found  in the LayoutBlocks so wouldn't the offsets be ascending?

src/hotspot/share/classfile/fieldLayoutBuilder.cpp line 1323:

> 1321: }
> 1322: 
> 1323: static int insert_map_at_offset(GrowableArray<Pair<int,int>>* nonoop_map, GrowableArray<int>* oop_map,

This copies the contents of the maps from an inline class that's flattened into this class or a super class into the map for this class.

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

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


More information about the valhalla-dev mailing list