RFR: 8043275 Interface initialization for default methods
Karen Kinnear
karen.kinnear at oracle.com
Tue Oct 21 16:27:44 UTC 2014
Coleen,
Many thanks for the review (8u40 backport coming soon).
details below,
thanks,
Karen
On Oct 20, 2014, at 10:04 AM, Coleen Phillimore wrote:
>
> Karen,
> This looks great. I only have two small requests for comments.
>
> At instanceKlass.cpp right before line 749, can you add a short one line comment about only calling initialize() for interfaces that *declare* concrete methods. In case people miss that subtlety (which I missed at first reading).
Great suggestion - here is what I added.
// Only initialize() interfaces that "declare" concrete methods.
// has_default_methods drives searching superinterfaces since it
// means has_default_methods in its superinterface hierarchy
>
> http://cr.openjdk.java.net/~acorn/8043275/webrev/test/runtime/lambda-features/TestInterfaceInit.java.html
>
> The test case could use a comment between 68-72. There's a trick there which is hard to see. The classes that have concrete methods are initialized for 'L' (which is probably an ldc) but then the ones without concrete methods are initialized when you do a getfield of 'v'. I think?
I will add a comment (and actually improve using Paul's array suggestion).
Due to the L.v, only the ones with concrete methods are initialized at all - so the order is 1,2,3,4 and the two interfaces without
default methods (JN and KN) actually do not get initialized at all.
I will definitely improve the comments so that is clearer.
thank you for the review!
>
> I don't need to see another version with comments since they are small requests.
>
> thanks,
> Coleen
>
> On 10/16/14, 2:01 AM, Karen Kinnear wrote:
>> Please review for 9 (8u40 back port will follow):
>>
>> webrev: http://cr.openjdk.java.net/~acorn/8043275/webrev/
>> bug: https://bugs.openjdk.java.net/browse/JDK-8043275
>>
>> Summary:
>> Fix superinterface initialization to be based on declaring a non-static instance method rather than on declaring or inheriting one
>>
>> Tested (linux-x64):
>> defmeth - enhanced
>> jtreg TestInterfaceInit and TestInterfaceOrder
>> jtreg hotspot, jdk.lambda, java.util, java.lang
>> jck vm, lang
>> nsk: vm.defmeth (added 2 tests), vm.mlvm, vm.fast.quick
>>
>> Thanks to Dan Smith, Alex Buckley, John Rose for specification clarification.
>>
>> thanks,
>> Karen
>>
>
More information about the hotspot-dev
mailing list