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
1567 }
1568
1569 // Reset active handles after returning from native.
1570 // thread->active_handles()->clear();
1571 __ ld(active_handles, thread_(active_handles));
1572 // TODO PPC port assert(4 == JNIHandleBlock::top_size_in_bytes(), "unexpected field size");
1573 __ li(R0, 0);
1574 __ stw(R0, JNIHandleBlock::top_offset_in_bytes(), active_handles);
1575
1576 Label exception_return_sync_check_already_unlocked;
1577 __ ld(R0/*pending_exception*/, thread_(pending_exception));
1578 __ cmpdi(CCR0, R0/*pending_exception*/, 0);
1579 __ bne(CCR0, exception_return_sync_check_already_unlocked);
1580
1581 //-----------------------------------------------------------------------------
1582 // No exception pending.
1583
1584 // Move native method result back into proper registers and return.
1585 // Invoke result handler (may unbox/promote).
1586 __ ld(R11_scratch1, 0, R1_SP);
|
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 }
1567
1568 // Reset active handles after returning from native.
1569 // thread->active_handles()->clear();
1570 __ ld(active_handles, thread_(active_handles));
1571 // TODO PPC port assert(4 == JNIHandleBlock::top_size_in_bytes(), "unexpected field size");
1572 __ li(R0, 0);
1573 __ stw(R0, JNIHandleBlock::top_offset_in_bytes(), active_handles);
1574
1575 Label exception_return_sync_check_already_unlocked;
1576 __ ld(R0/*pending_exception*/, thread_(pending_exception));
1577 __ cmpdi(CCR0, R0/*pending_exception*/, 0);
1578 __ bne(CCR0, exception_return_sync_check_already_unlocked);
1579
1580 //-----------------------------------------------------------------------------
1581 // No exception pending.
1582
1583 // Move native method result back into proper registers and return.
1584 // Invoke result handler (may unbox/promote).
1585 __ ld(R11_scratch1, 0, R1_SP);
|