RFR 8154587: Resolution fails for default method named 'clone'
karen.kinnear at oracle.com
Mon Dec 11 17:58:20 UTC 2017
Many many hanks for figuring out all the details of this corner case and for all the work
to write the additional tests.
1) cpCache.cpp: can you change the assertion text to say “Calling non-public method in Object with invokeinterface” so
we don’t have to change it as confusing when we add nestmates and allow general calling of non-public methods in
Summary: change “overloaded” to “local”
I don’t need to see it again.
> On Dec 11, 2017, at 10:34 AM, harold seigel <harold.seigel at oracle.com> wrote:
> Please review this updated webrev for bug JDK-8154587:
> The main differences from the previous webrev are:
> 1. Improved comments and code changes to klassVtable.cpp and
> 2. Added an assert to cpCache.cpp
> 3. Added new tests. The purpose of many these tests, including the
> .../clone/invokevirtual/ tests, is to check for regressions.
> These changes were regression tested with the tests listed below plus tonga tests.
> Thanks, Harold
> On 12/6/2017 8:49 AM, harold seigel wrote:
>> Hi Lois,
>> Thanks for the review. I'll add these tests in the next iteration of this webrev.
>> >> - a test where class C does not define the method "clone", an IAE should result, correct?
>> Yes, the test throws an IAE.
>> On 12/4/2017 2:31 PM, Lois Foltan wrote:
>>> Hi Harold,
>>> Fix looks good. I would like to see three more test cases:
>>> - the same test written for "finalize" since that is also a non-public method of Object.
>>> - a test where class C does not define the method "clone", an IAE should result, correct?
>>> - a test case where I2 defines a public method of Object
>>> On 11/30/2017 11:15 AM, harold seigel wrote:
>>>> Please review this fix for JDK-8154587. The fix adds additional special casing to skip over non-public methods in class java.lang.Object during default method and itable processing for interfaces. These methods need to be skipped over because of the interface method resolution rules in JVM Spec 9, section 220.127.116.11 <https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-5.html#jvms-18.104.22.168>:
>>>> 3. Otherwise, if the class|Object|declares a method with the name
>>>> and descriptor specified by the interface method reference, which
>>>> has its|ACC_PUBLIC|flag set and does not have its|ACC_STATIC|flag
>>>> set, method lookup succeeds.
>>>> Open Webrev: http://cr.openjdk.java.net/~hseigel/bug_8154587/webrev/
>>>> JBS Bug: https://bugs.openjdk.java.net/browse/JDK-8154587
>>>> The fix was tested with JCK lang and VM tests, JTReg hotspot and many JTReg JDK tests, M5 tier1 - tier5 tests, and JPRT.
>>>> Thanks, Harold
More information about the hotspot-runtime-dev