< prev index next >

src/cpu/ppc/vm/templateInterpreterGenerator_ppc.cpp

Print this page
rev 12060 : 8166777: [ppc] port "8164086: Checked JNI pending exception check should be cleared"


1527   // native methods it assumes that the non-FPU/non-void result is
1528   // saved in _native_lresult and a FPU result in _native_fresult. If
1529   // this changes then the interpreter_frame_result implementation
1530   // will need to be updated too.
1531 
1532   // On PPC64, we have stored the result directly after the native call.
1533 
1534   //=============================================================================
1535   // Back in Java
1536 
1537   // We use release_store_fence to update values like the thread state, where
1538   // we don't want the current thread to continue until all our prior memory
1539   // accesses (including the new thread state) are visible to other threads.
1540   __ li(R0/*thread_state*/, _thread_in_Java);
1541   __ release();
1542   __ stw(R0/*thread_state*/, thread_(thread_state));
1543   if (UseMembar) {
1544     __ fence();
1545   }
1546 






1547   __ reset_last_Java_frame();
1548 
1549   // Jvmdi/jvmpi support. Whether we've got an exception pending or
1550   // not, and whether unlocking throws an exception or not, we notify
1551   // on native method exit. If we do have an exception, we'll end up
1552   // in the caller's context to handle it, so if we don't do the
1553   // notify here, we'll drop it on the floor.
1554   __ notify_method_exit(true/*native method*/,
1555                         ilgl /*illegal state (not used for native methods)*/,
1556                         InterpreterMacroAssembler::NotifyJVMTI,
1557                         false /*check_exceptions*/);
1558 
1559   //=============================================================================
1560   // Handle exceptions
1561 
1562   if (synchronized) {
1563     // Don't check for exceptions since we're still in the i2n frame. Do that
1564     // manually afterwards.
1565     __ unlock_object(R26_monitor, false); // Can also unlock methods.
1566   }




1527   // native methods it assumes that the non-FPU/non-void result is
1528   // saved in _native_lresult and a FPU result in _native_fresult. If
1529   // this changes then the interpreter_frame_result implementation
1530   // will need to be updated too.
1531 
1532   // On PPC64, we have stored the result directly after the native call.
1533 
1534   //=============================================================================
1535   // Back in Java
1536 
1537   // We use release_store_fence to update values like the thread state, where
1538   // we don't want the current thread to continue until all our prior memory
1539   // accesses (including the new thread state) are visible to other threads.
1540   __ li(R0/*thread_state*/, _thread_in_Java);
1541   __ release();
1542   __ stw(R0/*thread_state*/, thread_(thread_state));
1543   if (UseMembar) {
1544     __ fence();
1545   }
1546 
1547   if (CheckJNICalls) {
1548     // clear_pending_jni_exception_check
1549     __ load_const_optimized(R0, 0L);
1550     __ st_ptr(R0, JavaThread::pending_jni_exception_check_fn_offset(), R16_thread);
1551   }
1552 
1553   __ reset_last_Java_frame();
1554 
1555   // Jvmdi/jvmpi support. Whether we've got an exception pending or
1556   // not, and whether unlocking throws an exception or not, we notify
1557   // on native method exit. If we do have an exception, we'll end up
1558   // in the caller's context to handle it, so if we don't do the
1559   // notify here, we'll drop it on the floor.
1560   __ notify_method_exit(true/*native method*/,
1561                         ilgl /*illegal state (not used for native methods)*/,
1562                         InterpreterMacroAssembler::NotifyJVMTI,
1563                         false /*check_exceptions*/);
1564 
1565   //=============================================================================
1566   // Handle exceptions
1567 
1568   if (synchronized) {
1569     // Don't check for exceptions since we're still in the i2n frame. Do that
1570     // manually afterwards.
1571     __ unlock_object(R26_monitor, false); // Can also unlock methods.
1572   }


< prev index next >