[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:
test262-automation 2018-10-03 18:37:00 +00:00
parent a1c3929c35
commit 92143ed8c7
35 changed files with 118 additions and 57 deletions

View File

@ -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);
})();

View File

@ -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);
})();

View File

@ -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);

View File

@ -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;

View File

@ -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] }');

View File

@ -4,8 +4,6 @@
// Generated by tools/bigint-tester.py.
// Flags: --harmony-bigint
var data = [{
a: -0xc4043e2c4cc49e4d6870103ce7c2ff2d512bf4b1b67553ba410db514ee0af8888ad6cfn,
b: 0x2aae86de73ff479133a657a40d26e8dcf192019c7421836615ec34978bad93n,

View File

@ -4,8 +4,6 @@
// Generated by tools/bigint-tester.py.
// Flags: --harmony-bigint
var data = [{
a: 0x9252b94f220ded0c18706998886397699c5a25527575dn,
b: -0x286817ba2e8fd8n,

View File

@ -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);

View File

@ -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'

View File

@ -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'

View File

@ -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);

View File

@ -4,8 +4,6 @@
// Generated by tools/bigint-tester.py.
// Flags: --harmony-bigint
var data = [{
a: 0x26ffcdbd233a53e7ca4612f2b02e1f2c1d885c3177e7n,
r: 0x26ffcdbd233a53e7ca4612f2b02e1f2c1d885c3177e6n

View File

@ -4,8 +4,6 @@
// Generated by tools/bigint-tester.py.
// Flags: --harmony-bigint
var data = [{
a: -0x1e0f357314bac34227333c0c2086430dae88cb538f161174888591n,
b: 0x390n,

View File

@ -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);

View File

@ -4,8 +4,6 @@
// Generated by tools/bigint-tester.py.
// Flags: --harmony-bigint
var data = [{
a: 0xb3df90n,
r: 0xb3df91n

View File

@ -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'

View File

@ -4,8 +4,6 @@
// Generated by tools/bigint-tester.py.
// Flags: --harmony-bigint
var data = [{
a: 0xaed3c714bb42a73d708bcf1dc9a9deebadc913ef42bac6a6178a60n,
b: -0xf3d6bd1c059b79n,

View File

@ -4,8 +4,6 @@
// Generated by tools/bigint-tester.py.
// Flags: --harmony-bigint
var data = [{
a: 0x2bf1f236c2df29f7c99be052dfe1b69ae158d777fea487af889f6259f472c0n,
b: -0xae0090dfn,

View File

@ -4,8 +4,6 @@
// Generated by tools/bigint-tester.py.
// Flags: --harmony-bigint
var data = [{
a: 0xcn,
r: -0xcn

View File

@ -4,8 +4,6 @@
// Generated by tools/bigint-tester.py.
// Flags: --harmony-bigint
var data = [{
a: 0x9f0305cd75e4n,
r: -0x9f0305cd75e5n

View File

@ -4,8 +4,6 @@
// Generated by tools/bigint-tester.py.
// Flags: --harmony-bigint
var data = [{
a: 0x77a87n,
b: 0xde08e7433fb9584911b8cb4bc7eed802299b4489fc635974d063847da4e8b461df5dn,

View File

@ -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))

View File

@ -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);

View File

@ -4,8 +4,6 @@
// Generated by tools/bigint-tester.py.
// Flags: --harmony-bigint
var data = [{
a: 0x211a34fn,
b: 0xa6n,

View File

@ -4,8 +4,6 @@
// Generated by tools/bigint-tester.py.
// Flags: --harmony-bigint
var data = [{
a: -0xe813d76adc0a177778c0c232c595e8572b783210f4a7009d7c1787n,
b: 0x9en,

View File

@ -4,8 +4,6 @@
// Generated by tools/bigint-tester.py.
// Flags: --harmony-bigint
var data = [{
a: 0xc4fd438551d58edn,
b: 0x91b42ee55a50d974an,

View File

@ -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") {

View File

@ -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'

View File

@ -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);

View File

@ -4,8 +4,6 @@
// Generated by tools/bigint-tester.py.
// Flags: --harmony-bigint
var data = [{
a: -0x46505bec40d461c595b5e4be178b7d00n,
b: -0x9170e5437d4e3ec7c0971e2c6d3bbbd2929ff108ea4ee64f7a91aa367fn,

View File

@ -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,

View File

@ -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*/";

View File

@ -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.

View File

@ -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);

View File

@ -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',