[mips][sparkplug] Fix invalid stack on baseline install

Port b4e62f2d14

Bug: v8:11420
Change-Id: I6b834611ec246244d109eb9065dca1d0c4a9c0c5
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3070380
Auto-Submit: Liu yu <liuyu@loongson.cn>
Reviewed-by: Zhao Jiazhong <zhaojiazhong-hf@loongson.cn>
Commit-Queue: Zhao Jiazhong <zhaojiazhong-hf@loongson.cn>
Cr-Commit-Position: refs/heads/master@{#76072}
This commit is contained in:
Liu Yu 2021-08-04 15:06:18 +08:00 committed by V8 LUCI CQ
parent e13d808c01
commit e7ad66ac12
2 changed files with 8 additions and 4 deletions

View File

@ -3945,7 +3945,6 @@ namespace {
void Generate_BaselineOrInterpreterEntry(MacroAssembler* masm,
bool next_bytecode,
bool is_osr = false) {
__ Push(kInterpreterAccumulatorRegister);
Label start;
__ bind(&start);
@ -3968,7 +3967,6 @@ void Generate_BaselineOrInterpreterEntry(MacroAssembler* masm,
__ Branch(&start_with_baseline, eq, t6, Operand(BASELINE_DATA_TYPE));
// Start with bytecode as there is no baseline code.
__ Pop(kInterpreterAccumulatorRegister);
Builtin builtin_id = next_bytecode
? Builtin::kInterpreterEnterAtNextBytecode
: Builtin::kInterpreterEnterAtBytecode;
@ -4040,6 +4038,8 @@ void Generate_BaselineOrInterpreterEntry(MacroAssembler* masm,
// Get bytecode array from the stack frame.
__ Lw(kInterpreterBytecodeArrayRegister,
MemOperand(fp, InterpreterFrameConstants::kBytecodeArrayFromFp));
// Save the accumulator register, since it's clobbered by the below call.
__ Push(kInterpreterAccumulatorRegister);
{
Register arg_reg_1 = a0;
Register arg_reg_2 = a1;
@ -4085,8 +4085,10 @@ void Generate_BaselineOrInterpreterEntry(MacroAssembler* masm,
__ bind(&install_baseline_code);
{
FrameScope scope(masm, StackFrame::INTERNAL);
__ Push(kInterpreterAccumulatorRegister);
__ Push(closure);
__ CallRuntime(Runtime::kInstallBaselineCode, 1);
__ Pop(kInterpreterAccumulatorRegister);
}
// Retry from the start after installing baseline code.
__ Branch(&start);

View File

@ -3530,7 +3530,6 @@ namespace {
void Generate_BaselineOrInterpreterEntry(MacroAssembler* masm,
bool next_bytecode,
bool is_osr = false) {
__ Push(kInterpreterAccumulatorRegister);
Label start;
__ bind(&start);
@ -3553,7 +3552,6 @@ void Generate_BaselineOrInterpreterEntry(MacroAssembler* masm,
__ Branch(&start_with_baseline, eq, t2, Operand(BASELINE_DATA_TYPE));
// Start with bytecode as there is no baseline code.
__ Pop(kInterpreterAccumulatorRegister);
Builtin builtin_id = next_bytecode
? Builtin::kInterpreterEnterAtNextBytecode
: Builtin::kInterpreterEnterAtBytecode;
@ -3624,6 +3622,8 @@ void Generate_BaselineOrInterpreterEntry(MacroAssembler* masm,
// Get bytecode array from the stack frame.
__ Ld(kInterpreterBytecodeArrayRegister,
MemOperand(fp, InterpreterFrameConstants::kBytecodeArrayFromFp));
// Save the accumulator register, since it's clobbered by the below call.
__ Push(kInterpreterAccumulatorRegister);
{
Register arg_reg_1 = a0;
Register arg_reg_2 = a1;
@ -3669,8 +3669,10 @@ void Generate_BaselineOrInterpreterEntry(MacroAssembler* masm,
__ bind(&install_baseline_code);
{
FrameScope scope(masm, StackFrame::INTERNAL);
__ Push(kInterpreterAccumulatorRegister);
__ Push(closure);
__ CallRuntime(Runtime::kInstallBaselineCode, 1);
__ Pop(kInterpreterAccumulatorRegister);
}
// Retry from the start after installing baseline code.
__ Branch(&start);