RFR: 8327246: Add a jcmd diagnostic command to list the jar files loaded by a process [v2]
Leonid Mesnik
lmesnik at openjdk.org
Fri Jan 9 17:46:02 UTC 2026
On Fri, 9 Jan 2026 17:26:30 GMT, Larry Cable <duke at openjdk.org> 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
More information about the hotspot-dev
mailing list