8206459: [s390] Prevent restoring incorrect bcp and locals in interpreter and avoid incorrect size of partialSubtypeCheckNode in C2
authormdoerr
Mon, 09 Jul 2018 15:26:58 +0200
changeset 51009 44b07bd68f6d
parent 51008 8df91a1b549b
child 51010 29be48779807
8206459: [s390] Prevent restoring incorrect bcp and locals in interpreter and avoid incorrect size of partialSubtypeCheckNode in C2 Reviewed-by: goetz
src/hotspot/cpu/s390/s390.ad
src/hotspot/cpu/s390/templateTable_s390.cpp
--- a/src/hotspot/cpu/s390/s390.ad	Mon Jul 09 09:38:11 2018 +0100
+++ b/src/hotspot/cpu/s390/s390.ad	Mon Jul 09 15:26:58 2018 +0200
@@ -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());
--- a/src/hotspot/cpu/s390/templateTable_s390.cpp	Mon Jul 09 09:38:11 2018 +0100
+++ b/src/hotspot/cpu/s390/templateTable_s390.cpp	Mon Jul 09 15:26:58 2018 +0200
@@ -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,