--- old/src/hotspot/cpu/ppc/templateTable_ppc_64.cpp 2018-05-04 00:46:38.610581045 -0400 +++ new/src/hotspot/cpu/ppc/templateTable_ppc_64.cpp 2018-05-04 00:46:36.826477574 -0400 @@ -3585,13 +3585,22 @@ prepare_invoke(byte_no, Rinterface_klass, Rret_addr, Rmethod, Rreceiver, Rflags, Rscratch1); + // Get receiver klass - this is also a null check + __ null_check_throw(Rreceiver, oopDesc::klass_offset_in_bytes(), Rscratch2); + __ load_klass(Rrecv_klass, Rreceiver); + // Check for private method invocation - indicated by vfinal - Label LnotVFinal; + Label LnotVFinal, L_no_such_interface, L_subtype; __ testbitdi(CCR0, R0, Rflags, ConstantPoolCacheEntry::is_vfinal_shift); __ bfalse(CCR0, LnotVFinal); - __ null_check_throw(Rreceiver, -1, Rscratch3); + __ check_klass_subtype(Rrecv_klass, Rinterface_klass, Rscratch, Rscratch1, subtype); + // If we get here the typecheck failed + __ b(L_no_such_interface); + __ bind(subtype); + + // do the call Register Rscratch = Rflags; // Rflags is dead now. @@ -3602,12 +3611,8 @@ __ bind(LnotVFinal); - // Get receiver klass. - __ null_check_throw(Rreceiver, oopDesc::klass_offset_in_bytes(), Rscratch2); - __ load_klass(Rrecv_klass, Rreceiver); - // Check corner case object method. - Label LobjectMethod, L_no_such_interface, Lthrow_ame; + Label LobjectMethod, Lthrow_ame; __ testbitdi(CCR0, R0, Rflags, ConstantPoolCacheEntry::is_forced_virtual_shift); __ btrue(CCR0, LobjectMethod);