Skip to content

Commit

Permalink
8266609: AArch64: include FP/LR space in LIR_Assembler::initial_frame…
Browse files Browse the repository at this point in the history
…_size_in_bytes()

Reviewed-by: aph
  • Loading branch information
nick-arm committed May 7, 2021
1 parent ebb68d2 commit 71b8ad4
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 10 deletions.
1 change: 0 additions & 1 deletion src/hotspot/cpu/aarch64/aarch64.ad
Original file line number Diff line number Diff line change
Expand Up @@ -1886,7 +1886,6 @@ void MachPrologNode::emit(CodeBuffer &cbuf, PhaseRegAlloc *ra_) const {

// n.b. frame size includes space for return pc and rfp
const int framesize = C->output()->frame_size_in_bytes();
assert(framesize%(2*wordSize) == 0, "must preserve 2*wordSize alignment");

// insert a nop at the start of the prolog so we can patch in a
// branch if we need to invalidate the method later
Expand Down
5 changes: 1 addition & 4 deletions src/hotspot/cpu/aarch64/c1_LIRAssembler_aarch64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -374,10 +374,7 @@ void LIR_Assembler::jobject2reg_with_patching(Register reg, CodeEmitInfo *info)
int LIR_Assembler::initial_frame_size_in_bytes() const {
// if rounding, must let FrameMap know!

// The frame_map records size in slots (32bit word)

// subtract two words to account for return address and link
return (frame_map()->framesize() - (2*VMRegImpl::slots_per_word)) * VMRegImpl::stack_slot_size;
return in_bytes(frame_map()->framesize_in_bytes());
}


Expand Down
6 changes: 3 additions & 3 deletions src/hotspot/cpu/aarch64/c1_MacroAssembler_aarch64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -341,17 +341,17 @@ void C1_MacroAssembler::inline_cache_check(Register receiver, Register iCache) {
void C1_MacroAssembler::build_frame(int framesize, int bang_size_in_bytes) {
assert(bang_size_in_bytes >= framesize, "stack bang size incorrect");
// Make sure there is enough stack space for this method's activation.
// Note that we do this before doing an enter().
// Note that we do this before creating a frame.
generate_stack_overflow_check(bang_size_in_bytes);
MacroAssembler::build_frame(framesize + 2 * wordSize);
MacroAssembler::build_frame(framesize);

// Insert nmethod entry barrier into frame.
BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler();
bs->nmethod_entry_barrier(this);
}

void C1_MacroAssembler::remove_frame(int framesize) {
MacroAssembler::remove_frame(framesize + 2 * wordSize);
MacroAssembler::remove_frame(framesize);
}


Expand Down
6 changes: 4 additions & 2 deletions src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4438,7 +4438,8 @@ void MacroAssembler::load_byte_map_base(Register reg) {
}

void MacroAssembler::build_frame(int framesize) {
assert(framesize > 0, "framesize must be > 0");
assert(framesize >= 2 * wordSize, "framesize must include space for FP/LR");
assert(framesize % (2*wordSize) == 0, "must preserve 2*wordSize alignment");
if (framesize < ((1 << 9) + 2 * wordSize)) {
sub(sp, sp, framesize);
stp(rfp, lr, Address(sp, framesize - 2 * wordSize));
Expand All @@ -4457,7 +4458,8 @@ void MacroAssembler::build_frame(int framesize) {
}

void MacroAssembler::remove_frame(int framesize) {
assert(framesize > 0, "framesize must be > 0");
assert(framesize >= 2 * wordSize, "framesize must include space for FP/LR");
assert(framesize % (2*wordSize) == 0, "must preserve 2*wordSize alignment");
if (framesize < ((1 << 9) + 2 * wordSize)) {
ldp(rfp, lr, Address(sp, framesize - 2 * wordSize));
add(sp, sp, framesize);
Expand Down

0 comments on commit 71b8ad4

Please sign in to comment.