On Thu, 15 Jan 2026 11:58:34 GMT, Joel Sikström <[email protected]> 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.~~

This pull request has now been integrated.

Changeset: a4fb7ebd
Author:    Joel Sikström <[email protected]>
Committer: Paul Hübner <[email protected]>
URL:       
https://git.openjdk.org/valhalla/commit/a4fb7ebd5af316d3e99d10bffb44d5be3aab5548
Stats:     10 lines in 1 file changed: 7 ins; 0 del; 3 mod

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

Reviewed-by: fparain, phubner

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

PR: https://git.openjdk.org/valhalla/pull/1914

Reply via email to