1.1 --- a/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp Sun Mar 27 00:00:14 2011 -0700 1.2 +++ b/src/cpu/x86/vm/c1_LIRAssembler_x86.cpp Sun Mar 27 13:17:37 2011 -0700 1.3 @@ -648,12 +648,13 @@ 1.4 AddressLiteral polling_page(os::get_polling_page() + (SafepointPollOffset % os::vm_page_size()), 1.5 relocInfo::poll_return_type); 1.6 1.7 - // NOTE: the requires that the polling page be reachable else the reloc 1.8 - // goes to the movq that loads the address and not the faulting instruction 1.9 - // which breaks the signal handler code 1.10 - 1.11 - __ test32(rax, polling_page); 1.12 - 1.13 + if (Assembler::is_polling_page_far()) { 1.14 + __ lea(rscratch1, polling_page); 1.15 + __ relocate(relocInfo::poll_return_type); 1.16 + __ testl(rax, Address(rscratch1, 0)); 1.17 + } else { 1.18 + __ testl(rax, polling_page); 1.19 + } 1.20 __ ret(0); 1.21 } 1.22 1.23 @@ -661,20 +662,17 @@ 1.24 int LIR_Assembler::safepoint_poll(LIR_Opr tmp, CodeEmitInfo* info) { 1.25 AddressLiteral polling_page(os::get_polling_page() + (SafepointPollOffset % os::vm_page_size()), 1.26 relocInfo::poll_type); 1.27 - 1.28 - if (info != NULL) { 1.29 + guarantee(info != NULL, "Shouldn't be NULL"); 1.30 + int offset = __ offset(); 1.31 + if (Assembler::is_polling_page_far()) { 1.32 + __ lea(rscratch1, polling_page); 1.33 + offset = __ offset(); 1.34 add_debug_info_for_branch(info); 1.35 + __ testl(rax, Address(rscratch1, 0)); 1.36 } else { 1.37 - ShouldNotReachHere(); 1.38 + add_debug_info_for_branch(info); 1.39 + __ testl(rax, polling_page); 1.40 } 1.41 - 1.42 - int offset = __ offset(); 1.43 - 1.44 - // NOTE: the requires that the polling page be reachable else the reloc 1.45 - // goes to the movq that loads the address and not the faulting instruction 1.46 - // which breaks the signal handler code 1.47 - 1.48 - __ test32(rax, polling_page); 1.49 return offset; 1.50 } 1.51