src/cpu/x86/vm/c1_Runtime1_x86.cpp

changeset 1927
87fc6aca31ab
parent 1919
61b2245abf36
child 1934
e9ff18c4ace7
     1.1 --- a/src/cpu/x86/vm/c1_Runtime1_x86.cpp	Thu May 27 18:01:56 2010 -0700
     1.2 +++ b/src/cpu/x86/vm/c1_Runtime1_x86.cpp	Thu May 27 22:01:55 2010 -0700
     1.3 @@ -1581,7 +1581,6 @@
     1.4            __ should_not_reach_here();
     1.5            break;
     1.6          }
     1.7 -
     1.8          __ push(rax);
     1.9          __ push(rdx);
    1.10  
    1.11 @@ -1605,8 +1604,8 @@
    1.12  
    1.13          // Can we store original value in the thread's buffer?
    1.14  
    1.15 -        LP64_ONLY(__ movslq(tmp, queue_index);)
    1.16  #ifdef _LP64
    1.17 +        __ movslq(tmp, queue_index);
    1.18          __ cmpq(tmp, 0);
    1.19  #else
    1.20          __ cmpl(queue_index, 0);
    1.21 @@ -1628,13 +1627,33 @@
    1.22          __ jmp(done);
    1.23  
    1.24          __ bind(runtime);
    1.25 +        __ push(rcx);
    1.26 +#ifdef _LP64
    1.27 +        __ push(r8);
    1.28 +        __ push(r9);
    1.29 +        __ push(r10);
    1.30 +        __ push(r11);
    1.31 +#  ifndef _WIN64
    1.32 +        __ push(rdi);
    1.33 +        __ push(rsi);
    1.34 +#  endif
    1.35 +#endif
    1.36          // load the pre-value
    1.37 -        __ push(rcx);
    1.38          f.load_argument(0, rcx);
    1.39          __ call_VM_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::g1_wb_pre), rcx, thread);
    1.40 +#ifdef _LP64
    1.41 +#  ifndef _WIN64
    1.42 +        __ pop(rsi);
    1.43 +        __ pop(rdi);
    1.44 +#  endif
    1.45 +        __ pop(r11);
    1.46 +        __ pop(r10);
    1.47 +        __ pop(r9);
    1.48 +        __ pop(r8);
    1.49 +#endif
    1.50          __ pop(rcx);
    1.51 +        __ bind(done);
    1.52  
    1.53 -        __ bind(done);
    1.54          __ pop(rdx);
    1.55          __ pop(rax);
    1.56        }
    1.57 @@ -1664,13 +1683,13 @@
    1.58                                          PtrQueue::byte_offset_of_buf()));
    1.59  
    1.60          __ push(rax);
    1.61 -        __ push(rdx);
    1.62 +        __ push(rcx);
    1.63  
    1.64          NOT_LP64(__ get_thread(thread);)
    1.65          ExternalAddress cardtable((address)ct->byte_map_base);
    1.66          assert(sizeof(*ct->byte_map_base) == sizeof(jbyte), "adjust this code");
    1.67  
    1.68 -        const Register card_addr = rdx;
    1.69 +        const Register card_addr = rcx;
    1.70  #ifdef _LP64
    1.71          const Register tmp = rscratch1;
    1.72          f.load_argument(0, card_addr);
    1.73 @@ -1679,7 +1698,7 @@
    1.74          // get the address of the card
    1.75          __ addq(card_addr, tmp);
    1.76  #else
    1.77 -        const Register card_index = rdx;
    1.78 +        const Register card_index = rcx;
    1.79          f.load_argument(0, card_index);
    1.80          __ shrl(card_index, CardTableModRefBS::card_shift);
    1.81  
    1.82 @@ -1716,12 +1735,32 @@
    1.83          __ jmp(done);
    1.84  
    1.85          __ bind(runtime);
    1.86 -        NOT_LP64(__ push(rcx);)
    1.87 +        __ push(rdx);
    1.88 +#ifdef _LP64
    1.89 +        __ push(r8);
    1.90 +        __ push(r9);
    1.91 +        __ push(r10);
    1.92 +        __ push(r11);
    1.93 +#  ifndef _WIN64
    1.94 +        __ push(rdi);
    1.95 +        __ push(rsi);
    1.96 +#  endif
    1.97 +#endif
    1.98          __ call_VM_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::g1_wb_post), card_addr, thread);
    1.99 -        NOT_LP64(__ pop(rcx);)
   1.100 +#ifdef _LP64
   1.101 +#  ifndef _WIN64
   1.102 +        __ pop(rsi);
   1.103 +        __ pop(rdi);
   1.104 +#  endif
   1.105 +        __ pop(r11);
   1.106 +        __ pop(r10);
   1.107 +        __ pop(r9);
   1.108 +        __ pop(r8);
   1.109 +#endif
   1.110 +        __ pop(rdx);
   1.111 +        __ bind(done);
   1.112  
   1.113 -        __ bind(done);
   1.114 -        __ pop(rdx);
   1.115 +        __ pop(rcx);
   1.116          __ pop(rax);
   1.117  
   1.118        }

mercurial