mirror of https://github.com/tc39/test262.git
[v8-test262-automation] Changes from https://github.com/v8/v8.git at sha 7b32eb8c on Wed Oct 03 2018 18:36:24 GMT+0000 (Coordinated Universal Time)
This commit is contained in:
parent
a1c3929c35
commit
92143ed8c7
|
@ -0,0 +1,76 @@
|
|||
// Copyright 2018 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
|
||||
|
||||
// Test that NumberAbs correctly deals with PositiveInteger \/ MinusZero
|
||||
// and turns the -0 into a 0.
|
||||
(function() {
|
||||
function foo(x) {
|
||||
x = Math.floor(x);
|
||||
x = Math.max(x, -0);
|
||||
return 1 / Math.abs(x);
|
||||
}
|
||||
|
||||
assertEquals(Infinity, foo(-0));
|
||||
assertEquals(Infinity, foo(-0));
|
||||
%OptimizeFunctionOnNextCall(foo);
|
||||
assertEquals(Infinity, foo(-0));
|
||||
})();
|
||||
|
||||
// Test that NumberAbs properly passes the kIdentifyZeros truncation
|
||||
// for Signed32 \/ MinusZero inputs.
|
||||
(function() {
|
||||
function foo(x) {
|
||||
return Math.abs(x * -2);
|
||||
}
|
||||
|
||||
assertEquals(2, foo(-1));
|
||||
assertEquals(4, foo(-2));
|
||||
%OptimizeFunctionOnNextCall(foo);
|
||||
assertEquals(2, foo(-1));
|
||||
assertEquals(4, foo(-2));
|
||||
assertOptimized(foo);
|
||||
// Now `foo` should stay optimized even if `x * -2` would produce `-0`.
|
||||
assertEquals(0, foo(0));
|
||||
assertOptimized(foo);
|
||||
})();
|
||||
|
||||
// Test that NumberAbs properly passes the kIdentifyZeros truncation
|
||||
// for Unsigned32 \/ MinusZero inputs.
|
||||
(function() {
|
||||
function foo(x) {
|
||||
x = x | 0;
|
||||
return Math.abs(Math.max(x * -2, 0));
|
||||
}
|
||||
|
||||
assertEquals(2, foo(-1));
|
||||
assertEquals(4, foo(-2));
|
||||
%OptimizeFunctionOnNextCall(foo);
|
||||
assertEquals(2, foo(-1));
|
||||
assertEquals(4, foo(-2));
|
||||
assertOptimized(foo);
|
||||
// Now `foo` should stay optimized even if `x * -2` would produce `-0`.
|
||||
assertEquals(0, foo(0));
|
||||
assertOptimized(foo);
|
||||
})();
|
||||
|
||||
// Test that NumberAbs properly passes the kIdentifyZeros truncation
|
||||
// for OrderedNumber inputs.
|
||||
(function() {
|
||||
function foo(x) {
|
||||
x = x | 0;
|
||||
return Math.abs(Math.min(x * -2, 2 ** 32));
|
||||
}
|
||||
|
||||
assertEquals(2, foo(-1));
|
||||
assertEquals(4, foo(-2));
|
||||
%OptimizeFunctionOnNextCall(foo);
|
||||
assertEquals(2, foo(-1));
|
||||
assertEquals(4, foo(-2));
|
||||
assertOptimized(foo);
|
||||
// Now `foo` should stay optimized even if `x * -2` would produce `-0`.
|
||||
assertEquals(0, foo(0));
|
||||
assertOptimized(foo);
|
||||
})();
|
|
@ -123,3 +123,34 @@
|
|||
assertEquals(1, foo(4));
|
||||
assertOptimized(foo);
|
||||
})();
|
||||
|
||||
// Test that NumberModulus works in the case where TurboFan
|
||||
// can infer that the output is Signed32 \/ MinusZero, and
|
||||
// there's a truncation on the result that identifies zeros
|
||||
// (via the SpeculativeNumberEqual).
|
||||
(function() {
|
||||
// We need a separately polluted % with NumberOrOddball feedback.
|
||||
function bar(x) { return x % 2; }
|
||||
bar(undefined); // The % feedback is now NumberOrOddball.
|
||||
|
||||
// Now we just use the gadget above on an `x` that is known
|
||||
// to be in Signed32 range and compare it to 0, which passes
|
||||
// a truncation that identifies zeros.
|
||||
function foo(x) {
|
||||
if (bar(x | 0) == 0) return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
assertEquals(0, foo(2));
|
||||
assertEquals(1, foo(1));
|
||||
%OptimizeFunctionOnNextCall(foo);
|
||||
assertEquals(0, foo(2));
|
||||
assertEquals(1, foo(1));
|
||||
assertOptimized(foo);
|
||||
|
||||
// Now `foo` should stay optimized even if `x % 2` would
|
||||
// produce -0, aka when we pass a negative value for `x`.
|
||||
assertEquals(0, foo(-2));
|
||||
assertEquals(1, foo(-1));
|
||||
assertOptimized(foo);
|
||||
})();
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
// Flags: --allow-natives-syntax --harmony-bigint
|
||||
// Flags: --allow-natives-syntax
|
||||
|
||||
function foo() { %_ToLength(42n) }
|
||||
assertThrows(foo, TypeError);
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
// Flags: --allow-natives-syntax --harmony-bigint
|
||||
// Flags: --allow-natives-syntax
|
||||
|
||||
const limit = %MaxSmi() + 1;
|
||||
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
// Copyright 2018 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: --noharmony-function-tostring
|
||||
|
||||
assertThrows(() => new Proxy(function() {}, {}).toString(), TypeError);
|
||||
assertEquals(new Proxy(function() {}, {}).toString(),
|
||||
'function () { [native code] }');
|
||||
|
|
|
@ -4,8 +4,6 @@
|
|||
|
||||
// Generated by tools/bigint-tester.py.
|
||||
|
||||
// Flags: --harmony-bigint
|
||||
|
||||
var data = [{
|
||||
a: -0xc4043e2c4cc49e4d6870103ce7c2ff2d512bf4b1b67553ba410db514ee0af8888ad6cfn,
|
||||
b: 0x2aae86de73ff479133a657a40d26e8dcf192019c7421836615ec34978bad93n,
|
||||
|
|
|
@ -4,8 +4,6 @@
|
|||
|
||||
// Generated by tools/bigint-tester.py.
|
||||
|
||||
// Flags: --harmony-bigint
|
||||
|
||||
var data = [{
|
||||
a: 0x9252b94f220ded0c18706998886397699c5a25527575dn,
|
||||
b: -0x286817ba2e8fd8n,
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
// Flags: --harmony-bigint
|
||||
|
||||
// BigInt.asIntN
|
||||
{
|
||||
assertEquals(2, BigInt.asIntN.length);
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
// Flags: --allow-natives-syntax --harmony-bigint
|
||||
// Flags: --allow-natives-syntax
|
||||
|
||||
'use strict'
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
// Flags: --allow-natives-syntax --harmony-bigint
|
||||
// Flags: --allow-natives-syntax
|
||||
|
||||
'use strict'
|
||||
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
// Flags: --harmony-bigint
|
||||
|
||||
var buffer = new ArrayBuffer(64);
|
||||
var dataview = new DataView(buffer, 8, 24);
|
||||
var bytes = new Uint8Array(buffer);
|
||||
|
|
|
@ -4,8 +4,6 @@
|
|||
|
||||
// Generated by tools/bigint-tester.py.
|
||||
|
||||
// Flags: --harmony-bigint
|
||||
|
||||
var data = [{
|
||||
a: 0x26ffcdbd233a53e7ca4612f2b02e1f2c1d885c3177e7n,
|
||||
r: 0x26ffcdbd233a53e7ca4612f2b02e1f2c1d885c3177e6n
|
||||
|
|
|
@ -4,8 +4,6 @@
|
|||
|
||||
// Generated by tools/bigint-tester.py.
|
||||
|
||||
// Flags: --harmony-bigint
|
||||
|
||||
var data = [{
|
||||
a: -0x1e0f357314bac34227333c0c2086430dae88cb538f161174888591n,
|
||||
b: 0x390n,
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
// Flags: --allow-natives-syntax --harmony-bigint
|
||||
// Flags: --allow-natives-syntax
|
||||
|
||||
assertEquals(1n, (-1n) ** 0n);
|
||||
assertEquals(-1n, (-1n) ** 1n);
|
||||
|
|
|
@ -4,8 +4,6 @@
|
|||
|
||||
// Generated by tools/bigint-tester.py.
|
||||
|
||||
// Flags: --harmony-bigint
|
||||
|
||||
var data = [{
|
||||
a: 0xb3df90n,
|
||||
r: 0xb3df91n
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
// Flags: --allow-natives-syntax --harmony-bigint
|
||||
// Flags: --allow-natives-syntax
|
||||
|
||||
'use strict'
|
||||
|
||||
|
|
|
@ -4,8 +4,6 @@
|
|||
|
||||
// Generated by tools/bigint-tester.py.
|
||||
|
||||
// Flags: --harmony-bigint
|
||||
|
||||
var data = [{
|
||||
a: 0xaed3c714bb42a73d708bcf1dc9a9deebadc913ef42bac6a6178a60n,
|
||||
b: -0xf3d6bd1c059b79n,
|
||||
|
|
|
@ -4,8 +4,6 @@
|
|||
|
||||
// Generated by tools/bigint-tester.py.
|
||||
|
||||
// Flags: --harmony-bigint
|
||||
|
||||
var data = [{
|
||||
a: 0x2bf1f236c2df29f7c99be052dfe1b69ae158d777fea487af889f6259f472c0n,
|
||||
b: -0xae0090dfn,
|
||||
|
|
|
@ -4,8 +4,6 @@
|
|||
|
||||
// Generated by tools/bigint-tester.py.
|
||||
|
||||
// Flags: --harmony-bigint
|
||||
|
||||
var data = [{
|
||||
a: 0xcn,
|
||||
r: -0xcn
|
||||
|
|
|
@ -4,8 +4,6 @@
|
|||
|
||||
// Generated by tools/bigint-tester.py.
|
||||
|
||||
// Flags: --harmony-bigint
|
||||
|
||||
var data = [{
|
||||
a: 0x9f0305cd75e4n,
|
||||
r: -0x9f0305cd75e5n
|
||||
|
|
|
@ -4,8 +4,6 @@
|
|||
|
||||
// Generated by tools/bigint-tester.py.
|
||||
|
||||
// Flags: --harmony-bigint
|
||||
|
||||
var data = [{
|
||||
a: 0x77a87n,
|
||||
b: 0xde08e7433fb9584911b8cb4bc7eed802299b4489fc635974d063847da4e8b461df5dn,
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
// Flags: --allow-natives-syntax --harmony-bigint
|
||||
// Flags: --allow-natives-syntax
|
||||
|
||||
function f(x, b) {
|
||||
if (b) return Math.trunc(+(x))
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
// Flags: --harmony-bigint
|
||||
|
||||
var a = 5n;
|
||||
var b = a / -1n;
|
||||
assertEquals(5n, a);
|
||||
|
|
|
@ -4,8 +4,6 @@
|
|||
|
||||
// Generated by tools/bigint-tester.py.
|
||||
|
||||
// Flags: --harmony-bigint
|
||||
|
||||
var data = [{
|
||||
a: 0x211a34fn,
|
||||
b: 0xa6n,
|
||||
|
|
|
@ -4,8 +4,6 @@
|
|||
|
||||
// Generated by tools/bigint-tester.py.
|
||||
|
||||
// Flags: --harmony-bigint
|
||||
|
||||
var data = [{
|
||||
a: -0xe813d76adc0a177778c0c232c595e8572b783210f4a7009d7c1787n,
|
||||
b: 0x9en,
|
||||
|
|
|
@ -4,8 +4,6 @@
|
|||
|
||||
// Generated by tools/bigint-tester.py.
|
||||
|
||||
// Flags: --harmony-bigint
|
||||
|
||||
var data = [{
|
||||
a: 0xc4fd438551d58edn,
|
||||
b: 0x91b42ee55a50d974an,
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
// Flags: --harmony-bigint
|
||||
|
||||
function Check(bigint, number_string) {
|
||||
var number = Number(bigint);
|
||||
if (number_string.substring(0, 2) === "0x") {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
// Flags: --allow-natives-syntax --harmony-bigint
|
||||
// Flags: --allow-natives-syntax
|
||||
|
||||
'use strict'
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
// Flags: --harmony-bigint --allow-natives-syntax
|
||||
// Flags: --allow-natives-syntax
|
||||
|
||||
var intarray = new BigInt64Array(8);
|
||||
var uintarray = new BigUint64Array(8);
|
||||
|
|
|
@ -4,8 +4,6 @@
|
|||
|
||||
// Generated by tools/bigint-tester.py.
|
||||
|
||||
// Flags: --harmony-bigint
|
||||
|
||||
var data = [{
|
||||
a: -0x46505bec40d461c595b5e4be178b7d00n,
|
||||
b: -0x9170e5437d4e3ec7c0971e2c6d3bbbd2929ff108ea4ee64f7a91aa367fn,
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
// Flags: --harmony-bigint
|
||||
|
||||
let TypedArrayConstructors = [
|
||||
BigUint64Array,
|
||||
BigInt64Array,
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
// Flags: --harmony-function-tostring
|
||||
|
||||
var prefix = "/*before*/";
|
||||
var suffix = "/*after*/";
|
||||
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
//
|
||||
// Flags: --harmony-function-tostring
|
||||
|
||||
// There was a bug in CreateDynamicFunction where a stack overflow
|
||||
// situation caused an assertion failure.
|
||||
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
// Flags: --harmony-string-trimming
|
||||
|
||||
assertEquals('trim', String.prototype.trim.name);
|
||||
assertEquals('trimStart', String.prototype.trimStart.name);
|
||||
assertEquals('trimStart', String.prototype.trimLeft.name);
|
||||
|
|
|
@ -42,7 +42,6 @@ from testrunner.outproc import test262
|
|||
|
||||
# TODO(littledan): move the flag mapping into the status file
|
||||
FEATURE_FLAGS = {
|
||||
'BigInt': '--harmony-bigint',
|
||||
'class-fields-public': '--harmony-public-fields',
|
||||
'class-static-fields-public': '--harmony-class-fields',
|
||||
'Array.prototype.flat': '--harmony-array-flat',
|
||||
|
|
Loading…
Reference in New Issue