Adopting JEP 303 (Intrinsics for LDC and INVOKEDYNAMIC) into Amber

Brian Goetz brian.goetz at oracle.com
Fri Apr 21 13:55:00 UTC 2017


There's a reason we don't want to do this.  A ClassConstant (and the 
other constant types) should not be dependent on what classes have been 
loaded by *this* VM; they should merely describe enough information to 
load a class. (Pull on that string some more, and you get to "so we can 
just use MethodType too" and then...)

The target-typing trick allows Foo.class to either be a Class, or a 
ClassConstant, depending on context.  If it is typed as ClassConstant, 
it doesn't force loading of the class.

We might decide this is too much magic; still figuring out the sweet 
spot here.

On 4/21/2017 1:03 AM, Tagir Valeev wrote:
>
> Probably it would be easier to declare class Class<T> as implements 
> Constable<Class<T>> and replace ClassConstant with Constable<Class<?>> 
> in method signatures where applicable? Or introduce some intermediate 
> interface?
>



More information about the amber-dev mailing list