From 8b749bf9ec6fc1e31b02cad2f15eaccf8716b617 Mon Sep 17 00:00:00 2001 From: Ilija Pavlovic Date: Thu, 28 Sep 2017 10:57:02 +0200 Subject: [PATCH] MIPS: [wasm] Allow traps in tests with many parameters in cctests Port for: https://chromium-review.googlesource.com/c/v8/v8/+/684017 TEST=cctest/test-run-wasm-64/RunWasmCompiled_Regression_6858 BUG= Change-Id: Ib9640853ea15d73967683c1315e6b54b5b6cc3be Reviewed-on: https://chromium-review.googlesource.com/689794 Commit-Queue: Ivica Bogosavljevic Reviewed-by: Ivica Bogosavljevic Cr-Commit-Position: refs/heads/master@{#48228} --- src/compiler/mips/code-generator-mips.cc | 3 +++ src/compiler/mips64/code-generator-mips64.cc | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/src/compiler/mips/code-generator-mips.cc b/src/compiler/mips/code-generator-mips.cc index c157faf6bd..e4c8d2db60 100644 --- a/src/compiler/mips/code-generator-mips.cc +++ b/src/compiler/mips/code-generator-mips.cc @@ -3110,6 +3110,9 @@ void CodeGenerator::AssembleArchTrap(Instruction* instr, tasm()->isolate()), 0); __ LeaveFrame(StackFrame::WASM_COMPILED); + CallDescriptor* descriptor = gen_->linkage()->GetIncomingDescriptor(); + int pop_count = static_cast(descriptor->StackParameterCount()); + __ Drop(pop_count); __ Ret(); } else { gen_->AssembleSourcePosition(instr_); diff --git a/src/compiler/mips64/code-generator-mips64.cc b/src/compiler/mips64/code-generator-mips64.cc index acb19f2e28..2b11b1e93d 100644 --- a/src/compiler/mips64/code-generator-mips64.cc +++ b/src/compiler/mips64/code-generator-mips64.cc @@ -3402,6 +3402,10 @@ void CodeGenerator::AssembleArchTrap(Instruction* instr, tasm()->isolate()), 0); __ LeaveFrame(StackFrame::WASM_COMPILED); + CallDescriptor* descriptor = gen_->linkage()->GetIncomingDescriptor(); + int pop_count = static_cast(descriptor->StackParameterCount()); + pop_count += (pop_count & 1); // align + __ Drop(pop_count); __ Ret(); } else { gen_->AssembleSourcePosition(instr_);