changeset 12086:16e8d5342f7d

8166777: [ppc] port "8164086: Checked JNI pending exception check should be cleared" Reviewed-by: fparain, dholmes
author goetz
date Tue, 27 Sep 2016 15:45:44 +0200
parents 776d89e316b6
children 8899d50bd985
files src/cpu/ppc/vm/assembler_ppc.hpp src/cpu/ppc/vm/assembler_ppc.inline.hpp src/cpu/ppc/vm/sharedRuntime_ppc.cpp src/cpu/ppc/vm/templateInterpreterGenerator_ppc.cpp
diffstat 4 files changed, 17 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/cpu/ppc/vm/assembler_ppc.hpp	Wed Sep 28 11:58:56 2016 +0530
+++ b/src/cpu/ppc/vm/assembler_ppc.hpp	Tue Sep 27 15:45:44 2016 +0200
@@ -1575,6 +1575,9 @@
   inline void stdu( Register d, int si16,    Register s1);
   inline void stdux(Register s, Register a,  Register b);
 
+  inline void st_ptr(Register d, int si16,    Register s1);
+  DEBUG_ONLY(inline void st_ptr(Register d, ByteSize b, Register s1);)
+
   // PPC 1, section 3.3.13 Move To/From System Register Instructions
   inline void mtlr( Register s1);
   inline void mflr( Register d);
--- a/src/cpu/ppc/vm/assembler_ppc.inline.hpp	Wed Sep 28 11:58:56 2016 +0530
+++ b/src/cpu/ppc/vm/assembler_ppc.inline.hpp	Tue Sep 27 15:45:44 2016 +0200
@@ -349,6 +349,9 @@
 inline void Assembler::stdu( Register d, int si16,    Register s1) { emit_int32(STDU_OPCODE | rs(d) | ds(si16)   | rta0mem(s1));}
 inline void Assembler::stdux(Register s, Register a,  Register b)  { emit_int32(STDUX_OPCODE| rs(s) | rta0mem(a) | rb(b));}
 
+inline void Assembler::st_ptr(Register d, int b, Register s1) { std(d, b, s1); }
+DEBUG_ONLY(inline void Assembler::st_ptr(Register d, ByteSize b, Register s1) { std(d, in_bytes(b), s1); })
+
 // PPC 1, section 3.3.13 Move To/From System Register Instructions
 inline void Assembler::mtlr( Register s1)         { emit_int32(MTLR_OPCODE  | rs(s1)); }
 inline void Assembler::mflr( Register d )         { emit_int32(MFLR_OPCODE  | rt(d)); }
--- a/src/cpu/ppc/vm/sharedRuntime_ppc.cpp	Wed Sep 28 11:58:56 2016 +0530
+++ b/src/cpu/ppc/vm/sharedRuntime_ppc.cpp	Tue Sep 27 15:45:44 2016 +0200
@@ -2489,6 +2489,11 @@
     __ verify_oop(R3_RET);
   }
 
+  if (CheckJNICalls) {
+    // clear_pending_jni_exception_check
+    __ load_const_optimized(R0, 0L);
+    __ st_ptr(R0, JavaThread::pending_jni_exception_check_fn_offset(), R16_thread);
+  }
 
   // Reset handle block.
   // --------------------------------------------------------------------------
--- a/src/cpu/ppc/vm/templateInterpreterGenerator_ppc.cpp	Wed Sep 28 11:58:56 2016 +0530
+++ b/src/cpu/ppc/vm/templateInterpreterGenerator_ppc.cpp	Tue Sep 27 15:45:44 2016 +0200
@@ -1544,6 +1544,12 @@
     __ fence();
   }
 
+  if (CheckJNICalls) {
+    // clear_pending_jni_exception_check
+    __ load_const_optimized(R0, 0L);
+    __ st_ptr(R0, JavaThread::pending_jni_exception_check_fn_offset(), R16_thread);
+  }
+
   __ reset_last_Java_frame();
 
   // Jvmdi/jvmpi support. Whether we've got an exception pending or