Commit faa18098 authored by jgruber's avatar jgruber Committed by Commit Bot

[mips,mips64] Fix sp and fp offsets for INTERNAL frames

https://crrev.com/c/1075047 introduced a bug on mips/mips64 in which
sp and fp offsets were set incorrectly for INTERNAL frames.

Bug: v8:6666,chromium:847728,chromium:847568
Change-Id: I9a48d30a82f10a4af50f1ed4dc1d77e8defbdd77
Reviewed-on: https://chromium-review.googlesource.com/1078109
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53434}
parent 200dcb05
......@@ -4811,14 +4811,8 @@ void TurboAssembler::StubPrologue(StackFrame::Type type) {
void TurboAssembler::Prologue() { PushStandardFrame(a1); }
void TurboAssembler::EnterFrame(StackFrame::Type type) {
int stack_offset, fp_offset;
if (type == StackFrame::INTERNAL) {
stack_offset = -4 * kPointerSize;
fp_offset = 2 * kPointerSize;
} else {
stack_offset = -3 * kPointerSize;
fp_offset = 1 * kPointerSize;
}
int stack_offset = -3 * kPointerSize;
const int fp_offset = 1 * kPointerSize;
addiu(sp, sp, stack_offset);
stack_offset = -stack_offset - kPointerSize;
sw(ra, MemOperand(sp, stack_offset));
......@@ -4827,12 +4821,8 @@ void TurboAssembler::EnterFrame(StackFrame::Type type) {
stack_offset -= kPointerSize;
li(t9, Operand(StackFrame::TypeToMarker(type)));
sw(t9, MemOperand(sp, stack_offset));
if (type == StackFrame::INTERNAL) {
DCHECK_EQ(stack_offset, kPointerSize);
} else {
DCHECK_EQ(stack_offset, 0);
}
// Adjust FP to point to saved FP.
DCHECK_EQ(stack_offset, 0);
Addu(fp, sp, Operand(fp_offset));
}
......
......@@ -5131,14 +5131,8 @@ void TurboAssembler::StubPrologue(StackFrame::Type type) {
void TurboAssembler::Prologue() { PushStandardFrame(a1); }
void TurboAssembler::EnterFrame(StackFrame::Type type) {
int stack_offset, fp_offset;
if (type == StackFrame::INTERNAL) {
stack_offset = -4 * kPointerSize;
fp_offset = 2 * kPointerSize;
} else {
stack_offset = -3 * kPointerSize;
fp_offset = 1 * kPointerSize;
}
int stack_offset = -3 * kPointerSize;
const int fp_offset = 1 * kPointerSize;
daddiu(sp, sp, stack_offset);
stack_offset = -stack_offset - kPointerSize;
Sd(ra, MemOperand(sp, stack_offset));
......@@ -5147,12 +5141,8 @@ void TurboAssembler::EnterFrame(StackFrame::Type type) {
stack_offset -= kPointerSize;
li(t9, Operand(StackFrame::TypeToMarker(type)));
Sd(t9, MemOperand(sp, stack_offset));
if (type == StackFrame::INTERNAL) {
DCHECK_EQ(stack_offset, kPointerSize);
} else {
DCHECK_EQ(stack_offset, 0);
}
// Adjust FP to point to saved FP.
DCHECK_EQ(stack_offset, 0);
Daddu(fp, sp, Operand(fp_offset));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment