# HG changeset patch # User goetz # Date 1474983944 -7200 # Node ID 9358c2e1644627b32bceccdc444650cc27ed2dc5 # Parent 64703e04389c57e886c6a1b94cd537f1fa40509c 8166777: [ppc] port "8164086: Checked JNI pending exception check should be cleared" Reviewed-by: fparain, dholmes diff -r 64703e04389c -r 9358c2e16446 hotspot/src/cpu/ppc/vm/assembler_ppc.hpp --- a/hotspot/src/cpu/ppc/vm/assembler_ppc.hpp Wed Sep 28 11:58:56 2016 +0530 +++ b/hotspot/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); diff -r 64703e04389c -r 9358c2e16446 hotspot/src/cpu/ppc/vm/assembler_ppc.inline.hpp --- a/hotspot/src/cpu/ppc/vm/assembler_ppc.inline.hpp Wed Sep 28 11:58:56 2016 +0530 +++ b/hotspot/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)); } diff -r 64703e04389c -r 9358c2e16446 hotspot/src/cpu/ppc/vm/sharedRuntime_ppc.cpp --- a/hotspot/src/cpu/ppc/vm/sharedRuntime_ppc.cpp Wed Sep 28 11:58:56 2016 +0530 +++ b/hotspot/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. // -------------------------------------------------------------------------- diff -r 64703e04389c -r 9358c2e16446 hotspot/src/cpu/ppc/vm/templateInterpreterGenerator_ppc.cpp --- a/hotspot/src/cpu/ppc/vm/templateInterpreterGenerator_ppc.cpp Wed Sep 28 11:58:56 2016 +0530 +++ b/hotspot/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