[Nestmates] RFR: 8191114: [Nestmates] Update access control exception handling and other features per final JVMS proposal
David Holmes
david.holmes at oracle.com
Tue Jan 9 04:50:38 UTC 2018
Merged with latest jdk/jdk code. The jcod files are now defined as
classfile version 55 - their final value. The nestmate logic is
currently still enabled for JDK 10+ - I will bump that to 11 once the
actual JDK version is bumped.
I also want to clarify that these updates relate primarily to the actual
nestmate implementation. There are changes proposed in the JVMS that
affect the behaviour in cases that need not involve nestmates. Those
changes are still under discussion and any necessary implementation and
test changes will be made once those discussions are finalized.
Also something I should have called out is the changes to the
SelectionResolution test InvokeInterfaceICCE. With the changes to allow
invokeinterface for private methods, there is one test group that no
longer fails as expected and has been removed. I've placed it in
InvokeInterfaceSuccess but it is commented out as it doesn't succeed. It
seems to be some subset of the tests in that "group" that need to be
modified but the SelectionResolution tests are not easily understood or
adapted in that way. I will file a follow up issue for this.
I'll let this sit for a day or so before pushing. I'm not expecting
active reviews and I need to move on.
Thanks,
David
On 15/12/2017 6:56 PM, David Holmes wrote:
> And updated in place to merge in the classfile version 54 changes - all
> jcod files needed updating.
>
> David
>
> On 15/12/2017 5:48 PM, David Holmes wrote:
>> Updated webrev:
>>
>> http://cr.openjdk.java.net/~dholmes/8191114/webrev.v1/
>>
>> Only difference is classFileParser.cpp. The nestmate attributes should
>> only be processed in a Java 10 (for now) version classfile.
>>
>> Thanks,
>> David
>>
>> On 13/12/2017 5:31 PM, David Holmes wrote:
>>> Bug: https://bugs.openjdk.java.net/browse/JDK-8191114
>>> webrev: http://cr.openjdk.java.net/~dholmes/8191114/webrev/
>>>
>>> The final proposed changes to the JVMS have been discussed by the EG
>>> and it is time to bring everything into line with the proposed spec.
>>>
>>> The main changes are:
>>> - Process for determining the nest-host has changed, specifically:
>>> - same package check is done first**
>>> - IncompatibleClassChangeError is thrown instead of
>>> IllegalAccessError
>>> - A self-reference is permitted in the NestMembers array
>>> - A self-reference is not permitted in the NestHost attribute
>>> - Duplicate entries are permitted in the NestMembers array
>>> - Invokeinterface use for private interface methods is permitted
>>> regardless of classfile version (so no exception saying "you should
>>> use invokespecial").
>>>
>>> ** This had a disruptive impact on the tests as using Object and
>>> Object[] as "bad hosts" now hit the "not in same package" error
>>> instead of the intended error - so these had to be replaced with a
>>> new class defined in the same (unnamed) package.
>>>
>>> All tests were updated to match the changes, and new tests added
>>> where needed. In particular:
>>> - nest membership tests had to add the bad "SelfHost" case
>>> - reflection API getNestMembers() had to allow for and test,
>>> self-reference and duplicate entries [the spec is being clarified
>>> under JDK-8193408]
>>>
>>> Some minor cleanups:
>>> - src/hotspot/share/classfile/stackMapFrame.hpp
>>> - reverted leftover copyright year change (file is not modified
>>> from mainline version)
>>> - src/hotspot/share/classfile/verifier.cpp
>>> - reverted leftover layout and whitespace changes (file is not
>>> modified from mainline version)
>>>
>>> Thanks,
>>> David
More information about the valhalla-dev
mailing list