On Mon, 6 Apr 2026 17:18:18 GMT, Frederic Parain <[email protected]> wrote:

> Fix a bug in the computation of layouts of abstract value classes inheriting 
> fields. There was a missing case in the computation of the starting point for 
> the insertion of new fields. The FieldLayoutAnalyzer has been extended to 
> always verify that the alignment of the first field is compatible with the 
> alignment constraint of the payload. No new test was necessary, the new 
> verification in the FieldLayoutAnalyzer is sufficient to detect the issue 
> when running the ValueRandomLayoutTest test.
> 
> Testing in progress (tier1-4).
> 
> Thanks.
> 
> Fred

Marked as reviewed by iwalulya (no project role).

src/hotspot/share/classfile/fieldLayoutBuilder.cpp line 1167:

> 1165:       }
> 1166:       _layout->set_start(_layout->first_field_block());
> 1167:     } else {

I noticed we often write `if (!cond) { ... } else { ... }` instead of the 
positive form.
For example,` if (!_is_abstract_value)` here. Is there a reason for preferring 
this? It feels less readable to me.

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

PR Review: 
https://git.openjdk.org/valhalla/pull/2301#pullrequestreview-4066587586
PR Review Comment: 
https://git.openjdk.org/valhalla/pull/2301#discussion_r3043628002

Reply via email to