< prev index next >

src/cpu/x86/vm/c1_Runtime1_x86.cpp

Print this page
rev 8212 : 8013171: G1: C1 x86_64 barriers use 32-bit accesses to 64-bit PtrQueue::_index
Reviewed-by:

*** 1639,1678 **** const Register thread = NOT_LP64(rax) LP64_ONLY(r15_thread); const Register tmp = rdx; NOT_LP64(__ get_thread(thread);) - Address in_progress(thread, in_bytes(JavaThread::satb_mark_queue_offset() + - PtrQueue::byte_offset_of_active())); - Address queue_index(thread, in_bytes(JavaThread::satb_mark_queue_offset() + PtrQueue::byte_offset_of_index())); Address buffer(thread, in_bytes(JavaThread::satb_mark_queue_offset() + PtrQueue::byte_offset_of_buf())); - Label done; Label runtime; // Can we store original value in the thread's buffer? ! #ifdef _LP64 ! __ movslq(tmp, queue_index); ! __ cmpq(tmp, 0); ! #else ! __ cmpl(queue_index, 0); ! #endif __ jcc(Assembler::equal, runtime); ! #ifdef _LP64 ! __ subq(tmp, wordSize); ! __ movl(queue_index, tmp); ! __ addq(tmp, buffer); ! #else ! __ subl(queue_index, wordSize); ! __ movl(tmp, buffer); ! __ addl(tmp, queue_index); ! #endif // prev_val (rax) f.load_argument(0, pre_val); __ movptr(Address(tmp, 0), pre_val); __ jmp(done); --- 1639,1664 ---- const Register thread = NOT_LP64(rax) LP64_ONLY(r15_thread); const Register tmp = rdx; NOT_LP64(__ get_thread(thread);) Address queue_index(thread, in_bytes(JavaThread::satb_mark_queue_offset() + PtrQueue::byte_offset_of_index())); Address buffer(thread, in_bytes(JavaThread::satb_mark_queue_offset() + PtrQueue::byte_offset_of_buf())); Label done; Label runtime; // Can we store original value in the thread's buffer? ! __ movptr(tmp, queue_index); ! __ cmpptr(tmp, 0); __ jcc(Assembler::equal, runtime); ! __ subptr(tmp, wordSize); ! __ movptr(queue_index, tmp); ! __ addptr(tmp, buffer); // prev_val (rax) f.load_argument(0, pre_val); __ movptr(Address(tmp, 0), pre_val); __ jmp(done);
*** 1735,1747 **** --- 1721,1735 ---- Address buffer(thread, in_bytes(JavaThread::dirty_card_queue_offset() + PtrQueue::byte_offset_of_buf())); __ push(rax); __ push(rcx); + __ push(rdx); const Register cardtable = rax; const Register card_addr = rcx; + const Register tmp = rdx; f.load_argument(0, card_addr); __ shrptr(card_addr, CardTableModRefBS::card_shift); // Do not use ExternalAddress to load 'byte_map_base', since 'byte_map_base' is NOT // a valid address and therefore is not properly handled by the relocation code.
*** 1760,1791 **** // storing region crossing non-NULL, card is clean. // dirty card and log. __ movb(Address(card_addr, 0), (int)CardTableModRefBS::dirty_card_val()); ! __ cmpl(queue_index, 0); __ jcc(Assembler::equal, runtime); ! __ subl(queue_index, wordSize); ! ! const Register buffer_addr = rbx; ! __ push(rbx); ! ! __ movptr(buffer_addr, buffer); ! ! #ifdef _LP64 ! __ movslq(rscratch1, queue_index); ! __ addptr(buffer_addr, rscratch1); ! #else ! __ addptr(buffer_addr, queue_index); ! #endif ! __ movptr(Address(buffer_addr, 0), card_addr); ! ! __ pop(rbx); __ jmp(done); __ bind(runtime); - __ push(rdx); #ifdef _LP64 __ push(r8); __ push(r9); __ push(r10); __ push(r11); --- 1748,1767 ---- // storing region crossing non-NULL, card is clean. // dirty card and log. __ movb(Address(card_addr, 0), (int)CardTableModRefBS::dirty_card_val()); ! __ movptr(tmp, queue_index); ! __ cmpptr(tmp, 0); __ jcc(Assembler::equal, runtime); ! __ subptr(tmp, wordSize); ! __ movptr(queue_index, tmp); ! __ addptr(tmp, buffer); ! __ movptr(Address(tmp, 0), card_addr); __ jmp(done); __ bind(runtime); #ifdef _LP64 __ push(r8); __ push(r9); __ push(r10); __ push(r11);
*** 1803,1818 **** __ pop(r11); __ pop(r10); __ pop(r9); __ pop(r8); #endif - __ pop(rdx); __ bind(done); __ pop(rcx); __ pop(rax); - } break; #endif // INCLUDE_ALL_GCS case predicate_failed_trap_id: --- 1779,1793 ---- __ pop(r11); __ pop(r10); __ pop(r9); __ pop(r8); #endif __ bind(done); + __ pop(rdx); __ pop(rcx); __ pop(rax); } break; #endif // INCLUDE_ALL_GCS case predicate_failed_trap_id:
< prev index next >