src/cpu/x86/vm/sharedRuntime_x86_64.cpp

Print this page


   1 /*
   2  * Copyright (c) 2003, 2013, 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  *


2564     __ bind(L);
2565     }
2566 #endif
2567     __ jmp(lock_done);
2568 
2569     // END Slow path lock
2570 
2571     // BEGIN Slow path unlock
2572     __ bind(slow_path_unlock);
2573 
2574     // If we haven't already saved the native result we must save it now as xmm registers
2575     // are still exposed.
2576 
2577     if (ret_type == T_FLOAT || ret_type == T_DOUBLE ) {
2578       save_native_result(masm, ret_type, stack_slots);
2579     }
2580 
2581     __ lea(c_rarg1, Address(rsp, lock_slot_offset * VMRegImpl::stack_slot_size));
2582 
2583     __ mov(c_rarg0, obj_reg);

2584     __ mov(r12, rsp); // remember sp
2585     __ subptr(rsp, frame::arg_reg_save_area_bytes); // windows
2586     __ andptr(rsp, -16); // align stack as required by ABI
2587 
2588     // Save pending exception around call to VM (which contains an EXCEPTION_MARK)
2589     // NOTE that obj_reg == rbx currently
2590     __ movptr(rbx, Address(r15_thread, in_bytes(Thread::pending_exception_offset())));
2591     __ movptr(Address(r15_thread, in_bytes(Thread::pending_exception_offset())), (int32_t)NULL_WORD);
2592 

2593     __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, SharedRuntime::complete_monitor_unlocking_C)));
2594     __ mov(rsp, r12); // restore sp
2595     __ reinit_heapbase();
2596 #ifdef ASSERT
2597     {
2598       Label L;
2599       __ cmpptr(Address(r15_thread, in_bytes(Thread::pending_exception_offset())), (int)NULL_WORD);
2600       __ jcc(Assembler::equal, L);
2601       __ stop("no pending exception allowed on exit complete_monitor_unlocking_C");
2602       __ bind(L);
2603     }
2604 #endif /* ASSERT */
2605 
2606     __ movptr(Address(r15_thread, in_bytes(Thread::pending_exception_offset())), rbx);
2607 
2608     if (ret_type == T_FLOAT || ret_type == T_DOUBLE ) {
2609       restore_native_result(masm, ret_type, stack_slots);
2610     }
2611     __ jmp(unlock_done);
2612 


   1 /*
   2  * Copyright (c) 2003, 2015, 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  *


2564     __ bind(L);
2565     }
2566 #endif
2567     __ jmp(lock_done);
2568 
2569     // END Slow path lock
2570 
2571     // BEGIN Slow path unlock
2572     __ bind(slow_path_unlock);
2573 
2574     // If we haven't already saved the native result we must save it now as xmm registers
2575     // are still exposed.
2576 
2577     if (ret_type == T_FLOAT || ret_type == T_DOUBLE ) {
2578       save_native_result(masm, ret_type, stack_slots);
2579     }
2580 
2581     __ lea(c_rarg1, Address(rsp, lock_slot_offset * VMRegImpl::stack_slot_size));
2582 
2583     __ mov(c_rarg0, obj_reg);
2584     __ mov(c_rarg2, r15_thread);
2585     __ mov(r12, rsp); // remember sp
2586     __ subptr(rsp, frame::arg_reg_save_area_bytes); // windows
2587     __ andptr(rsp, -16); // align stack as required by ABI
2588 
2589     // Save pending exception around call to VM (which contains an EXCEPTION_MARK)
2590     // NOTE that obj_reg == rbx currently
2591     __ movptr(rbx, Address(r15_thread, in_bytes(Thread::pending_exception_offset())));
2592     __ movptr(Address(r15_thread, in_bytes(Thread::pending_exception_offset())), (int32_t)NULL_WORD);
2593 
2594     // args are (oop obj, BasicLock* lock, JavaThread* thread)
2595     __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, SharedRuntime::complete_monitor_unlocking_C)));
2596     __ mov(rsp, r12); // restore sp
2597     __ reinit_heapbase();
2598 #ifdef ASSERT
2599     {
2600       Label L;
2601       __ cmpptr(Address(r15_thread, in_bytes(Thread::pending_exception_offset())), (int)NULL_WORD);
2602       __ jcc(Assembler::equal, L);
2603       __ stop("no pending exception allowed on exit complete_monitor_unlocking_C");
2604       __ bind(L);
2605     }
2606 #endif /* ASSERT */
2607 
2608     __ movptr(Address(r15_thread, in_bytes(Thread::pending_exception_offset())), rbx);
2609 
2610     if (ret_type == T_FLOAT || ret_type == T_DOUBLE ) {
2611       restore_native_result(masm, ret_type, stack_slots);
2612     }
2613     __ jmp(unlock_done);
2614