Commit 842f1ca0 authored by Milad Farazmand's avatar Milad Farazmand Committed by Commit Bot

PPC/s390: [builtins] Defer throw in InterpreterEntryTrampoline

Port dcf3b663

R=solanes@chromium.org, joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com
BUG=
LOG=N

Change-Id: I92b18a10581e0d1b7977db6be8ed455ec621d537
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1827738Reviewed-by: 's avatarJunliang Yan <jyan@ca.ibm.com>
Commit-Queue: Milad Farazmand <miladfar@ca.ibm.com>
Cr-Commit-Position: refs/heads/master@{#64012}
parent 36f2ec1f
......@@ -1149,19 +1149,17 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) {
__ Push(kInterpreterBytecodeArrayRegister, r3);
// Allocate the local and temporary register file on the stack.
Label stack_overflow;
{
// Load frame size (word) from the BytecodeArray object.
__ lwz(r5, FieldMemOperand(kInterpreterBytecodeArrayRegister,
BytecodeArray::kFrameSizeOffset));
// Do a stack check to ensure we don't go over the limit.
Label ok;
__ sub(r8, sp, r5);
LoadRealStackLimit(masm, r0);
__ cmpl(r8, r0);
__ bge(&ok);
__ CallRuntime(Runtime::kThrowStackOverflow);
__ bind(&ok);
__ ble(&stack_overflow);
// If ok, push undefined as the initial value for all register file entries.
// TODO(rmcilroy): Consider doing more than one push per loop iteration.
......@@ -1234,6 +1232,10 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) {
__ bind(&compile_lazy);
GenerateTailCallToReturnedCode(masm, Runtime::kCompileLazy);
__ bkpt(0); // Should not return.
__ bind(&stack_overflow);
__ CallRuntime(Runtime::kThrowStackOverflow);
__ bkpt(0); // Should not return.
}
static void Generate_InterpreterPushArgs(MacroAssembler* masm,
......
......@@ -1202,18 +1202,16 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) {
__ Push(kInterpreterBytecodeArrayRegister, r4);
// Allocate the local and temporary register file on the stack.
Label stack_overflow;
{
// Load frame size (word) from the BytecodeArray object.
__ LoadlW(r4, FieldMemOperand(kInterpreterBytecodeArrayRegister,
BytecodeArray::kFrameSizeOffset));
// Do a stack check to ensure we don't go over the limit.
Label ok;
__ SubP(r8, sp, r4);
__ CmpLogicalP(r8, RealStackLimitAsMemOperand(masm));
__ bge(&ok);
__ CallRuntime(Runtime::kThrowStackOverflow);
__ bind(&ok);
__ ble(&stack_overflow);
// If ok, push undefined as the initial value for all register file entries.
// TODO(rmcilroy): Consider doing more than one push per loop iteration.
......@@ -1288,6 +1286,10 @@ void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) {
__ bind(&compile_lazy);
GenerateTailCallToReturnedCode(masm, Runtime::kCompileLazy);
__ bkpt(0); // Should not return.
__ bind(&stack_overflow);
__ CallRuntime(Runtime::kThrowStackOverflow);
__ bkpt(0); // Should not return.
}
static void Generate_InterpreterPushArgs(MacroAssembler* masm,
......
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