# HG changeset patch # User mdoerr # Date 1530880794 -7200 # Fri Jul 06 14:39:54 2018 +0200 # Node ID 984b4c6b57f7842fcad3a25130fc5f8b69e204d8 # Parent f8038b878d27970fbe5d958382a0d9dfb1832f94 8206459: [s390] Prevent restoring incorrect bcp and locals in interpreter and avoid incorrect size of partialSubtypeCheckNode in C2 Reviewed-by: diff --git a/src/hotspot/cpu/s390/s390.ad b/src/hotspot/cpu/s390/s390.ad --- a/src/hotspot/cpu/s390/s390.ad +++ b/src/hotspot/cpu/s390/s390.ad @@ -9839,7 +9839,7 @@ match(Set index (PartialSubtypeCheck sub super)); effect(KILL pcc, KILL scratch1, KILL scratch2); ins_cost(10 * DEFAULT_COST); - size(12); + // TODO: s390 port size(FIXED_SIZE); format %{ " CALL PartialSubtypeCheck\n" %} ins_encode %{ AddressLiteral stub_address(StubRoutines::zarch::partial_subtype_check()); diff --git a/src/hotspot/cpu/s390/templateTable_s390.cpp b/src/hotspot/cpu/s390/templateTable_s390.cpp --- a/src/hotspot/cpu/s390/templateTable_s390.cpp +++ b/src/hotspot/cpu/s390/templateTable_s390.cpp @@ -3636,7 +3636,7 @@ NearLabel subtype, no_such_interface; - __ check_klass_subtype(klass, interface, Z_tmp_2, Z_tmp_3, subtype); + __ check_klass_subtype(klass, interface, Z_tmp_2, flags/*scratch*/, subtype); // If we get here the typecheck failed __ z_bru(no_such_interface); __ bind(subtype); @@ -3649,7 +3649,6 @@ __ bind(notVFinal); // Get receiver klass into klass - also a null check. - __ restore_locals(); __ load_klass(klass, receiver); __ lookup_interface_method(klass, interface, noreg, noreg, /*temp*/Z_ARG1, @@ -3680,7 +3679,7 @@ // interpreter entry point and a conditional jump to it in case of a null // method. __ compareU64_and_branch(method2, (intptr_t) 0, - Assembler::bcondZero, no_such_method); + Assembler::bcondZero, no_such_method); __ profile_arguments_type(Z_tmp_1, method2, Z_tmp_2, true); @@ -3695,8 +3694,6 @@ __ bind(no_such_method); // Throw exception. - __ restore_bcp(); // Bcp must be correct for exception handler (was destroyed). - __ restore_locals(); // Make sure locals pointer is correct as well (was destroyed). // Pass arguments for generating a verbose error message. __ z_lgr(Z_tmp_1, method); // Prevent register clash. __ call_VM(noreg, @@ -3709,8 +3706,6 @@ __ bind(no_such_interface); // Throw exception. - __ restore_bcp(); // Bcp must be correct for exception handler (was destroyed). - __ restore_locals(); // Make sure locals pointer is correct as well (was destroyed). // Pass arguments for generating a verbose error message. __ call_VM(noreg, CAST_FROM_FN_PTR(address,