changeset 51820:08c3167e2d22

8205581: PPC64: RTM: Fix abort on native calls Reviewed-by: mdoerr, goetz
author gromero
date Tue, 26 Jun 2018 08:33:17 -0400
parents 04764dc834d0
children a1a53d240353
files src/hotspot/cpu/ppc/sharedRuntime_ppc.cpp
diffstat 1 files changed, 19 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/hotspot/cpu/ppc/sharedRuntime_ppc.cpp	Sun Jun 24 21:48:42 2018 -0400
+++ b/src/hotspot/cpu/ppc/sharedRuntime_ppc.cpp	Tue Jun 26 08:33:17 2018 -0400
@@ -2029,6 +2029,13 @@
   // --------------------------------------------------------------------------
   vep_start_pc = (intptr_t)__ pc();
 
+  if (UseRTMLocking) {
+    // Abort RTM transaction before calling JNI
+    // because critical section can be large and
+    // abort anyway. Also nmethod can be deoptimized.
+    __ tabort_();
+  }
+
   __ save_LR_CR(r_temp_1);
   __ generate_stack_overflow_check(frame_size_in_bytes); // Check before creating frame.
   __ mr(r_callers_sp, R1_SP);                            // Remember frame pointer.
@@ -2947,6 +2954,11 @@
   InterpreterMacroAssembler* masm = new InterpreterMacroAssembler(&buffer);
   address start = __ pc();
 
+  if (UseRTMLocking) {
+    // Abort RTM transaction before possible nmethod deoptimization.
+    __ tabort_();
+  }
+
   Register unroll_block_reg = R21_tmp1;
   Register klass_index_reg  = R22_tmp2;
   Register unc_trap_reg     = R23_tmp3;
@@ -3090,6 +3102,13 @@
     return_pc_location = RegisterSaver::return_pc_is_thread_saved_exception_pc;
   }
 
+  if (UseRTMLocking) {
+    // Abort RTM transaction before calling runtime
+    // because critical section can be large and so
+    // will abort anyway. Also nmethod can be deoptimized.
+    __ tabort_();
+  }
+
   // Save registers, fpu state, and flags. Set R31 = return pc.
   map = RegisterSaver::push_frame_reg_args_and_save_live_registers(masm,
                                                                    &frame_size_in_bytes,