[lworld] RFR: 8375434: [lworld] Add comment for null-check in InlineKlass::read_payload_from_addr [v2]

duke duke at openjdk.org
Mon Jan 19 09:06:25 UTC 2026


On Thu, 15 Jan 2026 16:10:58 GMT, Joel Sikström <jsikstro at openjdk.org> wrote:

>> Hello,
>> 
>> Update: There is nothing wrong with the logic. I added a comment to clarify why the second null-marker check is needed. Thanks.
>> 
>> ~~Right now we check the null-marker for the NULLABLE_ATOMIC_FLAT LayoutKind twice, both before and after allocating a heap instance. The first check returns nullptr early if the null-marker is set, as we don't have to allocate an object on the heap if we are going to return nullptr anyways. The other check is redundant, since if the null-marker is not set, the source object is non-null, which means the destination (res) object is non-null as well after copying, so the code inside it is unreachable.~~
>> 
>> Testing:
>> * Oracle's tier1-4, hotspot_valhalla, jdk_valhalla
>> * ~~I also added a `gurantee` for the removed code and ran through hotspot_valhalla and jdk_valhalla locally.~~
>
> Joel Sikström has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Add comment

@jsikstro 
Your change (at version c4776d84ccea1ee3c4202b1a83b866fca6dcda4d) is now ready to be sponsored by a Committer.

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

PR Comment: https://git.openjdk.org/valhalla/pull/1914#issuecomment-3767203321


More information about the valhalla-dev mailing list