--- old/src/hotspot/cpu/aarch64/templateTable_aarch64.cpp 2018-05-04 00:46:28.525996180 -0400 +++ new/src/hotspot/cpu/aarch64/templateTable_aarch64.cpp 2018-05-04 00:46:26.977906394 -0400 @@ -3369,11 +3369,21 @@ // r2: receiver // r3: flags + Label no_such_interface; + // Check for private method invocation - indicated by vfinal Label notVFinal; __ tbz(flags, ConstantPoolCacheEntry::is_vfinal_shift, notVFinal); - __ null_check(r2); + // Get receiver klass into r3 - also a null check + __ null_check(r2, oopDesc::klass_offset_in_bytes()); + __ load_klass(r3, r2); + + Label subtype; + __ check_klass_subtype(r3, r0, r4, subtype); + // If we get here the typecheck failed + __ b(no_such_interface); + __ bind(subtype); __ profile_final_call(r0); __ profile_arguments_type(r0, rmethod, r4, true); @@ -3396,7 +3406,7 @@ __ null_check(r2, oopDesc::klass_offset_in_bytes()); __ load_klass(r3, r2); - Label no_such_interface, no_such_method; + Label no_such_method; // Preserve method for throw_AbstractMethodErrorVerbose. __ mov(r16, rmethod);