1 /*
2 * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
3 * Copyright (c) 2012, 2016 SAP SE. All rights reserved.
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 *
6 * This code is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License version 2 only, as
8 * published by the Free Software Foundation.
9 *
10 * This code is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 * version 2 for more details (a copy is included in the LICENSE file that
14 * accompanied this code).
15 *
16 * You should have received a copy of the GNU General Public License version
17 * 2 along with this work; if not, write to the Free Software Foundation,
18 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
19 *
20 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
21 * or visit www.oracle.com if you need additional information or have any
22 * questions.
23 *
2460
2461 // Check_forward_pending_exception jump to forward_exception if any pending
2462 // exception is set. The forward_exception routine expects to see the
2463 // exception in pending_exception and not in a register. Kind of clumsy,
2464 // since all folks who branch to forward_exception must have tested
2465 // pending_exception first and hence have it in a register already.
2466 __ std(r_exception, thread_(pending_exception));
2467
2468 __ bind(done);
2469 }
2470
2471 # if 0
2472 // DTrace method exit
2473 # endif
2474
2475 // Clear "last Java frame" SP and PC.
2476 // --------------------------------------------------------------------------
2477
2478 __ reset_last_Java_frame();
2479
2480 // Unpack oop result.
2481 // --------------------------------------------------------------------------
2482
2483 if (ret_type == T_OBJECT || ret_type == T_ARRAY) {
2484 Label skip_unboxing;
2485 __ cmpdi(CCR0, R3_RET, 0);
2486 __ beq(CCR0, skip_unboxing);
2487 __ ld(R3_RET, 0, R3_RET);
2488 __ bind(skip_unboxing);
2489 __ verify_oop(R3_RET);
2490 }
2491
2492 if (CheckJNICalls) {
2493 // clear_pending_jni_exception_check
2494 __ load_const_optimized(R0, 0L);
2495 __ st_ptr(R0, JavaThread::pending_jni_exception_check_fn_offset(), R16_thread);
2496 }
2497
2498 // Reset handle block.
2499 // --------------------------------------------------------------------------
2500 if (!is_critical_native) {
2501 __ ld(r_temp_1, thread_(active_handles));
2502 // TODO: PPC port assert(4 == JNIHandleBlock::top_size_in_bytes(), "unexpected field size");
2503 __ li(r_temp_2, 0);
2504 __ stw(r_temp_2, JNIHandleBlock::top_offset_in_bytes(), r_temp_1);
2505
2506
2507 // Check for pending exceptions.
2508 // --------------------------------------------------------------------------
2509 __ ld(r_temp_2, thread_(pending_exception));
|
1 /*
2 * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
3 * Copyright (c) 2012, 2017 SAP SE. All rights reserved.
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 *
6 * This code is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License version 2 only, as
8 * published by the Free Software Foundation.
9 *
10 * This code is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 * version 2 for more details (a copy is included in the LICENSE file that
14 * accompanied this code).
15 *
16 * You should have received a copy of the GNU General Public License version
17 * 2 along with this work; if not, write to the Free Software Foundation,
18 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
19 *
20 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
21 * or visit www.oracle.com if you need additional information or have any
22 * questions.
23 *
2460
2461 // Check_forward_pending_exception jump to forward_exception if any pending
2462 // exception is set. The forward_exception routine expects to see the
2463 // exception in pending_exception and not in a register. Kind of clumsy,
2464 // since all folks who branch to forward_exception must have tested
2465 // pending_exception first and hence have it in a register already.
2466 __ std(r_exception, thread_(pending_exception));
2467
2468 __ bind(done);
2469 }
2470
2471 # if 0
2472 // DTrace method exit
2473 # endif
2474
2475 // Clear "last Java frame" SP and PC.
2476 // --------------------------------------------------------------------------
2477
2478 __ reset_last_Java_frame();
2479
2480 // Unbox oop result, e.g. JNIHandles::resolve value.
2481 // --------------------------------------------------------------------------
2482
2483 if (ret_type == T_OBJECT || ret_type == T_ARRAY) {
2484 __ resolve_jobject(R3_RET, r_temp_1, r_temp_2, /* needs_frame */ false); // kills R31
2485 }
2486
2487 if (CheckJNICalls) {
2488 // clear_pending_jni_exception_check
2489 __ load_const_optimized(R0, 0L);
2490 __ st_ptr(R0, JavaThread::pending_jni_exception_check_fn_offset(), R16_thread);
2491 }
2492
2493 // Reset handle block.
2494 // --------------------------------------------------------------------------
2495 if (!is_critical_native) {
2496 __ ld(r_temp_1, thread_(active_handles));
2497 // TODO: PPC port assert(4 == JNIHandleBlock::top_size_in_bytes(), "unexpected field size");
2498 __ li(r_temp_2, 0);
2499 __ stw(r_temp_2, JNIHandleBlock::top_offset_in_bytes(), r_temp_1);
2500
2501
2502 // Check for pending exceptions.
2503 // --------------------------------------------------------------------------
2504 __ ld(r_temp_2, thread_(pending_exception));
|