On Fri, 9 Jan 2026 17:26:30 GMT, Larry Cable <[email protected]> wrote:
>> src/hotspot/share/oops/instanceKlass.cpp line 2397:
>>
>>> 2395: oop cs = pd->obj_field(csfd.offset());
>>> 2396:
>>> 2397: if (cs != nullptr && (ik = cs->klass()->is_instance_klass() ?
>>> InstanceKlass::cast(cs->klass()) : nullptr) != nullptr) {
>>
>> Is a non-instance-class possible here??
>
> good question, but I think defensive coding is warranted, and this is not a
> performance sensitive code path IMO
I would prefer to add assertion it such cases. So we can see during testing if
assumption is incorrect. It also helps to find changed invariants earlier.
The defensive code path might be fine for product to don't bother users with
crashes.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/29048#discussion_r2677066611