From d3e7b48a8e5058d129923800cc63bf778bd4e9bd Mon Sep 17 00:00:00 2001 From: Victor Gomes Date: Fri, 11 Sep 2020 11:59:30 +0200 Subject: [PATCH] [wasm] Disable safe_to_skip_adaptor optimization This optimization does not work when the stack arguments are reversed. Change-Id: Ib543e6ca234cc70708909e0b3cd474b1309ec40e Bug: chromium:1126769, v8:10201 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2404775 Commit-Queue: Victor Gomes Commit-Queue: Jakob Kummerow Auto-Submit: Victor Gomes Reviewed-by: Jakob Kummerow Cr-Commit-Position: refs/heads/master@{#69842} --- src/compiler/wasm-compiler.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/compiler/wasm-compiler.cc b/src/compiler/wasm-compiler.cc index 3215de5396..7629152fa8 100644 --- a/src/compiler/wasm-compiler.cc +++ b/src/compiler/wasm-compiler.cc @@ -7072,10 +7072,14 @@ std::pair> ResolveWasmImportCall( Compiler::Compile(function, Compiler::CLEAR_EXCEPTION, &is_compiled_scope); } +#ifndef V8_REVERSE_JSARGS + // This optimization is disabled when the arguments are reversed. It will be + // subsumed when the argumens adaptor frame is removed. if (shared->is_safe_to_skip_arguments_adaptor()) { return std::make_pair( WasmImportCallKind::kJSFunctionArityMismatchSkipAdaptor, callable); } +#endif return std::make_pair(WasmImportCallKind::kJSFunctionArityMismatch, callable);