src/cpu/x86/vm/c1_LIRAssembler_x86.cpp

Print this page




 581 
 582   __ bind(noLoop);
 583   __ pop(rax);
 584   return_op(LIR_OprFact::illegalOpr);
 585 
 586   __ bind(haveResult);
 587   // leave instruction is going to discard the TOS value
 588   __ mov (rax, rcx); // result of call is in rax,
 589 }
 590 
 591 
 592 void LIR_Assembler::return_op(LIR_Opr result) {
 593   assert(result->is_illegal() || !result->is_single_cpu() || result->as_register() == rax, "word returns are in rax,");
 594   if (!result->is_illegal() && result->is_float_kind() && !result->is_xmm_register()) {
 595     assert(result->fpu() == 0, "result must already be on TOS");
 596   }
 597 
 598   // Pop the stack before the safepoint code
 599   __ remove_frame(initial_frame_size_in_bytes());
 600 




 601   bool result_is_oop = result->is_valid() ? result->is_oop() : false;
 602 
 603   // Note: we do not need to round double result; float result has the right precision
 604   // the poll sets the condition code, but no data registers
 605   AddressLiteral polling_page(os::get_polling_page(), relocInfo::poll_return_type);
 606 
 607   if (Assembler::is_polling_page_far()) {
 608     __ lea(rscratch1, polling_page);
 609     __ relocate(relocInfo::poll_return_type);
 610     __ testl(rax, Address(rscratch1, 0));
 611   } else {
 612     __ testl(rax, polling_page);
 613   }
 614   __ ret(0);
 615 }
 616 
 617 
 618 int LIR_Assembler::safepoint_poll(LIR_Opr tmp, CodeEmitInfo* info) {
 619   AddressLiteral polling_page(os::get_polling_page(), relocInfo::poll_type);
 620   guarantee(info != NULL, "Shouldn't be NULL");




 581 
 582   __ bind(noLoop);
 583   __ pop(rax);
 584   return_op(LIR_OprFact::illegalOpr);
 585 
 586   __ bind(haveResult);
 587   // leave instruction is going to discard the TOS value
 588   __ mov (rax, rcx); // result of call is in rax,
 589 }
 590 
 591 
 592 void LIR_Assembler::return_op(LIR_Opr result) {
 593   assert(result->is_illegal() || !result->is_single_cpu() || result->as_register() == rax, "word returns are in rax,");
 594   if (!result->is_illegal() && result->is_float_kind() && !result->is_xmm_register()) {
 595     assert(result->fpu() == 0, "result must already be on TOS");
 596   }
 597 
 598   // Pop the stack before the safepoint code
 599   __ remove_frame(initial_frame_size_in_bytes());
 600 
 601   if (StackReservedPages > 0 && compilation()->has_reserved_stack_access()) {
 602     __ reserved_stack_check();  
 603   }
 604   
 605   bool result_is_oop = result->is_valid() ? result->is_oop() : false;
 606 
 607   // Note: we do not need to round double result; float result has the right precision
 608   // the poll sets the condition code, but no data registers
 609   AddressLiteral polling_page(os::get_polling_page(), relocInfo::poll_return_type);
 610 
 611   if (Assembler::is_polling_page_far()) {
 612     __ lea(rscratch1, polling_page);
 613     __ relocate(relocInfo::poll_return_type);
 614     __ testl(rax, Address(rscratch1, 0));
 615   } else {
 616     __ testl(rax, polling_page);
 617   }
 618   __ ret(0);
 619 }
 620 
 621 
 622 int LIR_Assembler::safepoint_poll(LIR_Opr tmp, CodeEmitInfo* info) {
 623   AddressLiteral polling_page(os::get_polling_page(), relocInfo::poll_type);
 624   guarantee(info != NULL, "Shouldn't be NULL");