RFR: 8340586: JdkJfrEvent::get_all_klasses stores non-strong oops in JNI handles [v3]

Axel Boldt-Christmas aboldtch at openjdk.org
Tue Nov 5 15:23:29 UTC 2024


On Tue, 5 Nov 2024 13:38:20 GMT, Markus Grönlund <mgronlun at openjdk.org> wrote:

> Why is not java_mirror() extended to set this keep_alive() of the CLD oop-stuff under the hood?

Would like to improve our API to have the CLD oop handles accessors work more like WeakHandles w.r.t. peek and resolve. But would need to go over all the CLD oops resolves, because a few of them should be peeks. 

Side note: OopHandle::peek should probably be removed now that single generational ZGC is gone, as it has the same semantics as OopHandle::resolve.

> Can you add a comment to Klass::java_mirror() that says it doesn't keep the loader alive, "see above".

Added a comment to Klass::java_mirror() and updated the Klass::keep_alive() comment.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/21893#discussion_r1829546341


More information about the hotspot-dev mailing list