[lworld] Integrated: 8378650: [lworld] Make decision to not flatten static fields explicit in FieldLayoutBuilder

Axel Boldt-Christmas aboldtch at openjdk.org
Thu Feb 26 06:43:52 UTC 2026


On Wed, 25 Feb 2026 09:43:17 GMT, Axel Boldt-Christmas <aboldtch at openjdk.org> wrote:

> The function `field_layout_selection` which is used to decide how layout the fields of class does not handle the static fields case explicitly. 
> 
> Right now it depends on a subtle interaction with parsing and preloading classes where we have a short circuit for static field which means we do not add an InlineLayoutInfo for the static fields, which in turn makes the `field_layout_selection` think that this field is not a known value class and ends up using a reference. 
> 
> This is both hard to understand and might cause bugs in the future. I suggest we add and explicit return LayoutKind::REFERENCE; when the field is static in `field_layout_selection`.

This pull request has now been integrated.

Changeset: f92a0288
Author:    Axel Boldt-Christmas <aboldtch at openjdk.org>
URL:       https://git.openjdk.org/valhalla/commit/f92a028832081e124a56116620fda66c37e24b67
Stats:     10 lines in 1 file changed: 10 ins; 0 del; 0 mod

8378650: [lworld] Make decision to not flatten static fields explicit in FieldLayoutBuilder

Reviewed-by: liach, fparain, jsikstro

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

PR: https://git.openjdk.org/valhalla/pull/2160


More information about the valhalla-dev mailing list