On Wed, 21 Jan 2026 06:48:16 GMT, Axel Boldt-Christmas <[email protected]> 
wrote:

>> src/hotspot/share/interpreter/interpreterRuntime.cpp line 246:
>> 
>>> 244:   // If the field is nullable and is marked null, return early.
>>> 245:   if (LayoutKindHelper::is_nullable_flat(lk) &&
>>> 246:       
>>> field_klass->is_payload_marked_as_null(cast_from_oop<address>(obj) + 
>>> offset)) {
>> 
>> I wonder if there's a way to ask this and have the address calculation be 
>> hidden in InstanceKlass, like find_field_from_offset ?  So we don't have to 
>> know here if the offset includes the header or not?  Or even just add a 
>> is_payload_marked_as_null(oop, offset) to hide the calculation inside of 
>> inlineKlass.inline.hpp?
>
> I am working on trying to create something for representing an InlineKlass 
> payload in the runtime code. It achives exactly this. Current work in 
> progress: 
> https://github.com/openjdk/valhalla/commit/5df331779cbb6e83493260d41dcdcd97a67ab495

Then I suggest we can hold off on this until Axel's patch is ready. I see he 
also takes care of similar casts + offsets in InlineKlass.cpp which is nice.
https://github.com/openjdk/valhalla/blob/a4fb7ebd5af316d3e99d10bffb44d5be3aab5548/src/hotspot/share/oops/inlineKlass.cpp#L238-L247

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

PR Review Comment: 
https://git.openjdk.org/valhalla/pull/1936#discussion_r2711673147

Reply via email to