631 __ mov (rax, rcx); // result of call is in rax, 632 } 633 634 635 void LIR_Assembler::return_op(LIR_Opr result) { 636 assert(result->is_illegal() || !result->is_single_cpu() || result->as_register() == rax, "word returns are in rax,"); 637 if (!result->is_illegal() && result->is_float_kind() && !result->is_xmm_register()) { 638 assert(result->fpu() == 0, "result must already be on TOS"); 639 } 640 641 // Pop the stack before the safepoint code 642 __ remove_frame(initial_frame_size_in_bytes()); 643 644 bool result_is_oop = result->is_valid() ? result->is_oop() : false; 645 646 // Note: we do not need to round double result; float result has the right precision 647 // the poll sets the condition code, but no data registers 648 AddressLiteral polling_page(os::get_polling_page() + (SafepointPollOffset % os::vm_page_size()), 649 relocInfo::poll_return_type); 650 651 // NOTE: the requires that the polling page be reachable else the reloc 652 // goes to the movq that loads the address and not the faulting instruction 653 // which breaks the signal handler code 654 655 __ test32(rax, polling_page); 656 657 __ ret(0); 658 } 659 660 661 int LIR_Assembler::safepoint_poll(LIR_Opr tmp, CodeEmitInfo* info) { 662 AddressLiteral polling_page(os::get_polling_page() + (SafepointPollOffset % os::vm_page_size()), 663 relocInfo::poll_type); 664 665 if (info != NULL) { 666 add_debug_info_for_branch(info); 667 } else { 668 ShouldNotReachHere(); 669 } 670 671 int offset = __ offset(); 672 673 // NOTE: the requires that the polling page be reachable else the reloc 674 // goes to the movq that loads the address and not the faulting instruction 675 // which breaks the signal handler code 676 677 __ test32(rax, polling_page); 678 return offset; 679 } 680 681 682 void LIR_Assembler::move_regs(Register from_reg, Register to_reg) { 683 if (from_reg != to_reg) __ mov(to_reg, from_reg); 684 } 685 686 void LIR_Assembler::swap_reg(Register a, Register b) { 687 __ xchgptr(a, b); 688 } 689 690 691 void LIR_Assembler::const2reg(LIR_Opr src, LIR_Opr dest, LIR_PatchCode patch_code, CodeEmitInfo* info) { 692 assert(src->is_constant(), "should not call otherwise"); 693 assert(dest->is_register(), "should not call otherwise"); 694 LIR_Const* c = src->as_constant_ptr(); 695 696 switch (c->type()) { 697 case T_INT: { | 631 __ mov (rax, rcx); // result of call is in rax, 632 } 633 634 635 void LIR_Assembler::return_op(LIR_Opr result) { 636 assert(result->is_illegal() || !result->is_single_cpu() || result->as_register() == rax, "word returns are in rax,"); 637 if (!result->is_illegal() && result->is_float_kind() && !result->is_xmm_register()) { 638 assert(result->fpu() == 0, "result must already be on TOS"); 639 } 640 641 // Pop the stack before the safepoint code 642 __ remove_frame(initial_frame_size_in_bytes()); 643 644 bool result_is_oop = result->is_valid() ? result->is_oop() : false; 645 646 // Note: we do not need to round double result; float result has the right precision 647 // the poll sets the condition code, but no data registers 648 AddressLiteral polling_page(os::get_polling_page() + (SafepointPollOffset % os::vm_page_size()), 649 relocInfo::poll_return_type); 650 651 if (Assembler::is_polling_page_far()) { 652 __ lea(rscratch1, polling_page); 653 __ relocate(relocInfo::poll_return_type); 654 __ testl(rax, Address(rscratch1, 0)); 655 } else { 656 __ testl(rax, polling_page); 657 } 658 __ ret(0); 659 } 660 661 662 int LIR_Assembler::safepoint_poll(LIR_Opr tmp, CodeEmitInfo* info) { 663 AddressLiteral polling_page(os::get_polling_page() + (SafepointPollOffset % os::vm_page_size()), 664 relocInfo::poll_type); 665 guarantee(info != NULL, "Shouldn't be NULL"); 666 int offset = __ offset(); 667 if (Assembler::is_polling_page_far()) { 668 __ lea(rscratch1, polling_page); 669 offset = __ offset(); 670 add_debug_info_for_branch(info); 671 __ testl(rax, Address(rscratch1, 0)); 672 } else { 673 add_debug_info_for_branch(info); 674 __ testl(rax, polling_page); 675 } 676 return offset; 677 } 678 679 680 void LIR_Assembler::move_regs(Register from_reg, Register to_reg) { 681 if (from_reg != to_reg) __ mov(to_reg, from_reg); 682 } 683 684 void LIR_Assembler::swap_reg(Register a, Register b) { 685 __ xchgptr(a, b); 686 } 687 688 689 void LIR_Assembler::const2reg(LIR_Opr src, LIR_Opr dest, LIR_PatchCode patch_code, CodeEmitInfo* info) { 690 assert(src->is_constant(), "should not call otherwise"); 691 assert(dest->is_register(), "should not call otherwise"); 692 LIR_Const* c = src->as_constant_ptr(); 693 694 switch (c->type()) { 695 case T_INT: { |