< prev index next >

src/cpu/x86/vm/sharedRuntime_x86_64.cpp

Print this page


   1 /*
   2  * Copyright (c) 2003, 2017, Oracle and/or its affiliates. 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *


2562     __ bind(unlock_done);
2563     if (ret_type != T_FLOAT && ret_type != T_DOUBLE && ret_type != T_VOID) {
2564       restore_native_result(masm, ret_type, stack_slots);
2565     }
2566 
2567     __ bind(done);
2568 
2569   }
2570   {
2571     SkipIfEqual skip(masm, &DTraceMethodProbes, false);
2572     save_native_result(masm, ret_type, stack_slots);
2573     __ mov_metadata(c_rarg1, method());
2574     __ call_VM_leaf(
2575          CAST_FROM_FN_PTR(address, SharedRuntime::dtrace_method_exit),
2576          r15_thread, c_rarg1);
2577     restore_native_result(masm, ret_type, stack_slots);
2578   }
2579 
2580   __ reset_last_Java_frame(false);
2581 
2582   // Unbox oop result, e.g. JNIHandles::resolve value.
2583   if (ret_type == T_OBJECT || ret_type == T_ARRAY) {
2584     __ resolve_jobject(rax /* value */,
2585                        r15_thread /* thread */,
2586                        rcx /* tmp */);



2587   }
2588 
2589   if (CheckJNICalls) {
2590     // clear_pending_jni_exception_check
2591     __ movptr(Address(r15_thread, JavaThread::pending_jni_exception_check_fn_offset()), NULL_WORD);
2592   }
2593 
2594   if (!is_critical_native) {
2595     // reset handle block
2596     __ movptr(rcx, Address(r15_thread, JavaThread::active_handles_offset()));
2597     __ movl(Address(rcx, JNIHandleBlock::top_offset_in_bytes()), (int32_t)NULL_WORD);
2598   }
2599 
2600   // pop our frame
2601 
2602   __ leave();
2603 
2604   if (!is_critical_native) {
2605     // Any exception pending?
2606     __ cmpptr(Address(r15_thread, in_bytes(Thread::pending_exception_offset())), (int32_t)NULL_WORD);


   1 /*
   2  * Copyright (c) 2003, 2016, Oracle and/or its affiliates. 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *


2562     __ bind(unlock_done);
2563     if (ret_type != T_FLOAT && ret_type != T_DOUBLE && ret_type != T_VOID) {
2564       restore_native_result(masm, ret_type, stack_slots);
2565     }
2566 
2567     __ bind(done);
2568 
2569   }
2570   {
2571     SkipIfEqual skip(masm, &DTraceMethodProbes, false);
2572     save_native_result(masm, ret_type, stack_slots);
2573     __ mov_metadata(c_rarg1, method());
2574     __ call_VM_leaf(
2575          CAST_FROM_FN_PTR(address, SharedRuntime::dtrace_method_exit),
2576          r15_thread, c_rarg1);
2577     restore_native_result(masm, ret_type, stack_slots);
2578   }
2579 
2580   __ reset_last_Java_frame(false);
2581 
2582   // Unpack oop result
2583   if (ret_type == T_OBJECT || ret_type == T_ARRAY) {
2584       Label L;
2585       __ testptr(rax, rax);
2586       __ jcc(Assembler::zero, L);
2587       __ movptr(rax, Address(rax, 0));
2588       __ bind(L);
2589       __ verify_oop(rax);
2590   }
2591 
2592   if (CheckJNICalls) {
2593     // clear_pending_jni_exception_check
2594     __ movptr(Address(r15_thread, JavaThread::pending_jni_exception_check_fn_offset()), NULL_WORD);
2595   }
2596 
2597   if (!is_critical_native) {
2598     // reset handle block
2599     __ movptr(rcx, Address(r15_thread, JavaThread::active_handles_offset()));
2600     __ movl(Address(rcx, JNIHandleBlock::top_offset_in_bytes()), (int32_t)NULL_WORD);
2601   }
2602 
2603   // pop our frame
2604 
2605   __ leave();
2606 
2607   if (!is_critical_native) {
2608     // Any exception pending?
2609     __ cmpptr(Address(r15_thread, in_bytes(Thread::pending_exception_offset())), (int32_t)NULL_WORD);


< prev index next >