< prev index next >

src/cpu/x86/vm/c1_Runtime1_x86.cpp

Print this page
rev 8802 : G1 performance improvements: card batching, joining, sorting, prefetching and write barrier fence elision and simplification based on a global syncrhonization using handshakes piggybacking on thread-local safepoints.
rev 8803 : Implementation improvements to pass JPRT


1757         Address queue_index(thread, in_bytes(JavaThread::dirty_card_queue_offset() +
1758                                              PtrQueue::byte_offset_of_index()));
1759         Address buffer(thread, in_bytes(JavaThread::dirty_card_queue_offset() +
1760                                         PtrQueue::byte_offset_of_buf()));
1761 
1762         __ push(rax);
1763         __ push(rcx);
1764 
1765         const Register cardtable = rax;
1766         const Register card_addr = rcx;
1767 
1768         f.load_argument(0, card_addr);
1769         __ shrptr(card_addr, CardTableModRefBS::card_shift);
1770         // Do not use ExternalAddress to load 'byte_map_base', since 'byte_map_base' is NOT
1771         // a valid address and therefore is not properly handled by the relocation code.
1772         __ movptr(cardtable, (intptr_t)ct->byte_map_base);
1773         __ addptr(card_addr, cardtable);
1774 
1775         NOT_LP64(__ get_thread(thread);)
1776 




1777         __ cmpb(Address(card_addr, 0), (int)G1SATBCardTableModRefBS::g1_young_card_val());
1778         __ jcc(Assembler::equal, done);
1779 
1780         __ membar(Assembler::Membar_mask_bits(Assembler::StoreLoad));
1781         __ cmpb(Address(card_addr, 0), (int)CardTableModRefBS::dirty_card_val());
1782         __ jcc(Assembler::equal, done);

1783 
1784         // storing region crossing non-NULL, card is clean.
1785         // dirty card and log.
1786 
1787         __ movb(Address(card_addr, 0), (int)CardTableModRefBS::dirty_card_val());
1788 
1789         const Register tmp = rdx;
1790         __ push(rdx);
1791 
1792         __ movptr(tmp, queue_index);
1793         __ testptr(tmp, tmp);
1794         __ jcc(Assembler::zero, runtime);
1795         __ subptr(tmp, wordSize);
1796         __ movptr(queue_index, tmp);
1797         __ addptr(tmp, buffer);
1798         __ movptr(Address(tmp, 0), card_addr);
1799         __ jmp(enqueued);
1800 
1801         __ bind(runtime);
1802 #ifdef _LP64




1757         Address queue_index(thread, in_bytes(JavaThread::dirty_card_queue_offset() +
1758                                              PtrQueue::byte_offset_of_index()));
1759         Address buffer(thread, in_bytes(JavaThread::dirty_card_queue_offset() +
1760                                         PtrQueue::byte_offset_of_buf()));
1761 
1762         __ push(rax);
1763         __ push(rcx);
1764 
1765         const Register cardtable = rax;
1766         const Register card_addr = rcx;
1767 
1768         f.load_argument(0, card_addr);
1769         __ shrptr(card_addr, CardTableModRefBS::card_shift);
1770         // Do not use ExternalAddress to load 'byte_map_base', since 'byte_map_base' is NOT
1771         // a valid address and therefore is not properly handled by the relocation code.
1772         __ movptr(cardtable, (intptr_t)ct->byte_map_base);
1773         __ addptr(card_addr, cardtable);
1774 
1775         NOT_LP64(__ get_thread(thread);)
1776 
1777         if (G1ElideMembar) {
1778           __ cmpb(Address(card_addr, 0), (int)CardTableModRefBS::clean_card_val());
1779           __ jcc(Assembler::notEqual, done);
1780         } else {
1781           __ cmpb(Address(card_addr, 0), (int)G1SATBCardTableModRefBS::g1_young_card_val());
1782           __ jcc(Assembler::equal, done);
1783 
1784           __ membar(Assembler::Membar_mask_bits(Assembler::StoreLoad));
1785           __ cmpb(Address(card_addr, 0), (int)CardTableModRefBS::dirty_card_val());
1786           __ jcc(Assembler::equal, done);
1787         }
1788 
1789         // storing region crossing non-NULL, card is clean.
1790         // dirty card and log.
1791 
1792         __ movb(Address(card_addr, 0), (int)CardTableModRefBS::dirty_card_val());
1793 
1794         const Register tmp = rdx;
1795         __ push(rdx);
1796 
1797         __ movptr(tmp, queue_index);
1798         __ testptr(tmp, tmp);
1799         __ jcc(Assembler::zero, runtime);
1800         __ subptr(tmp, wordSize);
1801         __ movptr(queue_index, tmp);
1802         __ addptr(tmp, buffer);
1803         __ movptr(Address(tmp, 0), card_addr);
1804         __ jmp(enqueued);
1805 
1806         __ bind(runtime);
1807 #ifdef _LP64


< prev index next >