RFR: 8230302: GenerateJLIClassesPlugin can generate invalid DirectMethodHandle methods

Mandy Chung mandy.chung at oracle.com
Wed Aug 28 17:11:58 UTC 2019

On 8/28/19 7:38 AM, Claes Redestad wrote:
> Hi,
> we currently spin code for a non-sensical invokeVirtual DMH, so let's
> remove that.
> Such methods are benign since we won't ever attempt to resolve such
> nonsensical forms, but surely a waste of space. This patch tightens
> checks conservatively (could possibly apply the same restriction to
> invokeSpecial?) and adds a few negative tests using inputs that jlink
> should refuse.

I also think same check (first parameter is the receiver) can be applied 
to invokespecial for DMH.

> Webrev: http://cr.openjdk.java.net/~redestad/8230302/webrev.00/

This looks okay.    It'd be good to move away from hardcoded defaults as 
tracked by JDK-8230301.


More information about the core-libs-dev mailing list