From c681125cf9538965dfd78e51c60abd502eb78bc0 Mon Sep 17 00:00:00 2001 From: Georg Neis Date: Wed, 8 Jul 2020 12:48:30 +0200 Subject: [PATCH] [turbofan] Remove an incorrect DCHECK Due to an optimization in how resumable functions are compiled, we can actually see another Oddball type as StrictEquality inputs. I'm giving up on getting the DCHECK right and removing it entirely. Bug: chromium:1102683 Change-Id: Ia210777c66641e898e96900713710a51ebed311d Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2287494 Auto-Submit: Georg Neis Commit-Queue: Nico Hartmann Reviewed-by: Nico Hartmann Cr-Commit-Position: refs/heads/master@{#68735} --- src/compiler/operation-typer.cc | 4 ---- test/mjsunit/compiler/regress-1102683.js | 20 ++++++++++++++++++++ 2 files changed, 20 insertions(+), 4 deletions(-) create mode 100644 test/mjsunit/compiler/regress-1102683.js diff --git a/src/compiler/operation-typer.cc b/src/compiler/operation-typer.cc index fbce76716d..8b889c6948 100644 --- a/src/compiler/operation-typer.cc +++ b/src/compiler/operation-typer.cc @@ -1251,10 +1251,6 @@ Type OperationTyper::StrictEqual(Type lhs, Type rhs) { // Types are equal and are inhabited only by a single semantic value, // which is not nan due to the earlier check. DCHECK(lhs.Is(rhs)); - // TODO(neis): The last condition in this DCHECK is due the unittest - // throwing arbitrary types at the typer. This is not easy to fix. - DCHECK(lhs.Is(Type::NonInternal()) || lhs.Is(Type::Hole()) || - FLAG_testing_d8_test_runner); return singleton_true(); } if ((lhs.Is(Type::Unique()) || rhs.Is(Type::Unique())) && !lhs.Maybe(rhs)) { diff --git a/test/mjsunit/compiler/regress-1102683.js b/test/mjsunit/compiler/regress-1102683.js new file mode 100644 index 0000000000..2f9f5a75ba --- /dev/null +++ b/test/mjsunit/compiler/regress-1102683.js @@ -0,0 +1,20 @@ +// Copyright 2020 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 + +async function foo() { + for (let i = 0; i < 1; i++) { + while (i !== i) { + await 42; + function unused() {} + return; + } + } +} + +%PrepareFunctionForOptimization(foo); +foo(); +%OptimizeFunctionOnNextCall(foo); +foo();