[lworld] RFR: 8331006: [lworld] Support of null markers for nullable flat fields [v2]
Dan Heidinga
heidinga at openjdk.org
Wed May 1 13:47:59 UTC 2024
On Wed, 1 May 2024 13:40:46 GMT, Frederic Parain <fparain at openjdk.org> wrote:
>> src/hotspot/cpu/aarch64/templateTable_aarch64.cpp line 3359:
>>
>>> 3357: Label is_flat, has_null_marker, done;
>>> 3358: __ test_field_has_null_marker(r3, noreg /* temp */, has_null_marker);
>>> 3359: __ null_check(r0);
>>
>> Does `__ null_check(r0);` need to occur first to make sure we consistently null check the receiver object? Or is the null receiver check handled in the InterpreterRuntime::write_nullale_flat_field helper?
>
> The receiver object is in r2, which is checked when retrieved with pop_and_check_object(). r0 is the new field value. If the flat field has a null marker, it means it is nullable, so null is a valid value for r0, and the null check must not be performed. If the field doesn't have a null marker, this is a null-free field, and the null check is performed. So I think the null_check(r0) is at the right place.
You're right. Thanks for checking.
-------------
PR Review Comment: https://git.openjdk.org/valhalla/pull/1078#discussion_r1586314364
More information about the valhalla-dev
mailing list