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

>> A straightforward implementation of the requested change. No additional 
>> tests.
>> 
>> Tested using tier1 tests on linux-x64, macosx-aarch64, windows-x64.
>
> 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.
> 
> 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.

I'm okay with doing the proposed change, though I'm not sure it is really worth 
it (and I hope we don't find there was some very subtle reason to not do this). 
The JBS/PR titles and descriptions need updating if we do make the change. I'll 
leave it to @liach to make that decision.

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

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

Reply via email to