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

Bharadwaj Yadavalli bharadwaj.yadavalli at oracle.com
Fri Jan 18 06:37:17 PST 2013

Thanks to Remi, Dean and Karen for looking at the code changes.

Upon further contemplation, it seems to me that my initial proposed 
change (http://cr.openjdk.java.net/~bharadwaj/8004967/webrev/) *might* 
incorrectly trust bytecode in methods that were *not* VM generated and 
flag it as legal.

So, I have implemented, IMHO, a more robust/correct way to handle 
verification of methods generated by the VM in the old verifier. This 
change is consistent with  the way verification done on such methods in 
the (new) split verifier (which I think is appropriate).

The new changes are in hotspot and jdk trees.

Please review the changes at 

Hotspot tree changes : 
JDK tree changes : 

I ran JCK tests (vm, lang completed; api running), runThese and 
vm.quicklist with no regressions.



On 1/16/2013 1: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

More information about the hotspot-runtime-dev mailing list