1.1 --- a/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp Wed Oct 23 12:40:23 2013 +0200 1.2 +++ b/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp Wed Oct 23 11:15:24 2013 -0700 1.3 @@ -432,15 +432,16 @@ 1.4 int offset = code_offset(); 1.5 1.6 // Fetch the exception from TLS and clear out exception related thread state 1.7 - __ get_thread(rsi); 1.8 - __ movptr(rax, Address(rsi, JavaThread::exception_oop_offset())); 1.9 - __ movptr(Address(rsi, JavaThread::exception_oop_offset()), (intptr_t)NULL_WORD); 1.10 - __ movptr(Address(rsi, JavaThread::exception_pc_offset()), (intptr_t)NULL_WORD); 1.11 + Register thread = NOT_LP64(rsi) LP64_ONLY(r15_thread); 1.12 + NOT_LP64(__ get_thread(rsi)); 1.13 + __ movptr(rax, Address(thread, JavaThread::exception_oop_offset())); 1.14 + __ movptr(Address(thread, JavaThread::exception_oop_offset()), (intptr_t)NULL_WORD); 1.15 + __ movptr(Address(thread, JavaThread::exception_pc_offset()), (intptr_t)NULL_WORD); 1.16 1.17 __ bind(_unwind_handler_entry); 1.18 __ verify_not_null_oop(rax); 1.19 if (method()->is_synchronized() || compilation()->env()->dtrace_method_probes()) { 1.20 - __ mov(rsi, rax); // Preserve the exception 1.21 + __ mov(rbx, rax); // Preserve the exception (rbx is always callee-saved) 1.22 } 1.23 1.24 // Preform needed unlocking 1.25 @@ -448,19 +449,24 @@ 1.26 if (method()->is_synchronized()) { 1.27 monitor_address(0, FrameMap::rax_opr); 1.28 stub = new MonitorExitStub(FrameMap::rax_opr, true, 0); 1.29 - __ unlock_object(rdi, rbx, rax, *stub->entry()); 1.30 + __ unlock_object(rdi, rsi, rax, *stub->entry()); 1.31 __ bind(*stub->continuation()); 1.32 } 1.33 1.34 if (compilation()->env()->dtrace_method_probes()) { 1.35 +#ifdef _LP64 1.36 + __ mov(rdi, r15_thread); 1.37 + __ mov_metadata(rsi, method()->constant_encoding()); 1.38 +#else 1.39 __ get_thread(rax); 1.40 __ movptr(Address(rsp, 0), rax); 1.41 __ mov_metadata(Address(rsp, sizeof(void*)), method()->constant_encoding()); 1.42 +#endif 1.43 __ call(RuntimeAddress(CAST_FROM_FN_PTR(address, SharedRuntime::dtrace_method_exit))); 1.44 } 1.45 1.46 if (method()->is_synchronized() || compilation()->env()->dtrace_method_probes()) { 1.47 - __ mov(rax, rsi); // Restore the exception 1.48 + __ mov(rax, rbx); // Restore the exception 1.49 } 1.50 1.51 // remove the activation and dispatch to the unwind handler