RFR (M): JDK-8004967 - Default method cause java.lang.VerifyError: Illegal use of nonvirtual function call

Bharadwaj Yadavalli bharadwaj.yadavalli at oracle.com
Wed Jan 16 12:53:19 PST 2013


Thanks for your review.

On 1/16/2013 2:02 PM, Remi Forax wrote:
> On 01/16/2013 07:35 PM, Bharadwaj Yadavalli wrote:
>> Please review the change at 
>> http://cr.openjdk.java.net/~bharadwaj/8004967/webrev/
>> Default interface methods are new in Java 8. VM creates overpass 
>> methods in the vtable slots of classes to invoke a default method 
>> using invokespecial.
>> Consequently, invocation of default interface methods (i.e., overpass 
>> methods in the VM) via invokespecial is legal and should not be 
>> flagged as illegal.
>> In short, this change allows invocation of default methods of Java 8 
>> using invokespecial.
>> I ran JCK (vm, lang, api) tests, runThese and vm.quicklist with no 
>> new failures.
>> Thanks,
>> Bharadwaj
> What if I generate a bytecode with an abstract public method marked 
> with synthetic and bridge ?

Would you be using invokespecial to invoke that method? Can you please 
provide an example so that I can better understand the rules and 

> I think you should check that the method is not abstract.

This change is specifically made to make legal the default method target 
of invokespecial in the overpass method code generated by the VM. 
Currently, the access flags of these methods is set to public, 
synthetic, and bridge.


More information about the hotspot-runtime-dev mailing list