v8/test/mjsunit/regress/regress-1400053.js
Qifan Pan c27adbd631 [turbofan] Fix bugs of ToBigIntConvertNumber
This CL fixes two bugs:

- The monotonicity violation in the typers of ToBigIntConvertNumber and
  Integral32OrMinusZeroToBigInt.
- The missing handling of conversion from Tagged output with the type
  DoubleRepresentableInt64OrMinusZero to Word64.

Bug: v8:9407, v8:13580, chromium:1399951, chromium:1400053
Change-Id: I669820b52e5b82bddc9853cfd97a2361c344a2cb
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4096990
Reviewed-by: Nico Hartmann <nicohartmann@chromium.org>
Commit-Queue: Qifan Pan <panq@google.com>
Cr-Commit-Position: refs/heads/main@{#84793}
2022-12-12 17:01:54 +00:00

25 lines
569 B
JavaScript

// Copyright 2022 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 --no-always-turbofan
function foo(x) {
return BigInt(x);
}
function bar() {
for (let i = 0; i < 1; ++i) {
// The empty closure weakens the range of {i} to infinity in several
// iterations.
function t() { }
foo(i);
}
}
%PrepareFunctionForOptimization(foo);
%PrepareFunctionForOptimization(bar);
bar();
%OptimizeFunctionOnNextCall(bar);
bar();