--- old/src/hotspot/cpu/arm/templateTable_arm.cpp 2018-05-03 06:04:07.953748355 -0400 +++ new/src/hotspot/cpu/arm/templateTable_arm.cpp 2018-05-03 06:04:06.393658439 -0400 @@ -4200,19 +4200,32 @@ prepare_invoke(byte_no, Rinterf, Rmethod, Rrecv, Rflags); + + Label no_such_interface; + // Check for private method invocation - indicated by vfinal Label notVFinal; __ tbz(flags, ConstantPoolCacheEntry::is_vfinal_shift, notVFinal); - // do the call - the index is actually the method to call + // Get receiver klass into Rklass - also a null check + __ load_klass(Rklass, Rrecv); - __ null_check(Rrecv, Rtemp); + Label subtype; + __ check_klass_subtype(Rklass, Rinterf, R1_tmp, R0_tmp, subtype); + // If we get here the typecheck failed + __ b(no_such_interface); + __ bind(subtype); + + // do the call - the index is actually the method to call __ profile_final_call(R0_tmp); __ jump_from_interpreted(Rindex); __ bind(notVFinal); + // Get receiver klass into Rklass - also a null check + __ load_klass(Rklass, Rrecv); + // Special case of invokeinterface called for virtual method of // java.lang.Object. See cpCacheOop.cpp for details. // This code isn't produced by javac, but could be produced by @@ -4223,11 +4236,6 @@ invokevirtual_helper(Rmethod, Rrecv, Rflags); __ bind(notMethod); - // Get receiver klass into Rklass - also a null check - __ load_klass(Rklass, Rrecv); - - Label no_such_interface; - // Receiver subtype check against REFC. __ lookup_interface_method(// inputs: rec. class, interface Rklass, Rinterf, noreg,