Hi,

please review this change to add the ability to generate DirectMethodHandles to the --generate-jli-classes jlink plugin.

The implementation generates all the specified DMHs as methods into a single class, java.lang.invoke.DirectMethodHandle$DMH. At runtime when a DMH's LF is set up, we speculatively resolve the member from this class instead of generating and loading the bytecode as a distinct anonymous class. This avoids loading a potentially large number of anonymous classes at runtime, and also enables other startup optimizations such as allowing CDS to see and dump this class to the shared archive.

webrev: http://cr.openjdk.java.net/~redestad/8163369/webrev.01/
JBS: https://bugs.openjdk.java.net/browse/JDK-8163369

This is a sub-task of https://bugs.openjdk.java.net/browse/JDK-8086045, which captures more information about the ongoing effort to reduce j.l.invoke initialization overheads.

Thanks!

/Claes

Reply via email to