forked from nodejs/node
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Original commit message: M86-LTS: [compiler] Fix bug in RepresentationChanger::GetWord32RepresentationFor We have to respect the TypeCheckKind. (cherry picked from commit fd29e246f65a7cee130e72cd10f618f3b82af232) No-Try: true No-Presubmit: true No-Tree-Checks: true Bug: chromium:1195777 Change-Id: If1eed719fef79b7c61d99c29ba869ddd7985c413 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2817791 Commit-Queue: Georg Neis <[email protected]> Reviewed-by: Nico Hartmann <[email protected]> Cr-Original-Commit-Position: refs/heads/master@{#73909} Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2838235 Owners-Override: Achuith Bhandarkar <[email protected]> Reviewed-by: Artem Sumaneev <[email protected]> Commit-Queue: Achuith Bhandarkar <[email protected]> Cr-Commit-Position: refs/branch-heads/8.6@{nodejs#79} Cr-Branched-From: a64aed2333abf49e494d2a5ce24bbd14fff19f60-refs/heads/8.6.395@{#1} Cr-Branched-From: a626bc036236c9bf92ac7b87dc40c9e538b087e3-refs/heads/master@{#69472} Refs: v8/v8@bbc59d1
- Loading branch information
Showing
3 changed files
with
67 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
// 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 | ||
|
||
|
||
(function() { | ||
function foo(b) { | ||
let y = (new Date(42)).getMilliseconds(); | ||
let x = -1; | ||
if (b) x = 0xFFFF_FFFF; | ||
return y < Math.max(1 << y, x, 1 + y); | ||
} | ||
assertTrue(foo(true)); | ||
%PrepareFunctionForOptimization(foo); | ||
assertTrue(foo(false)); | ||
%OptimizeFunctionOnNextCall(foo); | ||
assertTrue(foo(true)); | ||
})(); | ||
|
||
|
||
(function() { | ||
function foo(b) { | ||
let x = 0; | ||
if (b) x = -1; | ||
return x == Math.max(-1, x >>> Infinity); | ||
} | ||
assertFalse(foo(true)); | ||
%PrepareFunctionForOptimization(foo); | ||
assertTrue(foo(false)); | ||
%OptimizeFunctionOnNextCall(foo); | ||
assertFalse(foo(true)); | ||
})(); | ||
|
||
|
||
(function() { | ||
function foo(b) { | ||
let x = -1; | ||
if (b) x = 0xFFFF_FFFF; | ||
return -1 < Math.max(0, x, -1); | ||
} | ||
assertTrue(foo(true)); | ||
%PrepareFunctionForOptimization(foo); | ||
assertTrue(foo(false)); | ||
%OptimizeFunctionOnNextCall(foo); | ||
assertTrue(foo(true)); | ||
})(); | ||
|
||
|
||
(function() { | ||
function foo(b) { | ||
let x = 0x7FFF_FFFF; | ||
if (b) x = 0; | ||
return 0 < (Math.max(-5 >>> x, -5) % -5); | ||
} | ||
assertTrue(foo(true)); | ||
%PrepareFunctionForOptimization(foo); | ||
assertTrue(foo(false)); | ||
%OptimizeFunctionOnNextCall(foo); | ||
assertTrue(foo(true)); | ||
})(); |