Commit 63961998 authored by Santiago Aboy Solanes's avatar Santiago Aboy Solanes Committed by Commit Bot

[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: 's avatarDan Elphick <delphick@chromium.org>
Cr-Commit-Position: refs/heads/master@{#64179}
parent fabfa417
...@@ -1019,6 +1019,7 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) { ...@@ -1019,6 +1019,7 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) {
__ push(Immediate(Smi::FromInt(BytecodeArray::kHeaderSize - kHeapObjectTag))); __ push(Immediate(Smi::FromInt(BytecodeArray::kHeaderSize - kHeapObjectTag)));
// Allocate the local and temporary register file on the stack. // Allocate the local and temporary register file on the stack.
Label stack_overflow;
{ {
// Load frame size from the BytecodeArray object. // Load frame size from the BytecodeArray object.
Register frame_size = ecx; Register frame_size = ecx;
...@@ -1026,13 +1027,10 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) { ...@@ -1026,13 +1027,10 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) {
BytecodeArray::kFrameSizeOffset)); BytecodeArray::kFrameSizeOffset));
// Do a stack check to ensure we don't go over the limit. // Do a stack check to ensure we don't go over the limit.
Label ok;
__ mov(eax, esp); __ mov(eax, esp);
__ sub(eax, frame_size); __ sub(eax, frame_size);
__ CompareRealStackLimit(eax); __ CompareRealStackLimit(eax);
__ j(above_equal, &ok); __ j(below, &stack_overflow);
__ CallRuntime(Runtime::kThrowStackOverflow);
__ bind(&ok);
// 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;
...@@ -1118,6 +1116,9 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) { ...@@ -1118,6 +1116,9 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) {
__ bind(&compile_lazy); __ bind(&compile_lazy);
GenerateTailCallToReturnedCode(masm, Runtime::kCompileLazy); GenerateTailCallToReturnedCode(masm, Runtime::kCompileLazy);
__ bind(&stack_overflow);
__ CallRuntime(Runtime::kThrowStackOverflow);
__ int3(); // Should not return. __ int3(); // Should not return.
} }
......
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