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

Coleen Phillimore coleenp at openjdk.org
Tue Nov 5 23:06:34 UTC 2024


On Tue, 5 Nov 2024 15:21:04 GMT, Axel Boldt-Christmas <aboldtch at openjdk.org> wrote:

>> Why is not java_mirror() extended to set this keep_alive() of the CLD oop-stuff under the hood?
>
>> 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.

Yes, I think we're going to need to relearn how to access oops.

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

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


More information about the hotspot-dev mailing list