-
Notifications
You must be signed in to change notification settings - Fork 30k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refs: v8/v8@9.0.257.17...9.0.257.19 PR-URL: #38270 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
- Loading branch information
Showing
8 changed files
with
139 additions
and
17 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
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
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)); | ||
})(); |
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,36 @@ | ||
// 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 | ||
|
||
let o1 = { a: 1, b: 0 }; | ||
let o2 = { a: 2, b: 0 }; | ||
assertTrue(%HaveSameMap(o1, o2)); | ||
assertTrue(%HasOwnConstDataProperty(o1, "a")); | ||
assertTrue(%HasOwnConstDataProperty(o1, "b")); | ||
|
||
Object.defineProperty(o1, "b", { | ||
value: 4.2, enumerable: true, configurable: true, writable: true, | ||
}); | ||
assertFalse(%HaveSameMap(o1, o2)); | ||
assertTrue(%HasOwnConstDataProperty(o1, "a")); | ||
assertFalse(%HasOwnConstDataProperty(o1, "b")); | ||
assertTrue(%HasOwnConstDataProperty(o2, "a")); | ||
assertTrue(%HasOwnConstDataProperty(o2, "b")); | ||
|
||
let o3 = { a: "foo", b: 0 }; | ||
assertFalse(%HaveSameMap(o2, o3)); | ||
assertTrue(%HasOwnConstDataProperty(o3, "a")); | ||
assertFalse(%HasOwnConstDataProperty(o3, "b")); | ||
|
||
Object.defineProperty(o2, "a", { | ||
value:2, enumerable: false, configurable: true, writable: true, | ||
}); | ||
assertFalse(%HasOwnConstDataProperty(o1, "a")); | ||
assertFalse(%HasOwnConstDataProperty(o1, "b")); | ||
assertFalse(%HasOwnConstDataProperty(o3, "a")); | ||
assertFalse(%HasOwnConstDataProperty(o3, "b")); | ||
|
||
assertFalse(%HasOwnConstDataProperty(o2, "a")); | ||
assertTrue(%HasOwnConstDataProperty(o2, "b")); |