On Mon, 2 Feb 2026 09:27:33 GMT, Joel Sikström <[email protected]> wrote:
>> Hello, >> >> Right now it's not clear that the dummy field that is injected into empty >> inline klasses can be/is reused for the null-marker when looking at the >> printed layout from -XX:+PrintInlineLayout. I suggest we enhance this print >> to indicate if the dummy field has been reused for the null-marker. >> >> I've tested that the added comment in the print is there when nullability is >> turned on (default), and not there when turned off >> (`-XX:-UseNullableValueFlattening -XX:-UseNullableNonAtomicValueFlattening`). >> >> >> Before: >> Instance fields: >> @0 RESERVED 12/- >> @12 REGULAR 1/1 ".empty" B >> >> After: >> Instance fields: >> @0 RESERVED 12/- >> @12 REGULAR 1/1 ".empty" B (reused as null-marker) >> >> >> Testing: >> * GHA >> * Oracle's tier1 > > Joel Sikström has updated the pull request incrementally with one additional > commit since the last revision: > > no dummy field in static layout printing Thanks for the changes, this makes debugging and developing a lot easier. One thing that came to mind is that we have a bunch of flat array specific printing logic in e.g. `FlatArrayKlass::oop_print_value_on`. As a possible extension, would we ever want to convey such information in the array itself, rather than the field? For example when debug-printing the human-version of the array header to indicate the null marker is reused as the dummy field (when applicable)? ------------- Marked as reviewed by phubner (Committer). PR Review: https://git.openjdk.org/valhalla/pull/2001#pullrequestreview-3738689607
