[lworld] RFR: 8376652: [lworld] Explicit and consistent names for nonstatic fields in FieldLayout [v3]
Joel Sikström
jsikstro at openjdk.org
Fri Jan 30 08:16:20 UTC 2026
> Hello,
>
> We should be explicit when naming variables that refer to "fields" and state whether we mean staitc 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 two additional commits since the last revision:
- Rename declares_non_static_fields to declares_nonstatic_fields
- Rename _declared_non_static_fields_count to _declared_nonstatic_fields_count
-------------
Changes:
- all: https://git.openjdk.org/valhalla/pull/1992/files
- new: https://git.openjdk.org/valhalla/pull/1992/files/2a26fcd1..02b416b3
Webrevs:
- full: https://webrevs.openjdk.org/?repo=valhalla&pr=1992&range=02
- incr: https://webrevs.openjdk.org/?repo=valhalla&pr=1992&range=01-02
Stats: 8 lines in 2 files changed: 0 ins; 0 del; 8 mod
Patch: https://git.openjdk.org/valhalla/pull/1992.diff
Fetch: git fetch https://git.openjdk.org/valhalla.git pull/1992/head:pull/1992
PR: https://git.openjdk.org/valhalla/pull/1992
More information about the valhalla-dev
mailing list