Commit 0fc1f3a9 authored by Nico Hartmann's avatar Nico Hartmann Committed by Commit Bot

Fixes argument CHECKs in serializer that are too strict

Bug: chromium:1021712
Change-Id: I9523760f2fa11726dd7015058b2267035f3f9f7a
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1903442
Commit-Queue: Nico Hartmann <nicohartmann@chromium.org>
Reviewed-by: 's avatarMaya Lekova <mslekova@chromium.org>
Cr-Commit-Position: refs/heads/master@{#64842}
parent 0ede421b
......@@ -2073,24 +2073,27 @@ void SerializerForBackgroundCompilation::ProcessBuiltinCall(
case Builtins::kPromisePrototypeCatch: {
// For JSCallReducer::ReducePromisePrototypeCatch.
if (speculation_mode != SpeculationMode::kDisallowSpeculation) {
CHECK_GE(arguments.size(), 1);
ProcessMapHintsForPromises(arguments[0]);
if (arguments.size() >= 1) {
ProcessMapHintsForPromises(arguments[0]);
}
}
break;
}
case Builtins::kPromisePrototypeFinally: {
// For JSCallReducer::ReducePromisePrototypeFinally.
if (speculation_mode != SpeculationMode::kDisallowSpeculation) {
CHECK_GE(arguments.size(), 1);
ProcessMapHintsForPromises(arguments[0]);
if (arguments.size() >= 1) {
ProcessMapHintsForPromises(arguments[0]);
}
}
break;
}
case Builtins::kPromisePrototypeThen: {
// For JSCallReducer::ReducePromisePrototypeThen.
if (speculation_mode != SpeculationMode::kDisallowSpeculation) {
CHECK_GE(arguments.size(), 1);
ProcessMapHintsForPromises(arguments[0]);
if (arguments.size() >= 1) {
ProcessMapHintsForPromises(arguments[0]);
}
}
break;
}
......
// Copyright 2019 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --allow-natives-syntax
function f() {
Promise.prototype.then.call()
}
%PrepareFunctionForOptimization(f);
try {
f();
} catch (e) {}
%OptimizeFunctionOnNextCall(f);
assertThrows(() => f(), TypeError);
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