1 /*
2 * Copyright 1997-2009 Sun Microsystems, Inc. All Rights Reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
20 * CA 95054 USA or visit www.sun.com if you need additional information or
21 * have any questions.
22 *
1805 // the following registers set up:
1806 //
1807 // Oexception: exception
1808 // Oissuing_pc: the local call that threw exception
1809 // Other On: garbage
1810 // In/Ln: the contents of the caller's register window
1811 //
1812 // We do the required restore at the last possible moment, because we
1813 // need to preserve some state across a runtime call.
1814 // (Remember that the caller activation is unknown--it might not be
1815 // interpreted, so things like Lscratch are useless in the caller.)
1816
1817 // Although the Intel version uses call_C, we can use the more
1818 // compact call_VM. (The only real difference on SPARC is a
1819 // harmlessly ignored [re]set_last_Java_frame, compared with
1820 // the Intel code which lacks this.)
1821 __ mov(Oexception, Oexception ->after_save()); // get exception in I0 so it will be on O0 after restore
1822 __ add(issuing_pc_addr, Oissuing_pc->after_save()); // likewise set I1 to a value local to the caller
1823 __ super_call_VM_leaf(L7_thread_cache,
1824 CAST_FROM_FN_PTR(address, SharedRuntime::exception_handler_for_return_address),
1825 Oissuing_pc->after_save());
1826
1827 // The caller's SP was adjusted upon method entry to accomodate
1828 // the callee's non-argument locals. Undo that adjustment.
1829 __ JMP(O0, 0); // return exception handler in caller
1830 __ delayed()->restore(I5_savedSP, G0, SP);
1831
1832 // (same old exception object is already in Oexception; see above)
1833 // Note that an "issuing PC" is actually the next PC after the call
1834 }
1835
1836
1837 //
1838 // JVMTI ForceEarlyReturn support
1839 //
1840
1841 address TemplateInterpreterGenerator::generate_earlyret_entry_for(TosState state) {
1842 address entry = __ pc();
1843
1844 __ empty_expression_stack();
1845 __ load_earlyret_value(state);
|
1 /*
2 * Copyright 1997-2010 Sun Microsystems, Inc. All Rights Reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
20 * CA 95054 USA or visit www.sun.com if you need additional information or
21 * have any questions.
22 *
1805 // the following registers set up:
1806 //
1807 // Oexception: exception
1808 // Oissuing_pc: the local call that threw exception
1809 // Other On: garbage
1810 // In/Ln: the contents of the caller's register window
1811 //
1812 // We do the required restore at the last possible moment, because we
1813 // need to preserve some state across a runtime call.
1814 // (Remember that the caller activation is unknown--it might not be
1815 // interpreted, so things like Lscratch are useless in the caller.)
1816
1817 // Although the Intel version uses call_C, we can use the more
1818 // compact call_VM. (The only real difference on SPARC is a
1819 // harmlessly ignored [re]set_last_Java_frame, compared with
1820 // the Intel code which lacks this.)
1821 __ mov(Oexception, Oexception ->after_save()); // get exception in I0 so it will be on O0 after restore
1822 __ add(issuing_pc_addr, Oissuing_pc->after_save()); // likewise set I1 to a value local to the caller
1823 __ super_call_VM_leaf(L7_thread_cache,
1824 CAST_FROM_FN_PTR(address, SharedRuntime::exception_handler_for_return_address),
1825 G2_thread, Oissuing_pc->after_save());
1826
1827 // The caller's SP was adjusted upon method entry to accomodate
1828 // the callee's non-argument locals. Undo that adjustment.
1829 __ JMP(O0, 0); // return exception handler in caller
1830 __ delayed()->restore(I5_savedSP, G0, SP);
1831
1832 // (same old exception object is already in Oexception; see above)
1833 // Note that an "issuing PC" is actually the next PC after the call
1834 }
1835
1836
1837 //
1838 // JVMTI ForceEarlyReturn support
1839 //
1840
1841 address TemplateInterpreterGenerator::generate_earlyret_entry_for(TosState state) {
1842 address entry = __ pc();
1843
1844 __ empty_expression_stack();
1845 __ load_earlyret_value(state);
|