--- a/src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.cpp Wed Nov 22 14:53:20 2017 +0100
+++ b/src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.cpp Fri Nov 24 17:19:47 2017 +0000
@@ -494,42 +494,6 @@
}
}
-// Rather than take a segfault when the polling page is protected,
-// explicitly check for a safepoint in progress and if there is one,
-// fake a call to the handler as if a segfault had been caught.
-void LIR_Assembler::poll_for_safepoint(relocInfo::relocType rtype, CodeEmitInfo* info) {
- __ mov(rscratch1, SafepointSynchronize::address_of_state());
- __ ldrb(rscratch1, Address(rscratch1));
- Label nope, poll;
- __ cbz(rscratch1, nope);
- __ block_comment("safepoint");
- __ enter();
- __ push(0x3, sp); // r0 & r1
- __ push(0x3ffffffc, sp); // integer registers except lr & sp & r0 & r1
- __ adr(r0, poll);
- __ str(r0, Address(rthread, JavaThread::saved_exception_pc_offset()));
- __ mov(rscratch1, CAST_FROM_FN_PTR(address, SharedRuntime::get_poll_stub));
- __ blrt(rscratch1, 1, 0, 1);
- __ maybe_isb();
- __ pop(0x3ffffffc, sp); // integer registers except lr & sp & r0 & r1
- __ mov(rscratch1, r0);
- __ pop(0x3, sp); // r0 & r1
- __ leave();
- __ br(rscratch1);
- address polling_page(os::get_polling_page());
- assert(os::is_poll_address(polling_page), "should be");
- unsigned long off;
- __ adrp(rscratch1, Address(polling_page, rtype), off);
- __ bind(poll);
- if (info)
- add_debug_info_for_branch(info); // This isn't just debug info:
- // it's the oop map
- else
- __ code_section()->relocate(pc(), rtype);
- __ ldrw(zr, Address(rscratch1, off));
- __ bind(nope);
-}
-
void LIR_Assembler::return_op(LIR_Opr result) {
assert(result->is_illegal() || !result->is_single_cpu() || result->as_register() == r0, "word returns are in r0,");
@@ -549,11 +513,9 @@
address polling_page(os::get_polling_page());
guarantee(info != NULL, "Shouldn't be NULL");
assert(os::is_poll_address(polling_page), "should be");
- unsigned long off;
- __ adrp(rscratch1, Address(polling_page, relocInfo::poll_type), off);
- assert(off == 0, "must be");
+ __ get_polling_page(rscratch1, polling_page, relocInfo::poll_type);
add_debug_info_for_branch(info); // This isn't just debug info:
- // it's the oop map
+ // it's the oop map
__ read_polling_page(rscratch1, relocInfo::poll_type);
return __ offset();
}