Skip to content
Permalink
Browse files
8266609: AArch64: include FP/LR space in LIR_Assembler::initial_frame…
…_size_in_bytes()

Reviewed-by: aph
  • Loading branch information
nick-arm committed May 7, 2021
1 parent ebb68d2 commit 71b8ad45b4de6836e3bb2716ebf136f3f8ea2198
@@ -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
@@ -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());
}


@@ -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);
}


@@ -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));
@@ -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);

0 comments on commit 71b8ad4

Please sign in to comment.