[v8-test262-automation] Changes from https://github.com/v8/v8.git at sha 0d75b76c on Wed Oct 24 2018 18:48:03 GMT+0000 (Coordinated Universal Time)

This commit is contained in:
test262-automation 2018-10-24 18:48:41 +00:00
parent 91bf2474c2
commit 7a46296123
10 changed files with 496 additions and 32 deletions

View File

@ -147,9 +147,6 @@ assertEquals(
'ar',
(new Intl.ListFormat(['xyz', 'ar'])).resolvedOptions().locale);
// The following is not working yet because it depend on the getAvailableLocales
// work in another path set.
// TODO(ftang): uncomment the following once that patchset is checked in.
// assertEquals(
// 'ar',
// (new Intl.ListFormat(['i-default', 'ar'])).resolvedOptions().locale);
assertEquals(
'ar',
(new Intl.ListFormat(['i-default', 'ar'])).resolvedOptions().locale);

View File

@ -154,9 +154,6 @@ assertEquals(
Intl.RelativeTimeFormat.prototype.resolvedOptions.call(receiver), TypeError);
}
// The following is not working yet because it depend on the getAvailableLocales
// work in another path set.
// TODO(ftang): uncomment the following once that patchset is checked in.
//assertEquals(
// 'ar',
// (new Intl.RelativeTimeFormat(['i-default', 'ar'])).resolvedOptions().locale);
assertEquals(
'ar',
(new Intl.RelativeTimeFormat(['i-default', 'ar'])).resolvedOptions().locale);

View File

@ -0,0 +1,177 @@
// 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 --noalways-opt
// Known receivers abstract equality.
(function() {
const a = {};
const b = {};
function foo() { return a == b; }
assertFalse(foo());
assertFalse(foo());
%OptimizeFunctionOnNextCall(foo);
assertFalse(foo());
})();
// Known receiver/null abstract equality.
(function() {
const a = {};
const b = null;
function foo() { return a == b; }
assertFalse(foo());
assertFalse(foo());
%OptimizeFunctionOnNextCall(foo);
assertFalse(foo());
})();
// Known null/receiver abstract equality.
(function() {
const a = null;
const b = {};
function foo() { return a == b; }
assertFalse(foo());
assertFalse(foo());
%OptimizeFunctionOnNextCall(foo);
assertFalse(foo());
})();
// Known receiver/undefined abstract equality.
(function() {
const a = {};
const b = undefined;
function foo() { return a == b; }
assertFalse(foo());
assertFalse(foo());
%OptimizeFunctionOnNextCall(foo);
assertFalse(foo());
})();
// Known undefined/receiver abstract equality.
(function() {
const a = undefined;
const b = {};
function foo() { return a == b; }
assertFalse(foo());
assertFalse(foo());
%OptimizeFunctionOnNextCall(foo);
assertFalse(foo());
})();
// Known receiver on one side strict equality.
(function() {
const a = {};
const b = {};
function foo(a) { return a == b; }
assertTrue(foo(b));
assertFalse(foo(a));
assertTrue(foo(b));
assertFalse(foo(a));
%OptimizeFunctionOnNextCall(foo);
assertTrue(foo(b));
assertFalse(foo(a));
// TurboFan bakes in feedback for the (unknown) left hand side.
assertFalse(foo(null));
assertUnoptimized(foo);
})();
// Known receiver on one side strict equality with null.
(function() {
const a = null;
const b = {};
function foo(a) { return a == b; }
assertTrue(foo(b));
assertFalse(foo(a));
assertTrue(foo(b));
assertFalse(foo(a));
%OptimizeFunctionOnNextCall(foo);
assertTrue(foo(b));
assertFalse(foo(a));
// TurboFan bakes in feedback for the (unknown) left hand side.
assertFalse(foo(1));
assertUnoptimized(foo);
})();
// Known receiver on one side strict equality with undefined.
(function() {
const a = undefined;
const b = {};
function foo(a) { return a == b; }
assertTrue(foo(b));
assertFalse(foo(a));
assertTrue(foo(b));
assertFalse(foo(a));
%OptimizeFunctionOnNextCall(foo);
assertTrue(foo(b));
assertFalse(foo(a));
// TurboFan bakes in feedback for the (unknown) left hand side.
assertFalse(foo(1));
assertUnoptimized(foo);
})();
// Known null on one side strict equality with receiver.
(function() {
const a = {};
const b = null;
function foo(a) { return a == b; }
assertTrue(foo(b));
assertFalse(foo(a));
assertTrue(foo(b));
assertFalse(foo(a));
%OptimizeFunctionOnNextCall(foo);
assertTrue(foo(b));
assertFalse(foo(a));
assertTrue(foo(null));
assertTrue(foo(undefined));
assertOptimized(foo);
// TurboFan doesn't need to bake in feedback, since it sees the null.
assertFalse(foo(1));
assertOptimized(foo);
})();
// Known undefined on one side strict equality with receiver.
(function() {
const a = {};
const b = undefined;
function foo(a) { return a == b; }
assertTrue(foo(b));
assertFalse(foo(a));
assertTrue(foo(b));
assertFalse(foo(a));
%OptimizeFunctionOnNextCall(foo);
assertTrue(foo(b));
assertFalse(foo(a));
assertTrue(foo(null));
assertTrue(foo(undefined));
assertOptimized(foo);
// TurboFan needs to bake in feedback, since undefined cannot
// be context specialized.
assertFalse(foo(1));
assertUnoptimized(foo);
})();

View File

@ -0,0 +1,119 @@
// 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 --noalways-opt
const undetectable = %GetUndetectable();
// Known undetectable abstract equality.
(function() {
const a = undetectable;
const b = {};
function foo() { return a == b; }
assertFalse(foo());
assertFalse(foo());
%OptimizeFunctionOnNextCall(foo);
assertFalse(foo());
})();
// Known undetectable/null abstract equality.
(function() {
const a = undetectable;
const b = null;
function foo() { return a == b; }
assertTrue(foo());
assertTrue(foo());
%OptimizeFunctionOnNextCall(foo);
assertTrue(foo());
})();
// Known undetectable/receiver abstract equality.
(function() {
const a = null;
const b = undetectable;
function foo() { return a == b; }
assertTrue(foo());
assertTrue(foo());
%OptimizeFunctionOnNextCall(foo);
assertTrue(foo());
})();
// Known undetectable/undefined abstract equality.
(function() {
const a = undetectable;
const b = undefined;
function foo() { return a == b; }
assertTrue(foo());
assertTrue(foo());
%OptimizeFunctionOnNextCall(foo);
assertTrue(foo());
})();
// Known undefined/undetectable abstract equality.
(function() {
const a = undefined;
const b = undetectable;
function foo() { return a == b; }
assertTrue(foo());
assertTrue(foo());
%OptimizeFunctionOnNextCall(foo);
assertTrue(foo());
})();
// Known undetectable on one side strict equality with receiver.
(function() {
const a = {};
const b = undetectable;
function foo(a) { return a == b; }
assertTrue(foo(b));
assertFalse(foo(a));
assertTrue(foo(b));
assertFalse(foo(a));
%OptimizeFunctionOnNextCall(foo);
assertTrue(foo(b));
assertFalse(foo(a));
// TurboFan doesn't need to bake in feedback, since it sees the undetectable.
assertFalse(foo(1));
assertOptimized(foo);
})();
// Unknown undetectable on one side strict equality with receiver.
(function() {
const a = undetectable;
const b = {};
function foo(a, b) { return a == b; }
assertTrue(foo(b, b));
assertFalse(foo(a, b));
assertTrue(foo(a, a));
assertFalse(foo(b, a));
assertTrue(foo(a, null));
assertFalse(foo(b, null));
%OptimizeFunctionOnNextCall(foo);
assertTrue(foo(b, b));
assertFalse(foo(a, b));
assertTrue(foo(a, a));
assertFalse(foo(b, a));
assertTrue(foo(a, null));
assertFalse(foo(b, null));
assertOptimized(foo);
// TurboFan bakes in feedback on the inputs.
assertFalse(foo(1));
assertUnoptimized(foo);
})();

View File

@ -0,0 +1,16 @@
// 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
// Make sure that we don't incorrectly truncate Oddball
// to Number for strict equality comparisons.
(function() {
function foo(x, y) { return x === y; }
assertTrue(foo(0.1, 0.1));
assertTrue(foo(undefined, undefined));
%OptimizeFunctionOnNextCall(foo);
assertTrue(foo(undefined, undefined));
})();

View File

@ -0,0 +1,152 @@
// 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 --noalways-opt
// Known receivers strict equality.
(function() {
const a = {};
const b = {};
function foo() { return a === b; }
assertFalse(foo());
assertFalse(foo());
%OptimizeFunctionOnNextCall(foo);
assertFalse(foo());
})();
// Known receiver/null strict equality.
(function() {
const a = {};
const b = null;
function foo() { return a === b; }
assertFalse(foo());
assertFalse(foo());
%OptimizeFunctionOnNextCall(foo);
assertFalse(foo());
})();
// Known receiver/undefined strict equality.
(function() {
const a = {};
const b = undefined;
function foo() { return a === b; }
assertFalse(foo());
assertFalse(foo());
%OptimizeFunctionOnNextCall(foo);
assertFalse(foo());
})();
// Known receiver on one side strict equality.
(function() {
const a = {};
const b = {};
function foo(a) { return a === b; }
assertTrue(foo(b));
assertFalse(foo(a));
assertTrue(foo(b));
assertFalse(foo(a));
%OptimizeFunctionOnNextCall(foo);
assertTrue(foo(b));
assertFalse(foo(a));
})();
// Known receiver on one side strict equality.
(function() {
const a = {};
const b = null;
function foo(a) { return a === b; }
assertTrue(foo(b));
assertFalse(foo(a));
assertTrue(foo(b));
assertFalse(foo(a));
%OptimizeFunctionOnNextCall(foo);
assertTrue(foo(b));
assertFalse(foo(a));
})();
// Known receiver on one side strict equality.
(function() {
const a = {};
const b = undefined;
function foo(a) { return a === b; }
assertTrue(foo(b));
assertFalse(foo(a));
assertTrue(foo(b));
assertFalse(foo(a));
%OptimizeFunctionOnNextCall(foo);
assertTrue(foo(b));
assertFalse(foo(a));
})();
// Feedback based receiver strict equality.
(function() {
const a = {};
const b = {};
function foo(a, b) { return a === b; }
assertTrue(foo(b, b));
assertFalse(foo(a, b));
assertTrue(foo(a, a));
assertFalse(foo(b, a));
%OptimizeFunctionOnNextCall(foo);
assertTrue(foo(a, a));
assertFalse(foo(b, a));
// TurboFan bakes in feedback for the left hand side.
assertFalse(foo(null, b));
assertUnoptimized(foo);
})();
// Feedback based receiver/null strict equality.
(function() {
const a = {};
const b = null;
function foo(a, b) { return a === b; }
assertTrue(foo(b, b));
assertFalse(foo(a, b));
assertTrue(foo(a, a));
assertFalse(foo(b, a));
%OptimizeFunctionOnNextCall(foo);
assertTrue(foo(a, a));
assertFalse(foo(b, a));
// TurboFan bakes in feedback for the left hand side.
assertFalse(foo(1, b));
assertUnoptimized(foo);
})();
// Feedback based receiver/undefined strict equality.
(function() {
const a = {};
const b = undefined;
function foo(a, b) { return a === b; }
assertTrue(foo(b, b));
assertFalse(foo(a, b));
assertTrue(foo(a, a));
assertFalse(foo(b, a));
%OptimizeFunctionOnNextCall(foo);
assertTrue(foo(a, a));
assertFalse(foo(b, a));
// TurboFan bakes in feedback for the left hand side.
assertFalse(foo(1, b));
assertUnoptimized(foo);
})();

View File

@ -100,3 +100,12 @@ function TestSlicedStringRegression() {
var iterator = sliced_string[Symbol.iterator]();
}
TestSlicedStringRegression();
(function(){
var str = "\uD83C\uDF1F\u5FCD\u8005\u306E\u653B\u6483\uD83C\uDF1F";
var arr = [...str];
assertEquals(["\uD83C\uDF1F", "\u5FCD", "\u8005", "\u306E", "\u653B",
"\u6483", "\uD83C\uDF1F"], arr);
assertEquals(7, arr.length);
})();

View File

@ -0,0 +1,12 @@
// 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: --enable-slow-asserts
async function* gen() {
const alwaysPending = new Promise(() => {});
alwaysPending.then = "non-callable then";
yield alwaysPending;
}
gen().next();

View File

@ -53,3 +53,8 @@ assertEquals(b, 43);
assertEquals(c, 43);
var c = (a, b = (function z(){ return a+1; })()) => { return b; };
assertEquals(c(314), 315);
// http://crbug.com/898076
(function() {
class foo {};
}); // Don't call IIFE so that it is compiled during idle time

View File

@ -1,20 +0,0 @@
// 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.
function TestError() {}
// Force slow, generic assess path that will always allocate a temporary fixed
// array.
String.prototype.__defineGetter__(0, function() { });
const a = new Array(2**32 - 1);
// Force early exit to avoid an unreasonably long test.
a[0] = {
toString() { throw new TestError(); }
};
// Verify join throws test error and does not fail due to asserts (Negative
// length fixed array allocation).
assertThrows(() => a.join(), TestError);