hotspot/src/cpu/x86/vm/c1_Runtime1_x86.cpp
changeset 30582 b943b080c599
parent 30305 b92a97e1e9cb
child 30764 fec48bf5a827
child 30624 2e1803c8a26d
equal deleted inserted replaced
30581:a91d6c47f076 30582:b943b080c599
  1629         const Register thread = NOT_LP64(rax) LP64_ONLY(r15_thread);
  1629         const Register thread = NOT_LP64(rax) LP64_ONLY(r15_thread);
  1630         const Register tmp = rdx;
  1630         const Register tmp = rdx;
  1631 
  1631 
  1632         NOT_LP64(__ get_thread(thread);)
  1632         NOT_LP64(__ get_thread(thread);)
  1633 
  1633 
  1634         Address in_progress(thread, in_bytes(JavaThread::satb_mark_queue_offset() +
       
  1635                                              PtrQueue::byte_offset_of_active()));
       
  1636 
       
  1637         Address queue_index(thread, in_bytes(JavaThread::satb_mark_queue_offset() +
  1634         Address queue_index(thread, in_bytes(JavaThread::satb_mark_queue_offset() +
  1638                                              PtrQueue::byte_offset_of_index()));
  1635                                              PtrQueue::byte_offset_of_index()));
  1639         Address buffer(thread, in_bytes(JavaThread::satb_mark_queue_offset() +
  1636         Address buffer(thread, in_bytes(JavaThread::satb_mark_queue_offset() +
  1640                                         PtrQueue::byte_offset_of_buf()));
  1637                                         PtrQueue::byte_offset_of_buf()));
  1641 
  1638 
  1642 
       
  1643         Label done;
  1639         Label done;
  1644         Label runtime;
  1640         Label runtime;
  1645 
  1641 
  1646         // Can we store original value in the thread's buffer?
  1642         // Can we store original value in the thread's buffer?
  1647 
  1643 
  1648 #ifdef _LP64
  1644         __ movptr(tmp, queue_index);
  1649         __ movslq(tmp, queue_index);
  1645         __ testptr(tmp, tmp);
  1650         __ cmpq(tmp, 0);
  1646         __ jcc(Assembler::zero, runtime);
  1651 #else
  1647         __ subptr(tmp, wordSize);
  1652         __ cmpl(queue_index, 0);
  1648         __ movptr(queue_index, tmp);
  1653 #endif
  1649         __ addptr(tmp, buffer);
  1654         __ jcc(Assembler::equal, runtime);
       
  1655 #ifdef _LP64
       
  1656         __ subq(tmp, wordSize);
       
  1657         __ movl(queue_index, tmp);
       
  1658         __ addq(tmp, buffer);
       
  1659 #else
       
  1660         __ subl(queue_index, wordSize);
       
  1661         __ movl(tmp, buffer);
       
  1662         __ addl(tmp, queue_index);
       
  1663 #endif
       
  1664 
  1650 
  1665         // prev_val (rax)
  1651         // prev_val (rax)
  1666         f.load_argument(0, pre_val);
  1652         f.load_argument(0, pre_val);
  1667         __ movptr(Address(tmp, 0), pre_val);
  1653         __ movptr(Address(tmp, 0), pre_val);
  1668         __ jmp(done);
  1654         __ jmp(done);
  1711         CardTableModRefBS* ct =
  1697         CardTableModRefBS* ct =
  1712           barrier_set_cast<CardTableModRefBS>(Universe::heap()->barrier_set());
  1698           barrier_set_cast<CardTableModRefBS>(Universe::heap()->barrier_set());
  1713         assert(sizeof(*ct->byte_map_base) == sizeof(jbyte), "adjust this code");
  1699         assert(sizeof(*ct->byte_map_base) == sizeof(jbyte), "adjust this code");
  1714 
  1700 
  1715         Label done;
  1701         Label done;
       
  1702         Label enqueued;
  1716         Label runtime;
  1703         Label runtime;
  1717 
  1704 
  1718         // At this point we know new_value is non-NULL and the new_value crosses regions.
  1705         // At this point we know new_value is non-NULL and the new_value crosses regions.
  1719         // Must check to see if card is already dirty
  1706         // Must check to see if card is already dirty
  1720 
  1707 
  1750         // storing region crossing non-NULL, card is clean.
  1737         // storing region crossing non-NULL, card is clean.
  1751         // dirty card and log.
  1738         // dirty card and log.
  1752 
  1739 
  1753         __ movb(Address(card_addr, 0), (int)CardTableModRefBS::dirty_card_val());
  1740         __ movb(Address(card_addr, 0), (int)CardTableModRefBS::dirty_card_val());
  1754 
  1741 
  1755         __ cmpl(queue_index, 0);
  1742         const Register tmp = rdx;
  1756         __ jcc(Assembler::equal, runtime);
  1743         __ push(rdx);
  1757         __ subl(queue_index, wordSize);
  1744 
  1758 
  1745         __ movptr(tmp, queue_index);
  1759         const Register buffer_addr = rbx;
  1746         __ testptr(tmp, tmp);
  1760         __ push(rbx);
  1747         __ jcc(Assembler::zero, runtime);
  1761 
  1748         __ subptr(tmp, wordSize);
  1762         __ movptr(buffer_addr, buffer);
  1749         __ movptr(queue_index, tmp);
  1763 
  1750         __ addptr(tmp, buffer);
  1764 #ifdef _LP64
  1751         __ movptr(Address(tmp, 0), card_addr);
  1765         __ movslq(rscratch1, queue_index);
  1752         __ jmp(enqueued);
  1766         __ addptr(buffer_addr, rscratch1);
       
  1767 #else
       
  1768         __ addptr(buffer_addr, queue_index);
       
  1769 #endif
       
  1770         __ movptr(Address(buffer_addr, 0), card_addr);
       
  1771 
       
  1772         __ pop(rbx);
       
  1773         __ jmp(done);
       
  1774 
  1753 
  1775         __ bind(runtime);
  1754         __ bind(runtime);
  1776         __ push(rdx);
       
  1777 #ifdef _LP64
  1755 #ifdef _LP64
  1778         __ push(r8);
  1756         __ push(r8);
  1779         __ push(r9);
  1757         __ push(r9);
  1780         __ push(r10);
  1758         __ push(r10);
  1781         __ push(r11);
  1759         __ push(r11);
  1793         __ pop(r11);
  1771         __ pop(r11);
  1794         __ pop(r10);
  1772         __ pop(r10);
  1795         __ pop(r9);
  1773         __ pop(r9);
  1796         __ pop(r8);
  1774         __ pop(r8);
  1797 #endif
  1775 #endif
       
  1776         __ bind(enqueued);
  1798         __ pop(rdx);
  1777         __ pop(rdx);
       
  1778 
  1799         __ bind(done);
  1779         __ bind(done);
  1800 
       
  1801         __ pop(rcx);
  1780         __ pop(rcx);
  1802         __ pop(rax);
  1781         __ pop(rax);
  1803 
       
  1804       }
  1782       }
  1805       break;
  1783       break;
  1806 #endif // INCLUDE_ALL_GCS
  1784 #endif // INCLUDE_ALL_GCS
  1807 
  1785 
  1808     case predicate_failed_trap_id:
  1786     case predicate_failed_trap_id: