1642 // work argslot up to destslot, copying contiguous data downwards |
1642 // work argslot up to destslot, copying contiguous data downwards |
1643 // pseudo-code: |
1643 // pseudo-code: |
1644 // rax = src_addr + swap_bytes |
1644 // rax = src_addr + swap_bytes |
1645 // rbx = dest_addr |
1645 // rbx = dest_addr |
1646 // while (rax <= rbx) *(rax - swap_bytes) = *(rax + 0), rax++; |
1646 // while (rax <= rbx) *(rax - swap_bytes) = *(rax + 0), rax++; |
1647 __ addptr(rbx_destslot, wordSize); |
1647 // dest_slot denotes an exclusive upper limit |
|
1648 int limit_bias = OP_ROT_ARGS_DOWN_LIMIT_BIAS; |
|
1649 if (limit_bias != 0) |
|
1650 __ addptr(rbx_destslot, - limit_bias * wordSize); |
1648 move_arg_slots_down(_masm, |
1651 move_arg_slots_down(_masm, |
1649 Address(rax_argslot, swap_slots * wordSize), |
1652 Address(rax_argslot, swap_slots * wordSize), |
1650 rbx_destslot, |
1653 rbx_destslot, |
1651 -swap_slots, |
1654 -swap_slots, |
1652 rax_argslot, rdx_temp); |
1655 rax_argslot, rdx_temp); |
1653 |
1656 __ subptr(rbx_destslot, swap_slots * wordSize); |
1654 __ subptr(rbx_destslot, wordSize); |
|
1655 } |
1657 } |
1656 // pop the original first chunk into the destination slot, now free |
1658 // pop the original first chunk into the destination slot, now free |
1657 for (int i = 0; i < swap_slots; i++) { |
1659 for (int i = 0; i < swap_slots; i++) { |
1658 if (i == 0) __ movptr(Address(rbx_destslot, i * wordSize), rdi_temp); |
1660 if (i == 0) __ movptr(Address(rbx_destslot, i * wordSize), rdi_temp); |
1659 else __ popptr(Address(rbx_destslot, i * wordSize)); |
1661 else __ popptr(Address(rbx_destslot, i * wordSize)); |