[Nestmates] RFR 8187567: [Nestmates] Enable nestmate changes in javac by default

Maurizio Cimadamore maurizio.cimadamore at oracle.com
Fri Sep 15 09:05:54 UTC 2017

On 15/09/17 10:02, David Holmes wrote:
> On 15/09/2017 6:15 PM, Maurizio Cimadamore wrote:
>> Looks great.
> Thanks for taking a look Maurizio!
>> The only thing we might need (not now, maybe later) is a 'reverse' 
>> javac flag that forces generation of accessor and/or invokevirtual on 
>> private in case you want to generate classfile with latest version 
>> number but with old properties.
> Yes. If we need it I'll add it. It is a pity the -XDxxx can't be more 
> like the hotspot -XX:+xxx and -XX:-xxx flags to allow for enable/disable.
In reality, -XD is just a prefix for whatever you want - we have other 
-XD flags that support +/- :-)

> Cheers,
> David
>> Cheers
>> Maurizio
>> On 15/09/17 08:12, David Holmes wrote:
>>> bug: https://bugs.openjdk.java.net/browse/JDK-8187567
>>> webrev**: http://cr.openjdk.java.net/~dholmes/8187567/
>>> ** test/runtime/Nestmates/privateConstructors/TestInvokeSpecial.java 
>>> contains additional changes for 8187536. They will be checked in 
>>> separately.
>>> While nestmates will ultimately be associated with a future 
>>> source/target version of the JDK and an updated classfile version 
>>> (see JDK-8187302) we want to be able to enable them by default as-if 
>>> executing in that future release.
>>> The primary changes are confined to javac and are very 
>>> straight-forward:
>>> - generate the nestmate attributes in the classfile
>>> - use virtual invocation bytecodes for private method invocations
>>> - don't generate private accessors
>>> With this change in place we can update the hotspot nestmate tests 
>>> to not provide explicit "@compile" directives. We also add a test to 
>>> verify that invokeinterface is rejected for private interface 
>>> methods in pre-nestmate classfile versions (v52 works fine for this).
>>> We can now build the JDK with the new nestmate features enabled, and 
>>> run tests without needing to provide additional javac options.
>>> I also added a missing testcase in 
>>> test/runtime/Nestmates/privateMethods/TestInvoke.java (just to 
>>> ensure there's no unexpected difference with this$0 usage).
>>> Thanks,
>>> David

More information about the valhalla-dev mailing list