diff options
author | iveresov <none@none> | 2010-05-27 22:01:55 -0700 |
---|---|---|
committer | iveresov <none@none> | 2010-05-27 22:01:55 -0700 |
commit | a3022926f3d641e225d2bce09bb88682da586fd7 (patch) | |
tree | 9601ceff409a937dd2384845f577382572793f3b /src/cpu/x86/vm | |
parent | 3676652f42ab126cd5638fb60726fa18dee2eb9f (diff) |
6955349: C1: Make G1 barriers work with x64
Summary: This fixes G1 barriers in c1 on x64.
Reviewed-by: never
Diffstat (limited to 'src/cpu/x86/vm')
-rw-r--r-- | src/cpu/x86/vm/c1_LIRAssembler_x86.cpp | 9 | ||||
-rw-r--r-- | src/cpu/x86/vm/c1_LIRGenerator_x86.cpp | 4 | ||||
-rw-r--r-- | src/cpu/x86/vm/c1_Runtime1_x86.cpp | 61 |
3 files changed, 61 insertions, 13 deletions
diff --git a/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp b/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp index d532d264e..e49749328 100644 --- a/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp +++ b/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp @@ -2462,9 +2462,18 @@ void LIR_Assembler::logic_op(LIR_Code code, LIR_Opr left, LIR_Opr right, LIR_Opr } #endif // _LP64 } else { +#ifdef _LP64 + Register r_lo; + if (right->type() == T_OBJECT || right->type() == T_ARRAY) { + r_lo = right->as_register(); + } else { + r_lo = right->as_register_lo(); + } +#else Register r_lo = right->as_register_lo(); Register r_hi = right->as_register_hi(); assert(l_lo != r_hi, "overwriting registers"); +#endif switch (code) { case lir_logic_and: __ andptr(l_lo, r_lo); diff --git a/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp b/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp index f98bfaa8e..7cd2fe5c3 100644 --- a/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp +++ b/src/cpu/x86/vm/c1_LIRGenerator_x86.cpp @@ -175,7 +175,7 @@ LIR_Address* LIRGenerator::emit_array_address(LIR_Opr array_opr, LIR_Opr index_o // store and again for the card mark. LIR_Opr tmp = new_pointer_register(); __ leal(LIR_OprFact::address(addr), tmp); - return new LIR_Address(tmp, 0, type); + return new LIR_Address(tmp, type); } else { return addr; } @@ -185,7 +185,7 @@ LIR_Address* LIRGenerator::emit_array_address(LIR_Opr array_opr, LIR_Opr index_o void LIRGenerator::increment_counter(address counter, int step) { LIR_Opr pointer = new_pointer_register(); __ move(LIR_OprFact::intptrConst(counter), pointer); - LIR_Address* addr = new LIR_Address(pointer, 0, T_INT); + LIR_Address* addr = new LIR_Address(pointer, T_INT); increment_counter(addr, step); } diff --git a/src/cpu/x86/vm/c1_Runtime1_x86.cpp b/src/cpu/x86/vm/c1_Runtime1_x86.cpp index 3ca8ef636..134409f60 100644 --- a/src/cpu/x86/vm/c1_Runtime1_x86.cpp +++ b/src/cpu/x86/vm/c1_Runtime1_x86.cpp @@ -1581,7 +1581,6 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { __ should_not_reach_here(); break; } - __ push(rax); __ push(rdx); @@ -1605,8 +1604,8 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { // Can we store original value in the thread's buffer? - LP64_ONLY(__ movslq(tmp, queue_index);) #ifdef _LP64 + __ movslq(tmp, queue_index); __ cmpq(tmp, 0); #else __ cmpl(queue_index, 0); @@ -1628,13 +1627,33 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { __ jmp(done); __ bind(runtime); - // load the pre-value __ push(rcx); +#ifdef _LP64 + __ push(r8); + __ push(r9); + __ push(r10); + __ push(r11); +# ifndef _WIN64 + __ push(rdi); + __ push(rsi); +# endif +#endif + // load the pre-value f.load_argument(0, rcx); __ call_VM_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::g1_wb_pre), rcx, thread); +#ifdef _LP64 +# ifndef _WIN64 + __ pop(rsi); + __ pop(rdi); +# endif + __ pop(r11); + __ pop(r10); + __ pop(r9); + __ pop(r8); +#endif __ pop(rcx); - __ bind(done); + __ pop(rdx); __ pop(rax); } @@ -1664,13 +1683,13 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { PtrQueue::byte_offset_of_buf())); __ push(rax); - __ push(rdx); + __ push(rcx); NOT_LP64(__ get_thread(thread);) ExternalAddress cardtable((address)ct->byte_map_base); assert(sizeof(*ct->byte_map_base) == sizeof(jbyte), "adjust this code"); - const Register card_addr = rdx; + const Register card_addr = rcx; #ifdef _LP64 const Register tmp = rscratch1; f.load_argument(0, card_addr); @@ -1679,7 +1698,7 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { // get the address of the card __ addq(card_addr, tmp); #else - const Register card_index = rdx; + const Register card_index = rcx; f.load_argument(0, card_index); __ shrl(card_index, CardTableModRefBS::card_shift); @@ -1716,12 +1735,32 @@ OopMapSet* Runtime1::generate_code_for(StubID id, StubAssembler* sasm) { __ jmp(done); __ bind(runtime); - NOT_LP64(__ push(rcx);) + __ push(rdx); +#ifdef _LP64 + __ push(r8); + __ push(r9); + __ push(r10); + __ push(r11); +# ifndef _WIN64 + __ push(rdi); + __ push(rsi); +# endif +#endif __ call_VM_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::g1_wb_post), card_addr, thread); - NOT_LP64(__ pop(rcx);) - - __ bind(done); +#ifdef _LP64 +# ifndef _WIN64 + __ pop(rsi); + __ pop(rdi); +# endif + __ pop(r11); + __ pop(r10); + __ pop(r9); + __ pop(r8); +#endif __ pop(rdx); + __ bind(done); + + __ pop(rcx); __ pop(rax); } |