1.1 --- a/src/cpu/x86/vm/c1_Runtime1_x86.cpp Tue Jun 01 11:48:33 2010 -0700 1.2 +++ b/src/cpu/x86/vm/c1_Runtime1_x86.cpp Wed Jun 02 22:45:42 2010 -0700 1.3 @@ -782,7 +782,7 @@ 1.4 // Restore SP from BP if the exception PC is a MethodHandle call site. 1.5 NOT_LP64(__ get_thread(thread);) 1.6 __ cmpl(Address(thread, JavaThread::is_method_handle_return_offset()), 0); 1.7 - __ cmovptr(Assembler::notEqual, rsp, rbp); 1.8 + __ cmovptr(Assembler::notEqual, rsp, rbp_mh_SP_save); 1.9 1.10 // continue at exception handler (return address removed) 1.11 // note: do *not* remove arguments when unwinding the 1.12 @@ -1581,7 +1581,6 @@ 1.13 __ should_not_reach_here(); 1.14 break; 1.15 } 1.16 - 1.17 __ push(rax); 1.18 __ push(rdx); 1.19 1.20 @@ -1605,8 +1604,8 @@ 1.21 1.22 // Can we store original value in the thread's buffer? 1.23 1.24 - LP64_ONLY(__ movslq(tmp, queue_index);) 1.25 #ifdef _LP64 1.26 + __ movslq(tmp, queue_index); 1.27 __ cmpq(tmp, 0); 1.28 #else 1.29 __ cmpl(queue_index, 0); 1.30 @@ -1628,13 +1627,33 @@ 1.31 __ jmp(done); 1.32 1.33 __ bind(runtime); 1.34 + __ push(rcx); 1.35 +#ifdef _LP64 1.36 + __ push(r8); 1.37 + __ push(r9); 1.38 + __ push(r10); 1.39 + __ push(r11); 1.40 +# ifndef _WIN64 1.41 + __ push(rdi); 1.42 + __ push(rsi); 1.43 +# endif 1.44 +#endif 1.45 // load the pre-value 1.46 - __ push(rcx); 1.47 f.load_argument(0, rcx); 1.48 __ call_VM_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::g1_wb_pre), rcx, thread); 1.49 +#ifdef _LP64 1.50 +# ifndef _WIN64 1.51 + __ pop(rsi); 1.52 + __ pop(rdi); 1.53 +# endif 1.54 + __ pop(r11); 1.55 + __ pop(r10); 1.56 + __ pop(r9); 1.57 + __ pop(r8); 1.58 +#endif 1.59 __ pop(rcx); 1.60 + __ bind(done); 1.61 1.62 - __ bind(done); 1.63 __ pop(rdx); 1.64 __ pop(rax); 1.65 } 1.66 @@ -1664,13 +1683,13 @@ 1.67 PtrQueue::byte_offset_of_buf())); 1.68 1.69 __ push(rax); 1.70 - __ push(rdx); 1.71 + __ push(rcx); 1.72 1.73 NOT_LP64(__ get_thread(thread);) 1.74 ExternalAddress cardtable((address)ct->byte_map_base); 1.75 assert(sizeof(*ct->byte_map_base) == sizeof(jbyte), "adjust this code"); 1.76 1.77 - const Register card_addr = rdx; 1.78 + const Register card_addr = rcx; 1.79 #ifdef _LP64 1.80 const Register tmp = rscratch1; 1.81 f.load_argument(0, card_addr); 1.82 @@ -1679,7 +1698,7 @@ 1.83 // get the address of the card 1.84 __ addq(card_addr, tmp); 1.85 #else 1.86 - const Register card_index = rdx; 1.87 + const Register card_index = rcx; 1.88 f.load_argument(0, card_index); 1.89 __ shrl(card_index, CardTableModRefBS::card_shift); 1.90 1.91 @@ -1716,12 +1735,32 @@ 1.92 __ jmp(done); 1.93 1.94 __ bind(runtime); 1.95 - NOT_LP64(__ push(rcx);) 1.96 + __ push(rdx); 1.97 +#ifdef _LP64 1.98 + __ push(r8); 1.99 + __ push(r9); 1.100 + __ push(r10); 1.101 + __ push(r11); 1.102 +# ifndef _WIN64 1.103 + __ push(rdi); 1.104 + __ push(rsi); 1.105 +# endif 1.106 +#endif 1.107 __ call_VM_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::g1_wb_post), card_addr, thread); 1.108 - NOT_LP64(__ pop(rcx);) 1.109 +#ifdef _LP64 1.110 +# ifndef _WIN64 1.111 + __ pop(rsi); 1.112 + __ pop(rdi); 1.113 +# endif 1.114 + __ pop(r11); 1.115 + __ pop(r10); 1.116 + __ pop(r9); 1.117 + __ pop(r8); 1.118 +#endif 1.119 + __ pop(rdx); 1.120 + __ bind(done); 1.121 1.122 - __ bind(done); 1.123 - __ pop(rdx); 1.124 + __ pop(rcx); 1.125 __ pop(rax); 1.126 1.127 }