JEP 303 and ConstantDynamic
brian.goetz at oracle.com
Fri Aug 4 02:25:51 UTC 2017
The problem is these classes are tied to the running JVM. Creating a class literal (Foo.class) causes, as a side effect, the class to load, and fails if the class cannot be loaded. What is needed for intrinsification (and other use cases, such as bytecode APIs) are nominal descriptors for these types, that don’t require the classes to be present (for example, when you are generating a class file, you can’t load the class file you’re in the middle of generating.)
There’s a difference between a thing (Foo.class) and the name of the thing (ClassRef.of(“Foo”)).
> On Aug 3, 2017, at 5:57 AM, Hontvári Attila <attila at hontvari.net> wrote:
> The JEP proposes the many new intrinsic types (XYConstant, BootstrapSpecifier, etc.), but I don't see any advantages over the standard (Class/MethodHandle/etc. ) classes,
More information about the valhalla-dev