v8/test/mjsunit/regress/regress-1212583.js
Georg Neis cb25099bb4 [TurboFan] Add missing BigInt case in RepresentationChanger
Bug: chromium:1212583
Change-Id: I6cce7e419b108a0d30cf4d9d9bb0ba304fb0803e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2922249
Reviewed-by: Georg Neis <neis@chromium.org>
Commit-Queue: Georg Neis <neis@chromium.org>
Auto-Submit: Nico Hartmann <nicohartmann@chromium.org>
Cr-Commit-Position: refs/heads/master@{#74864}
2021-05-31 15:22:06 +00:00

26 lines
734 B
JavaScript

// Copyright 2021 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 --opt --no-always-opt
async function f(a, b) {
let x = 0xfffffffff;
if (b == 5) {
x = 0xffffffff1;
}
let y = Math.max(0xffffffff2, x);
return BigInt.asUintN(1, y);
};
%PrepareFunctionForOptimization(f);
assertThrowsAsync(f(1, 2), TypeError);
%OptimizeFunctionOnNextCall(f);
assertThrowsAsync(f(1, 2), TypeError);
if (%Is64Bit()) assertUnoptimized(f);
%PrepareFunctionForOptimization(f);
assertThrowsAsync(f(1, 2), TypeError);
%OptimizeFunctionOnNextCall(f);
assertThrowsAsync(f(1, 2), TypeError);
assertOptimized(f);