RFR: 8340586: JdkJfrEvent::get_all_klasses stores non-strong oops in JNI handles
Markus Grönlund
mgronlun at openjdk.org
Tue Nov 5 13:40:30 UTC 2024
On Tue, 5 Nov 2024 13:32:27 GMT, Stefan Karlsson <stefank at openjdk.org> wrote:
>> src/hotspot/share/oops/klass.inline.hpp line 44:
>>
>>> 42: static_cast<void>(klass_holder());
>>> 43: }
>>> 44:
>>
>> Can you add a comment to Klass::java_mirror() that says it doesn't keep the loader alive, "see above".
>
>> safe to store in the object graph.
>
> It could be good to also mention roots like Handles, since that seems to be a common misunderstanding:
>
>> safe to store in the object graph and it's roots (E.g. Handles).
Why is not java_mirror() extended to set this keep_alive() of the CLD oop-stuff under the hood?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/21893#discussion_r1829369701
More information about the hotspot-dev
mailing list