On Mon, 23 Mar 2026 01:35:47 GMT, Chen Liang <[email protected]> wrote:

> My understanding is that `InstanceKlass::has_nestmate_access_to` is there 
> because VM has to perform permission checks in some scenarios where it cannot 
> query Java code. Ideally such permission checks should happen in one place, 
> and I believe somewhere in the Java code (more maintainable, JIT optimizable) 
> is the best place.

I don't know what this has to do with the current PR. The VM needs to perform 
access checks - we don't want to have to upcall to Java to do this.
 
> If `Class.isNestmateOf` is too slow due to `Class.getNestHost`, I think we 
> should add library_call recognition to inline it like getSuperclass. It 
> shouldn't be hard with such a precedent.

The issue is it performs two VM calls - one for each class - compared to one VM 
call with `JVM_AreNestmates`.

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

PR Comment: https://git.openjdk.org/jdk/pull/30358#issuecomment-4107508178

Reply via email to