On Fri, 12 Jun 2026 14:14:37 GMT, Matias Saavedra Silva <[email protected]> 
wrote:

>> This patch adds detailed printing for flat arrays in the AOTMapLogger and 
>> allows proper printing of embedded oops. Verified with tie 1-5 tests.
>> 
>> ---------
>> - [x] I confirm that I make this contribution in accordance with the 
>> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai).
>
> Matias Saavedra Silva has updated the pull request with a new target base due 
> to a merge or a rebase. The incremental webrev excludes the unrelated changes 
> brought in by the merge/rebase. The pull request contains 13 additional 
> commits since the last revision:
> 
>  - Improved printing of null fields
>  - Merge branch 'lworld' into print_oop_8383389
>  - Ioi patch and added null marker printing
>  - Ioi comments and improved testing
>  - Added copyright
>  - Added test
>  - Merge branch 'lworld' into print_oop_8383389
>  - Test improvement and cleanup
>  - Cleanup
>  - Shortcut for null fields
>  - ... and 3 more: 
> https://git.openjdk.org/valhalla/compare/299cc469...b15612ae

src/hotspot/share/cds/aotMapLogger.cpp line 634:

> 632:   }
> 633: 
> 634:   FakeOop read_inline_oop_at(address value_addr, Klass* k) {

A comment is needed here to make explicit that the argument value_addr is not 
the address of the flat value, but must be the address of the flat value 
shifted by the payload_offset value.

src/hotspot/share/cds/aotMapLogger.cpp line 904:

> 902:             _st->print_cr(" - [null_marker] @%d %s",
> 903:                       vk->null_marker_offset() - _base_offset + 
> field_offset,
> 904:                       
> obj.raw_oop()->bool_field(vk->null_marker_offset()) ? "Field marked as 
> non-null" : "Field marked as null");

It is recommended to use the method is_payload_marked_as_null() instead of 
checking the null marker value directly, to make the code robust against future 
changes of the null marker encoding,

src/hotspot/share/cds/aotMapLogger.cpp line 1057:

> 1055:     InlineKlass* elem_k = 
> ((FlatArrayKlass*)real_klass)->element_klass();
> 1056:     for (int i = 0; i < fake_flat_array.length(); i++) {
> 1057:       st->print(" - Flat inline type field '%s':", 
> elem_k->name()->as_C_string());

In this case, this is an array element, not a field,

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

PR Review Comment: 
https://git.openjdk.org/valhalla/pull/2444#discussion_r3413963243
PR Review Comment: 
https://git.openjdk.org/valhalla/pull/2444#discussion_r3413979744
PR Review Comment: 
https://git.openjdk.org/valhalla/pull/2444#discussion_r3413989588

Reply via email to