[ia32][builtins] Defer throw in InterpreterEntryTrampoline

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

Bug: v8:9771
Change-Id: I5915cc3001350bde0ee5f4f935dbd849048803b6
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1847357
Commit-Queue: Santiago Aboy Solanes <solanes@chromium.org>
Reviewed-by: Dan Elphick <delphick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#64179}
This commit is contained in:
Santiago Aboy Solanes 2019-10-09 10:50:15 +01:00 committed by Commit Bot
parent fabfa417b4
commit 6396199878

View File

@ -1019,6 +1019,7 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) {
__ push(Immediate(Smi::FromInt(BytecodeArray::kHeaderSize - kHeapObjectTag)));
// Allocate the local and temporary register file on the stack.
Label stack_overflow;
{
// Load frame size from the BytecodeArray object.
Register frame_size = ecx;
@ -1026,13 +1027,10 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) {
BytecodeArray::kFrameSizeOffset));
// Do a stack check to ensure we don't go over the limit.
Label ok;
__ mov(eax, esp);
__ sub(eax, frame_size);
__ CompareRealStackLimit(eax);
__ j(above_equal, &ok);
__ CallRuntime(Runtime::kThrowStackOverflow);
__ bind(&ok);
__ j(below, &stack_overflow);
// If ok, push undefined as the initial value for all register file entries.
Label loop_header;
@ -1118,6 +1116,9 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) {
__ bind(&compile_lazy);
GenerateTailCallToReturnedCode(masm, Runtime::kCompileLazy);
__ bind(&stack_overflow);
__ CallRuntime(Runtime::kThrowStackOverflow);
__ int3(); // Should not return.
}