8266609: AArch64: include FP/LR space in LIR_Assembler::initial_frame_size_in_bytes()

Reviewed-by: aph
This commit is contained in:
Nick Gasson 2021-05-07 09:20:16 +00:00
parent ebb68d2b86
commit 71b8ad45b4
4 changed files with 8 additions and 10 deletions

View File

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

View File

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

View File

@ -341,9 +341,9 @@ 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();
@ -351,7 +351,7 @@ void C1_MacroAssembler::build_frame(int framesize, int bang_size_in_bytes) {
}
void C1_MacroAssembler::remove_frame(int framesize) {
MacroAssembler::remove_frame(framesize + 2 * wordSize);
MacroAssembler::remove_frame(framesize);
}

View File

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