[Nestmates] Add a core reflection API to get nestmate information

Peter Levart peter.levart at gmail.com
Fri Nov 17 09:45:48 UTC 2017

Hi David,

On 11/16/2017 10:52 PM, David Holmes wrote:
>>> John prefers to minimize exceptions for the Java API. :)
>> Suppose that this is basic reflection API to get nestmate information 
>> and that it will also be used for reflective access checks. For 
>> example in jdk.internal.reflect.Reflection#verifyMemberAccess, which 
>> is used 
> It isn't. The reflection API is purely for "external" use. Real access 
> checks are performed in the same way as the VM access checks - as 
> required - and will report the same exceptions in the same way.
> David 

Real access checks performed by bytecode(s), yes. But what about 
reflective access checks - those performed by Method.invoke, 
Field.[get|set], Constructor.newInstance? They will have to be revised 
some day to include the nestmates. What facility should those methods 
use to implement the checks (the guts of those checks is in 

Is the plan to have special internal native methods to facilitate that? 
I don't quite understand why should a Class.isNestmateOf(Class) behave 
any differently than real VM access check.

Regards, Peter

More information about the valhalla-spec-observers mailing list