608
609 if (Assembler::is_polling_page_far()) {
610 __ lea(rscratch1, polling_page);
611 __ relocate(relocInfo::poll_return_type);
612 __ testl(rax, Address(rscratch1, 0));
613 } else {
614 __ testl(rax, polling_page);
615 }
616 __ ret(0);
617 }
618
619
620 int LIR_Assembler::safepoint_poll(LIR_Opr tmp, CodeEmitInfo* info) {
621 AddressLiteral polling_page(os::get_polling_page(), relocInfo::poll_type);
622 guarantee(info != NULL, "Shouldn't be NULL");
623 int offset = __ offset();
624 if (Assembler::is_polling_page_far()) {
625 __ lea(rscratch1, polling_page);
626 offset = __ offset();
627 add_debug_info_for_branch(info);
628 __ testl(rax, Address(rscratch1, 0));
629 } else {
630 add_debug_info_for_branch(info);
631 __ testl(rax, polling_page);
632 }
633 return offset;
634 }
635
636
637 void LIR_Assembler::move_regs(Register from_reg, Register to_reg) {
638 if (from_reg != to_reg) __ mov(to_reg, from_reg);
639 }
640
641 void LIR_Assembler::swap_reg(Register a, Register b) {
642 __ xchgptr(a, b);
643 }
644
645
646 void LIR_Assembler::const2reg(LIR_Opr src, LIR_Opr dest, LIR_PatchCode patch_code, CodeEmitInfo* info) {
647 assert(src->is_constant(), "should not call otherwise");
|
608
609 if (Assembler::is_polling_page_far()) {
610 __ lea(rscratch1, polling_page);
611 __ relocate(relocInfo::poll_return_type);
612 __ testl(rax, Address(rscratch1, 0));
613 } else {
614 __ testl(rax, polling_page);
615 }
616 __ ret(0);
617 }
618
619
620 int LIR_Assembler::safepoint_poll(LIR_Opr tmp, CodeEmitInfo* info) {
621 AddressLiteral polling_page(os::get_polling_page(), relocInfo::poll_type);
622 guarantee(info != NULL, "Shouldn't be NULL");
623 int offset = __ offset();
624 if (Assembler::is_polling_page_far()) {
625 __ lea(rscratch1, polling_page);
626 offset = __ offset();
627 add_debug_info_for_branch(info);
628 __ relocate(relocInfo::poll_type);
629 __ testl(rax, Address(rscratch1, 0));
630 } else {
631 add_debug_info_for_branch(info);
632 __ testl(rax, polling_page);
633 }
634 return offset;
635 }
636
637
638 void LIR_Assembler::move_regs(Register from_reg, Register to_reg) {
639 if (from_reg != to_reg) __ mov(to_reg, from_reg);
640 }
641
642 void LIR_Assembler::swap_reg(Register a, Register b) {
643 __ xchgptr(a, b);
644 }
645
646
647 void LIR_Assembler::const2reg(LIR_Opr src, LIR_Opr dest, LIR_PatchCode patch_code, CodeEmitInfo* info) {
648 assert(src->is_constant(), "should not call otherwise");
|