New JEP: Javac intrinsics for LDC and INVOKEDYNAMIC
Paul Sandoz
paul.sandoz at oracle.com
Tue Apr 11 18:38:05 UTC 2017
> (This means that one can create a description for a class that is not loaded, and that creating a descriptor does not trigger any class loading.)
Nor any class initialization (thereby in some cases, at least in JDK allowing us the possibility circumvent bootstrap issues, that’s my hope...).
Perhaps mention that it will not be possible to reflectively invoke (via MethodHandles or Method) the compiler intrinsic methods? and the sig-poly is not a runtime sig-poly (as in the internal @MethodHandle.PolymorphicSignature), just the compile time behaviour bit.
There is definitely some scope to improving the ease of use for those that want to refer explicit to say Class rather than ClassConstant. Might be worth a quick mention without getting the paint and brushes out. I suspect it in some cases a CE could be extended to that returned from a Intrinics.lcd call (if javac can track it within the compilation unit), although that probably has less value.
I would be inclined to make a stronger statement about a new language syntax (as in your reply to Remi), if we ain’t gonna do it, let’s say so, and if someone else comes up with a brilliant idea we can pivot. Also i think it’s worth stating in the summary that the focus of this library is as you say for the advanced developer without being an attractive nuisance to the majority of Java developers.
Paul.
> On 11 Apr 2017, at 06:57, Brian Goetz <brian.goetz at Oracle.COM> wrote:
>
> Please review the this JEP draft:
>
> https://bugs.openjdk.java.net/browse/JDK-8178320
>
> This JEP creates (a) an official set of purely-nominal wrapper classes for linkable constants (Class, MethodType, MethodHandle, VarHandle), provides constant-propagation (not folding) support in javac for these types, and (b) intrinsification for LDC and INVOKEDYNAMIC so that they can be predictably translated into bytecode.
>
> This allows Java source code to be a first-class client of invokedynamic, including using Java to test indy bootstraps.
>
More information about the valhalla-dev
mailing list