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

David Holmes david.holmes at oracle.com
Fri Sep 15 07:12:13 UTC 2017

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).


More information about the valhalla-dev mailing list