On Mon, 2 Feb 2026 16:34:43 GMT, Quan Anh Mai <[email protected]> wrote:
>> Marc Chevalier has updated the pull request incrementally with 10 additional
>> commits since the last revision:
>>
>> - Details
>> - exception handling
>> - oops
>> - Also cache correctly whole stable fields
>> - fix comment
>> - Remove debug
>> - ShouldNotReachHere
>> - explicit casts
>> - Clean up
>> - expand_constant
>
> src/hotspot/share/ci/ciInstance.cpp line 86:
>
>> 84: InstanceKlass* holder = InstanceKlass::cast(obj->klass());
>> 85: int index = -1;
>> 86: for (JavaFieldStream fs(holder); !fs.done(); fs.next()) {
>
> My latest PR should include a `_layout_kind` in the `ciField` object, can you
> use it?
I've tried something. It sure looks nicer.
> src/hotspot/share/ci/ciInstance.cpp line 95:
>
>> 93: InlineLayoutInfo* layout_info =
>> holder->inline_layout_info_adr(index);
>> 94: InlineKlass* vk = layout_info->klass();
>> 95: oop res = vk->read_payload_from_addr(obj, offset,
>> layout_info->kind(), THREAD);
>
> It seems to imply that this access is required to be atomic, what if it is a
> non-atomic field?
I think the problem isn't here, but in `field_value`: in case we need a
non-atomic field, we don't need to find the containing field and cache that. If
the containing field turns out not to be atomic, we can simply get the leaf
field directly, and cache that. For now, I've made an error to ask for a flat
declared field in case it's non-atomic: one probably want/should (but at least
can) query the leaf fields individually.
-------------
PR Review Comment:
https://git.openjdk.org/valhalla/pull/1923#discussion_r2763325289
PR Review Comment:
https://git.openjdk.org/valhalla/pull/1923#discussion_r2763334575