On Mon, 2 Feb 2026 09:53:04 GMT, Joel Sikström <[email protected]> wrote:

>> Hello,
>> 
>> Please refer to the JBS issue for a more detailed description of the 
>> background of this change. In summary, I suggest we only keep the array of 
>> InlineLayoutInfo for InstanceKlasses which need it, which are Klasses that 
>> have fields that have been inlined.
>> 
>> To make the transition to this easier, I suggest we change the following 
>> properties in FieldLayoutBuilder: 
>> 
>> _has_inline_type_fields
>> _has_flattening_information
>> 
>> to
>> 
>> _has_inlineable_fields
>> _has_inlined_fields
>> 
>> The `_has_inlineable_fields` property is only used for printing and 
>> `_has_inlined_fields` is the property we expose out to the ClassFileParser, 
>> telling us that this class has inlined fields, so the array of 
>> InlineLayoutInfo must be "preserved" and is possible to read from. Hence, 
>> the array is now only safe to access if `InstanceKlass::has_inlined_fields` 
>> is true, or simply if the actual field being accessed is flat 
>> (`fieldDescriptor::is_flat`).
>> 
>> I only found one place (in ciReplay.cpp) where we access the array of 
>> InlineLayoutInfo even though we might not have any inlined fields and only 
>> fields that are inlineable. I've changed this to use the normal "reference" 
>> path for fields that aren't flat.
>> 
>> Testing:
>> * Oracle's tier1-5, hotspot_valhalla and jdk_valhalla
>
> Joel Sikström has updated the pull request incrementally with two additional 
> commits since the last revision:
> 
>  - Move InlineKlass::cast() to callers
>  - Add abstract check to field_is_inlineable

@jsikstro 
Your change (at version cb80bac989c98ff2423b88c88a4f08d3bccfcb68) is now ready 
to be sponsored by a Committer.

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

PR Comment: https://git.openjdk.org/valhalla/pull/1966#issuecomment-3840823160

Reply via email to