1679 |
1679 |
1680 // Reset handle block. |
1680 // Reset handle block. |
1681 __ z_lg(Z_R1/*active_handles*/, thread_(active_handles)); |
1681 __ z_lg(Z_R1/*active_handles*/, thread_(active_handles)); |
1682 __ clear_mem(Address(Z_R1, JNIHandleBlock::top_offset_in_bytes()), 4); |
1682 __ clear_mem(Address(Z_R1, JNIHandleBlock::top_offset_in_bytes()), 4); |
1683 |
1683 |
1684 // Bandle exceptions (exception handling will handle unlocking!). |
1684 // Handle exceptions (exception handling will handle unlocking!). |
1685 { |
1685 { |
1686 Label L; |
1686 Label L; |
1687 __ load_and_test_long(Z_R0/*pending_exception*/, thread_(pending_exception)); |
1687 __ load_and_test_long(Z_R0/*pending_exception*/, thread_(pending_exception)); |
1688 __ z_bre(L); |
1688 __ z_bre(L); |
1689 __ MacroAssembler::call_VM(noreg, |
1689 __ MacroAssembler::call_VM(noreg, |
1708 |
1708 |
1709 // JVMTI support. Result has already been saved above to the frame. |
1709 // JVMTI support. Result has already been saved above to the frame. |
1710 __ notify_method_exit(true/*native_method*/, ilgl, InterpreterMacroAssembler::NotifyJVMTI); |
1710 __ notify_method_exit(true/*native_method*/, ilgl, InterpreterMacroAssembler::NotifyJVMTI); |
1711 |
1711 |
1712 // Move native method result back into proper registers and return. |
1712 // Move native method result back into proper registers and return. |
1713 // C++ interpreter does not use result handler. So do we need to here? TODO(ZASM): check if correct. |
|
1714 { NearLabel no_oop_or_null; |
|
1715 __ mem2freg_opt(Z_FRET, Address(Z_fp, _z_ijava_state_neg(fresult))); |
1713 __ mem2freg_opt(Z_FRET, Address(Z_fp, _z_ijava_state_neg(fresult))); |
1716 __ load_and_test_long(Z_RET, Address(Z_fp, _z_ijava_state_neg(lresult))); |
1714 __ mem2reg_opt(Z_RET, Address(Z_fp, _z_ijava_state_neg(lresult))); |
1717 __ z_bre(no_oop_or_null); // No unboxing if the result is NULL. |
1715 __ call_stub(Rresult_handler); |
1718 __ load_absolute_address(Z_R1, AbstractInterpreter::result_handler(T_OBJECT)); |
|
1719 __ compareU64_and_branch(Z_R1, Rresult_handler, Assembler::bcondNotEqual, no_oop_or_null); |
|
1720 __ z_lg(Z_RET, oop_tmp_offset, Z_fp); |
|
1721 __ verify_oop(Z_RET); |
|
1722 __ bind(no_oop_or_null); |
|
1723 } |
|
1724 |
1716 |
1725 // Pop the native method's interpreter frame. |
1717 // Pop the native method's interpreter frame. |
1726 __ pop_interpreter_frame(Z_R14 /*return_pc*/, Z_ARG2/*tmp1*/, Z_ARG3/*tmp2*/); |
1718 __ pop_interpreter_frame(Z_R14 /*return_pc*/, Z_ARG2/*tmp1*/, Z_ARG3/*tmp2*/); |
1727 |
1719 |
1728 // Return to caller. |
1720 // Return to caller. |