--- old/src/hotspot/cpu/s390/templateTable_s390.cpp 2018-05-04 00:46:43.454861994 -0400 +++ new/src/hotspot/cpu/s390/templateTable_s390.cpp 2018-05-04 00:46:41.894771515 -0400 @@ -3618,11 +3618,21 @@ // Z_R14 (== Z_bytecode) : return entry // Check for private method invocation - indicated by vfinal - Label notVFinal; + NearLabel notVFinal; __ testbit(flags, ConstantPoolCacheEntry::is_vfinal_shift); __ z_brz(notVFinal); - __ null_check(receiver); + // Get receiver klass into klass - also a null check. + __ load_klass(klass, receiver); + + NearLabel subtype, no_such_interface; + + __ check_klass_subtype(klass, interface, Z_tmp_2, Z_temp_3, subtype); + // If we get here the typecheck failed + __ z_bru(no_such_interface); + __ bind(subtype); + + // do the call __ profile_final_call(Z_tmp_2); __ profile_arguments_type(Z_tmp_2, method, Z_ARG5, true); @@ -3634,7 +3644,7 @@ // java.lang.Object. See cpCacheOop.cpp for details. // This code isn't produced by javac, but could be produced by // another compliant java compiler. - NearLabel notMethod, no_such_interface, no_such_method; + NearLabel notMethod, no_such_method; __ testbit(flags, ConstantPoolCacheEntry::is_forced_virtual_shift); __ z_brz(notMethod); invokevirtual_helper(method, receiver, flags);