780 __ pop(exception_pc); |
780 __ pop(exception_pc); |
781 |
781 |
782 // Restore SP from BP if the exception PC is a MethodHandle call site. |
782 // Restore SP from BP if the exception PC is a MethodHandle call site. |
783 NOT_LP64(__ get_thread(thread);) |
783 NOT_LP64(__ get_thread(thread);) |
784 __ cmpl(Address(thread, JavaThread::is_method_handle_return_offset()), 0); |
784 __ cmpl(Address(thread, JavaThread::is_method_handle_return_offset()), 0); |
785 __ cmovptr(Assembler::notEqual, rsp, rbp); |
785 __ cmovptr(Assembler::notEqual, rsp, rbp_mh_SP_save); |
786 |
786 |
787 // continue at exception handler (return address removed) |
787 // continue at exception handler (return address removed) |
788 // note: do *not* remove arguments when unwinding the |
788 // note: do *not* remove arguments when unwinding the |
789 // activation since the caller assumes having |
789 // activation since the caller assumes having |
790 // all arguments on the stack when entering the |
790 // all arguments on the stack when entering the |
1579 __ movptr(rax, (int)id); |
1579 __ movptr(rax, (int)id); |
1580 __ call_RT(noreg, noreg, CAST_FROM_FN_PTR(address, unimplemented_entry), rax); |
1580 __ call_RT(noreg, noreg, CAST_FROM_FN_PTR(address, unimplemented_entry), rax); |
1581 __ should_not_reach_here(); |
1581 __ should_not_reach_here(); |
1582 break; |
1582 break; |
1583 } |
1583 } |
1584 |
|
1585 __ push(rax); |
1584 __ push(rax); |
1586 __ push(rdx); |
1585 __ push(rdx); |
1587 |
1586 |
1588 const Register pre_val = rax; |
1587 const Register pre_val = rax; |
1589 const Register thread = NOT_LP64(rax) LP64_ONLY(r15_thread); |
1588 const Register thread = NOT_LP64(rax) LP64_ONLY(r15_thread); |
1603 Label done; |
1602 Label done; |
1604 Label runtime; |
1603 Label runtime; |
1605 |
1604 |
1606 // Can we store original value in the thread's buffer? |
1605 // Can we store original value in the thread's buffer? |
1607 |
1606 |
1608 LP64_ONLY(__ movslq(tmp, queue_index);) |
1607 #ifdef _LP64 |
1609 #ifdef _LP64 |
1608 __ movslq(tmp, queue_index); |
1610 __ cmpq(tmp, 0); |
1609 __ cmpq(tmp, 0); |
1611 #else |
1610 #else |
1612 __ cmpl(queue_index, 0); |
1611 __ cmpl(queue_index, 0); |
1613 #endif |
1612 #endif |
1614 __ jcc(Assembler::equal, runtime); |
1613 __ jcc(Assembler::equal, runtime); |
1626 f.load_argument(0, pre_val); |
1625 f.load_argument(0, pre_val); |
1627 __ movptr(Address(tmp, 0), pre_val); |
1626 __ movptr(Address(tmp, 0), pre_val); |
1628 __ jmp(done); |
1627 __ jmp(done); |
1629 |
1628 |
1630 __ bind(runtime); |
1629 __ bind(runtime); |
|
1630 __ push(rcx); |
|
1631 #ifdef _LP64 |
|
1632 __ push(r8); |
|
1633 __ push(r9); |
|
1634 __ push(r10); |
|
1635 __ push(r11); |
|
1636 # ifndef _WIN64 |
|
1637 __ push(rdi); |
|
1638 __ push(rsi); |
|
1639 # endif |
|
1640 #endif |
1631 // load the pre-value |
1641 // load the pre-value |
1632 __ push(rcx); |
|
1633 f.load_argument(0, rcx); |
1642 f.load_argument(0, rcx); |
1634 __ call_VM_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::g1_wb_pre), rcx, thread); |
1643 __ call_VM_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::g1_wb_pre), rcx, thread); |
|
1644 #ifdef _LP64 |
|
1645 # ifndef _WIN64 |
|
1646 __ pop(rsi); |
|
1647 __ pop(rdi); |
|
1648 # endif |
|
1649 __ pop(r11); |
|
1650 __ pop(r10); |
|
1651 __ pop(r9); |
|
1652 __ pop(r8); |
|
1653 #endif |
1635 __ pop(rcx); |
1654 __ pop(rcx); |
1636 |
|
1637 __ bind(done); |
1655 __ bind(done); |
|
1656 |
1638 __ pop(rdx); |
1657 __ pop(rdx); |
1639 __ pop(rax); |
1658 __ pop(rax); |
1640 } |
1659 } |
1641 break; |
1660 break; |
1642 |
1661 |
1662 PtrQueue::byte_offset_of_index())); |
1681 PtrQueue::byte_offset_of_index())); |
1663 Address buffer(thread, in_bytes(JavaThread::dirty_card_queue_offset() + |
1682 Address buffer(thread, in_bytes(JavaThread::dirty_card_queue_offset() + |
1664 PtrQueue::byte_offset_of_buf())); |
1683 PtrQueue::byte_offset_of_buf())); |
1665 |
1684 |
1666 __ push(rax); |
1685 __ push(rax); |
1667 __ push(rdx); |
1686 __ push(rcx); |
1668 |
1687 |
1669 NOT_LP64(__ get_thread(thread);) |
1688 NOT_LP64(__ get_thread(thread);) |
1670 ExternalAddress cardtable((address)ct->byte_map_base); |
1689 ExternalAddress cardtable((address)ct->byte_map_base); |
1671 assert(sizeof(*ct->byte_map_base) == sizeof(jbyte), "adjust this code"); |
1690 assert(sizeof(*ct->byte_map_base) == sizeof(jbyte), "adjust this code"); |
1672 |
1691 |
1673 const Register card_addr = rdx; |
1692 const Register card_addr = rcx; |
1674 #ifdef _LP64 |
1693 #ifdef _LP64 |
1675 const Register tmp = rscratch1; |
1694 const Register tmp = rscratch1; |
1676 f.load_argument(0, card_addr); |
1695 f.load_argument(0, card_addr); |
1677 __ shrq(card_addr, CardTableModRefBS::card_shift); |
1696 __ shrq(card_addr, CardTableModRefBS::card_shift); |
1678 __ lea(tmp, cardtable); |
1697 __ lea(tmp, cardtable); |
1679 // get the address of the card |
1698 // get the address of the card |
1680 __ addq(card_addr, tmp); |
1699 __ addq(card_addr, tmp); |
1681 #else |
1700 #else |
1682 const Register card_index = rdx; |
1701 const Register card_index = rcx; |
1683 f.load_argument(0, card_index); |
1702 f.load_argument(0, card_index); |
1684 __ shrl(card_index, CardTableModRefBS::card_shift); |
1703 __ shrl(card_index, CardTableModRefBS::card_shift); |
1685 |
1704 |
1686 Address index(noreg, card_index, Address::times_1); |
1705 Address index(noreg, card_index, Address::times_1); |
1687 __ leal(card_addr, __ as_Address(ArrayAddress(cardtable, index))); |
1706 __ leal(card_addr, __ as_Address(ArrayAddress(cardtable, index))); |