Commit 6ded810b authored by Liu Yu's avatar Liu Yu Committed by Commit Bot

[mips][builtins] Avoid reloading undefined value in InterpreterEntryTrampoline

Port: 40c0f84a

Bug: v8:9771
Change-Id: Icbe4e3450bb6ef7242804ca9d7f46cb6f1aed40c
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2539538
Auto-Submit: Liu yu <liuyu@loongson.cn>
Reviewed-by: 's avatarZhao Jiazhong <zhaojiazhong-hf@loongson.cn>
Commit-Queue: Zhao Jiazhong <zhaojiazhong-hf@loongson.cn>
Cr-Commit-Position: refs/heads/master@{#71336}
parent db5ede7f
...@@ -1061,11 +1061,11 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) { ...@@ -1061,11 +1061,11 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) {
// If ok, push undefined as the initial value for all register file entries. // If ok, push undefined as the initial value for all register file entries.
Label loop_header; Label loop_header;
Label loop_check; Label loop_check;
__ LoadRoot(t1, RootIndex::kUndefinedValue); __ LoadRoot(kInterpreterAccumulatorRegister, RootIndex::kUndefinedValue);
__ Branch(&loop_check); __ Branch(&loop_check);
__ bind(&loop_header); __ bind(&loop_header);
// TODO(rmcilroy): Consider doing more than one push per loop iteration. // TODO(rmcilroy): Consider doing more than one push per loop iteration.
__ push(t1); __ push(kInterpreterAccumulatorRegister);
// Continue loop if not done. // Continue loop if not done.
__ bind(&loop_check); __ bind(&loop_check);
__ Subu(t0, t0, Operand(kPointerSize)); __ Subu(t0, t0, Operand(kPointerSize));
...@@ -1091,8 +1091,7 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) { ...@@ -1091,8 +1091,7 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) {
__ Branch(&stack_check_interrupt, lo, sp, Operand(a2)); __ Branch(&stack_check_interrupt, lo, sp, Operand(a2));
__ bind(&after_stack_check_interrupt); __ bind(&after_stack_check_interrupt);
// Load accumulator with undefined. // The accumulator is already loaded with undefined.
__ LoadRoot(kInterpreterAccumulatorRegister, RootIndex::kUndefinedValue);
// Load the dispatch table into a register and dispatch to the bytecode // Load the dispatch table into a register and dispatch to the bytecode
// handler at the current bytecode offset. // handler at the current bytecode offset.
......
...@@ -1077,11 +1077,11 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) { ...@@ -1077,11 +1077,11 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) {
// If ok, push undefined as the initial value for all register file entries. // If ok, push undefined as the initial value for all register file entries.
Label loop_header; Label loop_header;
Label loop_check; Label loop_check;
__ LoadRoot(a5, RootIndex::kUndefinedValue); __ LoadRoot(kInterpreterAccumulatorRegister, RootIndex::kUndefinedValue);
__ Branch(&loop_check); __ Branch(&loop_check);
__ bind(&loop_header); __ bind(&loop_header);
// TODO(rmcilroy): Consider doing more than one push per loop iteration. // TODO(rmcilroy): Consider doing more than one push per loop iteration.
__ push(a5); __ push(kInterpreterAccumulatorRegister);
// Continue loop if not done. // Continue loop if not done.
__ bind(&loop_check); __ bind(&loop_check);
__ Dsubu(a4, a4, Operand(kPointerSize)); __ Dsubu(a4, a4, Operand(kPointerSize));
...@@ -1107,8 +1107,7 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) { ...@@ -1107,8 +1107,7 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) {
__ Branch(&stack_check_interrupt, lo, sp, Operand(a5)); __ Branch(&stack_check_interrupt, lo, sp, Operand(a5));
__ bind(&after_stack_check_interrupt); __ bind(&after_stack_check_interrupt);
// Load accumulator as undefined. // The accumulator is already loaded with undefined.
__ LoadRoot(kInterpreterAccumulatorRegister, RootIndex::kUndefinedValue);
// Load the dispatch table into a register and dispatch to the bytecode // Load the dispatch table into a register and dispatch to the bytecode
// handler at the current bytecode offset. // handler at the current bytecode 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