RFR JDK-8016764: JVM does not prohibit invokespecial in c.f.v 51.0 that invokes default interface method in c.f.v 52.0

David Holmes david.holmes at oracle.com
Wed Aug 28 19:09:04 PDT 2013


On 29/08/2013 11:19 AM, harold seigel wrote:
> Hi David,
>
> The removal of the two lines causes the _invokespecial case to fall
> through to the _invokestatic case.

I missed the fallthrough. So invokespecial and invokestatic are now 
handled the same.

> The _invokestatic case checks to see if _klass->major_version() is less
> than STATIC_METHOD_IN_INTERFACE_MAJOR_VERSION.  That is a comparison of
> class file versions.
>
> If klass->major_version() is less than 52 then the constantpool entry
> can only be a Methodref.
>
> Does that help clarify things?

Thanks.
David

> Thanks, Harold
>
> On 8/28/2013 8:52 PM, David Holmes wrote:
>> Hi Harold,
>>
>> On 29/08/2013 1:18 AM, harold seigel wrote:
>>> Hi,
>>>
>>> Please review this small fix for bug 8016764.  The change prevents class
>>> files of version 51 and lower from using invokespecial to call default
>>> interface methods that are in class files of version 52.
>>
>> I don't have much knowledge of the verifier but I don't see anything
>> that refers to the class file versions involved. Is it implicit in the
>> fact we got to this particular piece of code?
>>
>> Thanks,
>> David
>>
>>> The fix was tested with the JCK Lang and VM tests, ute tests, and some
>>> of the tests listed in the bug.
>>>
>>> Open webrev: http://cr.openjdk.java.net/~hseigel/bug_8016764/
>>> <http://cr.openjdk.java.net/%7Ehseigel/bug_8016764/>
>>>
>>> bug: https://bugs.openjdk.java.net/browse/JDK-8016764
>>>
>>> Thanks! Harold
>


More information about the hotspot-runtime-dev mailing list