[lworld] RFR: 8376532: [lworld] Size of BUFFERED layout is sometimes smaller than size of NULLABLE_NON_ATOMIC_FLAT layout
Chen Liang
liach at openjdk.org
Thu Jan 29 20:07:20 UTC 2026
On Thu, 29 Jan 2026 17:41:13 GMT, Frederic Parain <fparain at openjdk.org> wrote:
> Fixes several bugs in the field layout builder, when the size and alignment constraint of the BUFFERED layout are adjusted to be compatible with all the other supported layouts.
> The FieldLayoutAnalyzer framework has been updated to check this requirement each time a field layout log is processed.
>
> Testing in progress.
>
> Fred
src/hotspot/share/classfile/fieldLayoutBuilder.cpp line 1236:
> 1234: // and loosely consistent are supported.
> 1235: int required_alignment = _payload_alignment;
> 1236: if (has_null_free_atomic_layout() && _payload_alignment < null_free_atomic_layout_size_in_bytes()) {
Suggestion:
if (has_null_free_atomic_layout() && required_alignment < null_free_atomic_layout_size_in_bytes()) {
Maybe change the _payload_alignment for null_free_atomic_layout comparison to required_alignment too for consistency?
-------------
PR Review Comment: https://git.openjdk.org/valhalla/pull/1997#discussion_r2743309628
More information about the valhalla-dev
mailing list