[lworld] RFR: 8377467: [lworld] More defensive assertion guards for array layouts and properties [v2]

Frederic Parain fparain at openjdk.org
Mon Feb 23 18:34:59 UTC 2026


On Mon, 23 Feb 2026 16:45:03 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:

>> src/hotspot/share/classfile/fieldLayoutBuilder.cpp line 104:
>> 
>>> 102: 
>>> 103:   if (lk != LayoutKind::REFERENCE) {
>>> 104:     assert(lk != LayoutKind::BUFFERED, "Sanity check");
>> 
>> I'm not sure if this is 100% correct. As far as I know we don't use BUFFERED when building the layout but I could be mistaken, and my tests pass. Let me know!
>
> Yes, this seems right.

A field can never have a BUFFERED layout.
The BUFFERED layout is the layout used for buffered values, and is equivalent to the most constraining of the supported layouts. It is more an abstraction than a true layout.

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

PR Review Comment: https://git.openjdk.org/valhalla/pull/2103#discussion_r2842425655


More information about the valhalla-dev mailing list