[Nestmates] 8186763: Nestmate update for lazy validation and virtual invocation
david.holmes at oracle.com
Sun Aug 27 21:16:34 UTC 2017
These are changes I plan to push as soon as my Committer status is
confirmed. Details below.
Please note the nestmates prototype is still in a very early form and
only the actual nestmate tests are known to pass with direct nestmate
invocations enabled. Many other tests will pass with no problem, but
there are still issues to resolve in places (CDS) - and we're not quite
ready to try and build the JDK with direct nestmate invocations enabled.
The nestmate jtreg tests force use of nestmate accesses using
-XDdisablePrivateAccessors on the @run line. To run other tests with
direct nestmate invocations add this to the jtreg command-line:
At present the default mode for javac still issues invokespecial. To
force invokevirtual instead add this to the jtreg command-line:
From discussions at and after JVMLS, three changes were proposed for
1. Use invokevirtual for private instance method invocations instead of
having to make complicated changed to invokespecial.
2. Use invokeinterface for private interface method invocations, instead
3. Perform lazy validation of nest membership, including resolution of
the nest-host, only when a nestmate access check has to be performed.
This update handles items #1 and #3. Those issues are also related in
that use of invokespecial would trigger nestmate access checks during
verification, whereas use of invokevirtual does not and so with
invokevirtual nest membership validation is as late as possible.
Details of changes:
Remove the previously introduced, but not needed, peek_stack API
Ensure virtual invocation doesn't find a private superclass method if
the target method has been removed.
Clean out old experimental code.
Revert the comments re invokespecial usage
Inline the validate_nest_top logic into nest_top so that validation and
resolution occur when nest_top() is first called - ie when a nestmate
access check is needed.
Remove the previous call to do validation at link-time.
Undo previous changes that are no longer needed with lazy nestmate
Rework the nestmate membership tests as they now need to attempt actual
nestmate invocations to trigger the validation.
Rename all the InvokeSpecial tests/classes/comments to just Invoke - the
tests are not dependent on, nor necessarily utilise InvokeSpecial.
(Modulo the one case where verification will fail if using invokespecial.)
Add some private constructor tests to mimic those for private methods -
More information about the valhalla-dev