[lworld] RFR: 8376652: [lworld] Explicit and consistent names for nonstatic fields in FieldLayout [v4]

Chen Liang liach at openjdk.org
Wed Feb 4 16:51:50 UTC 2026


On Fri, 30 Jan 2026 08:23:13 GMT, Joel Sikström <jsikstro at openjdk.org> wrote:

>> Hello,
>> 
>> We should be explicit when naming variables that refer to "fields" and state whether we mean static or nonstatic fields.
>> 
>> I've also done a bit of cleanup in `FieldLayoutBuilder::compute_inline_class_layout()`, which calls `has_nonstatic_fields`. The "has_nonstatic_fields" property is inherited from the superklass whenever a klass instance is created, so we only have to check the property once on the "first" superklass.
>> 
>> Testing:
>> * Oracle's tier1-3, jdk_valhalla and hotspot_valhalla
>> * I added an assert to sanity test that the while loop I removed in `FieldLayoutBuilder::compute_inline_class_layout()` never gets past the "first" superklass, which didn't hit in tier1-3.
>
> Joel Sikström has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Renamed closest_non_static to closest_nonstatic

Thanks for this fix!

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

PR Comment: https://git.openjdk.org/valhalla/pull/1992#issuecomment-3848555362


More information about the valhalla-dev mailing list