Skip to content

Commit

Permalink
Simpler AArch64 code
Browse files Browse the repository at this point in the history
  • Loading branch information
shipilev committed Oct 18, 2024
1 parent b7375fa commit e3790cb
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 14 deletions.
4 changes: 2 additions & 2 deletions src/hotspot/cpu/aarch64/aarch64.ad
Original file line number Diff line number Diff line change
Expand Up @@ -16030,8 +16030,8 @@ instruct safePoint(rFlagsReg cr)
"ldrw zr, [rscratch1]\t# Safepoint: poll for GC"
%}
ins_encode %{
__ get_polling_page(rscratch1, relocInfo::poll_type);
__ read_polling_page(rscratch1, relocInfo::poll_type);
__ get_polling_page(rscratch1);
__ read_polling_page(rscratch1);
%}
ins_pipe(pipe_serial); // ins_pipe(iload_reg_mem);
%}
Expand Down
4 changes: 2 additions & 2 deletions src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -490,10 +490,10 @@ void LIR_Assembler::return_op(LIR_Opr result, C1SafepointPollStub* code_stub) {

int LIR_Assembler::safepoint_poll(LIR_Opr tmp, CodeEmitInfo* info) {
guarantee(info != nullptr, "Shouldn't be null");
__ get_polling_page(rscratch1, relocInfo::poll_type);
__ get_polling_page(rscratch1);
add_debug_info_for_branch(info); // This isn't just debug info:
// it's the oop map
__ read_polling_page(rscratch1, relocInfo::poll_type);
__ read_polling_page(rscratch1);
return __ offset();
}

Expand Down
13 changes: 5 additions & 8 deletions src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5386,22 +5386,19 @@ void MacroAssembler::bang_stack_size(Register size, Register tmp) {
}

// Move the address of the polling page into dest.
void MacroAssembler::get_polling_page(Register dest, relocInfo::relocType rtype) {
void MacroAssembler::get_polling_page(Register dest) {
ldr(dest, Address(rthread, JavaThread::polling_page_offset()));
}

// Read the polling page. The address of the polling page must
// already be in r.
address MacroAssembler::read_polling_page(Register r, relocInfo::relocType rtype) {
address mark;
// already be in addr.
void MacroAssembler::read_polling_page(Register addr) {
{
InstructionMark im(this);
code_section()->relocate(inst_mark(), rtype);
ldrw(zr, Address(r, 0));
mark = inst_mark();
code_section()->relocate(inst_mark(), relocInfo::poll_type);
ldrw(zr, Address(addr, 0));
}
verify_cross_modify_fence_not_required();
return mark;
}

void MacroAssembler::adrp(Register reg1, const Address &dest, uint64_t &byte_offset) {
Expand Down
4 changes: 2 additions & 2 deletions src/hotspot/cpu/aarch64/macroAssembler_aarch64.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1425,8 +1425,8 @@ class MacroAssembler: public Assembler {
}
}

address read_polling_page(Register r, relocInfo::relocType rtype);
void get_polling_page(Register dest, relocInfo::relocType rtype);
void read_polling_page(Register addr);
void get_polling_page(Register dest);

// CRC32 code for java.util.zip.CRC32::updateBytes() intrinsic.
void update_byte_crc32(Register crc, Register val, Register table);
Expand Down

0 comments on commit e3790cb

Please sign in to comment.