Merge

Thu, 26 May 2011 16:39:34 -0700

author
never
date
Thu, 26 May 2011 16:39:34 -0700
changeset 2938
c76c13577460
parent 2937
5ac411b3b8fc
parent 2936
28263a73ebfb
child 2939
b2cb497dec28

Merge

     1.1 --- a/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp	Thu May 26 14:44:41 2011 -0700
     1.2 +++ b/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp	Thu May 26 16:39:34 2011 -0700
     1.3 @@ -3113,7 +3113,6 @@
     1.4      // reload the register args properly if we go slow path. Yuck
     1.5  
     1.6      // These are proper for the calling convention
     1.7 -
     1.8      store_parameter(length, 2);
     1.9      store_parameter(dst_pos, 1);
    1.10      store_parameter(dst, 0);
    1.11 @@ -3351,12 +3350,15 @@
    1.12            __ jcc(Assembler::notEqual, *stub->entry());
    1.13          }
    1.14  
    1.15 +       // Spill because stubs can use any register they like and it's
    1.16 +       // easier to restore just those that we care about.
    1.17 +       store_parameter(dst, 0);
    1.18 +       store_parameter(dst_pos, 1);
    1.19 +       store_parameter(length, 2);
    1.20 +       store_parameter(src_pos, 3);
    1.21 +       store_parameter(src, 4);
    1.22 +
    1.23  #ifndef _LP64
    1.24 -        // save caller save registers
    1.25 -        store_parameter(rax, 2);
    1.26 -        store_parameter(rcx, 1);
    1.27 -        store_parameter(rdx, 0);
    1.28 -
    1.29          __ movptr(tmp, dst_klass_addr);
    1.30          __ movptr(tmp, Address(tmp, objArrayKlass::element_klass_offset_in_bytes() + sizeof(oopDesc)));
    1.31          __ push(tmp);
    1.32 @@ -3372,17 +3374,6 @@
    1.33  #else
    1.34          __ movl2ptr(length, length); //higher 32bits must be null
    1.35  
    1.36 -        // save caller save registers: copy them to callee save registers
    1.37 -        __ mov(rbx, rdx);
    1.38 -        __ mov(r13, r8);
    1.39 -        __ mov(r14, r9);
    1.40 -#ifndef _WIN64
    1.41 -        store_parameter(rsi, 1);
    1.42 -        store_parameter(rcx, 0);
    1.43 -        // on WIN64 other incoming parameters are in rdi and rsi saved
    1.44 -        // across the call
    1.45 -#endif
    1.46 -
    1.47          __ lea(c_rarg0, Address(src, src_pos, scale, arrayOopDesc::base_offset_in_bytes(basic_type)));
    1.48          assert_different_registers(c_rarg0, dst, dst_pos, length);
    1.49          __ lea(c_rarg1, Address(dst, dst_pos, scale, arrayOopDesc::base_offset_in_bytes(basic_type)));
    1.50 @@ -3432,25 +3423,13 @@
    1.51  
    1.52          __ xorl(tmp, -1);
    1.53  
    1.54 -#ifndef _LP64
    1.55 -        // restore caller save registers
    1.56 -        assert_different_registers(tmp, rdx, rcx, rax); // result of stub will be lost
    1.57 -        __ movptr(rdx, Address(rsp, 0*BytesPerWord));
    1.58 -        __ movptr(rcx, Address(rsp, 1*BytesPerWord));
    1.59 -        __ movptr(rax, Address(rsp, 2*BytesPerWord));
    1.60 -#else
    1.61 -        // restore caller save registers
    1.62 -        __ mov(rdx, rbx);
    1.63 -        __ mov(r8, r13);
    1.64 -        __ mov(r9, r14);
    1.65 -#ifndef _WIN64
    1.66 -        assert_different_registers(tmp, rdx, r8, r9, rcx, rsi); // result of stub will be lost
    1.67 -        __ movptr(rcx, Address(rsp, 0*BytesPerWord));
    1.68 -        __ movptr(rsi, Address(rsp, 1*BytesPerWord));
    1.69 -#else
    1.70 -        assert_different_registers(tmp, rdx, r8, r9); // result of stub will be lost
    1.71 -#endif
    1.72 -#endif
    1.73 +        // Restore previously spilled arguments
    1.74 +        __ movptr   (dst,     Address(rsp, 0*BytesPerWord));
    1.75 +        __ movptr   (dst_pos, Address(rsp, 1*BytesPerWord));
    1.76 +        __ movptr   (length,  Address(rsp, 2*BytesPerWord));
    1.77 +        __ movptr   (src_pos, Address(rsp, 3*BytesPerWord));
    1.78 +        __ movptr   (src,     Address(rsp, 4*BytesPerWord));
    1.79 +
    1.80  
    1.81          __ subl(length, tmp);
    1.82          __ addl(src_pos, tmp);

mercurial