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

Port of https://chromium-review.googlesource.com/c/v8/v8/+/1817609.

Since we were already loading the undefined value a few lines above,
we could avoid loading it again.

Bug: v8:9771
Change-Id: I3761faacd22dabd69623179c1dc39f39c47ccb6b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1847356
Reviewed-by: Dan Elphick <delphick@chromium.org>
Commit-Queue: Santiago Aboy Solanes <solanes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#64166}
This commit is contained in:
Santiago Aboy Solanes 2019-10-08 14:35:10 +01:00 committed by Commit Bot
parent c203163d1f
commit 3104dd42b1

View File

@ -1037,11 +1037,11 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) {
// If ok, push undefined as the initial value for all register file entries.
Label loop_header;
Label loop_check;
__ Move(eax, masm->isolate()->factory()->undefined_value());
__ LoadRoot(kInterpreterAccumulatorRegister, RootIndex::kUndefinedValue);
__ jmp(&loop_check);
__ bind(&loop_header);
// TODO(rmcilroy): Consider doing more than one push per loop iteration.
__ push(eax);
__ push(kInterpreterAccumulatorRegister);
// Continue loop if not done.
__ bind(&loop_check);
__ sub(frame_size, Immediate(kSystemPointerSize));
@ -1051,12 +1051,12 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) {
// If the bytecode array has a valid incoming new target or generator object
// register, initialize it with incoming value which was passed in edx.
Label no_incoming_new_target_or_generator_register;
__ mov(eax, FieldOperand(
__ mov(ecx, FieldOperand(
kInterpreterBytecodeArrayRegister,
BytecodeArray::kIncomingNewTargetOrGeneratorRegisterOffset));
__ test(eax, eax);
__ test(ecx, ecx);
__ j(zero, &no_incoming_new_target_or_generator_register);
__ mov(Operand(ebp, eax, times_system_pointer_size, 0), edx);
__ mov(Operand(ebp, ecx, times_system_pointer_size, 0), edx);
__ bind(&no_incoming_new_target_or_generator_register);
// Load accumulator and bytecode offset into registers.