From 43cce788bd52e1f672d1dbc8536b8a69fd3a8af6 Mon Sep 17 00:00:00 2001 From: test262-automation Date: Fri, 9 Nov 2018 18:56:19 +0000 Subject: [PATCH] [v8-test262-automation] Changes from https://github.com/v8/v8.git at sha d540724b on Fri Nov 09 2018 18:55:42 GMT+0000 (Coordinated Universal Time) --- .../v8/intl/intl.status | 18 +- .../v8/intl/regress-8413-day.js | 3 +- .../v8/intl/regress-8413-era.js | 3 +- .../v8/intl/regress-8413-hour.js | 3 +- .../v8/intl/regress-8413-minute.js | 3 +- .../v8/intl/regress-8413-month.js | 3 +- .../v8/intl/regress-8413-second.js | 3 +- .../v8/intl/regress-8413-timeZoneName.js | 3 +- .../v8/intl/regress-8413-weekday.js | 3 +- .../v8/intl/regress-8413-year.js | 3 +- .../v8/intl/regress-8432.js | 42 +++ .../v8/mjsunit/es6/classes.js | 27 +- .../v8/mjsunit/es9/regress/regress-902965.js | 12 + .../v8/mjsunit/es9/regress/regress-903070.js | 15 + .../v8/mjsunit/harmony/bigint/as-int-n.js | 4 + .../default-parameter-do-expression.js | 21 -- .../do-expressions-arrow-param-scope.js | 95 ------ .../mjsunit/harmony/do-expressions-control.js | 109 ------- .../v8/mjsunit/harmony/do-expressions.js | 305 ------------------ .../v8/mjsunit/harmony/generators.js | 10 +- .../mjsunit/harmony/regress/regress-4658.js | 21 -- .../mjsunit/harmony/regress/regress-4755.js | 45 --- .../mjsunit/harmony/regress/regress-4904.js | 24 -- .../mjsunit/harmony/regress/regress-546967.js | 16 - .../harmony/regress/regress-crbug-578038.js | 16 - .../v8/mjsunit/regress/regress-813440.js | 2 +- .../v8/mjsunit/regress/regress-896326.js | 11 + .../mjsunit/regress/regress-crbug-546968.js | 14 - .../mjsunit/regress/regress-crbug-903043.js | 39 +++ .../regress/regress-osr-in-case-label.js | 18 -- .../mjsunit/regress/regress-osr-in-literal.js | 30 -- .../v8/mjsunit/regress/wasm/regress-734108.js | 2 - 32 files changed, 149 insertions(+), 774 deletions(-) create mode 100644 implementation-contributed/v8/intl/regress-8432.js create mode 100644 implementation-contributed/v8/mjsunit/es9/regress/regress-902965.js create mode 100644 implementation-contributed/v8/mjsunit/es9/regress/regress-903070.js delete mode 100644 implementation-contributed/v8/mjsunit/harmony/default-parameter-do-expression.js delete mode 100644 implementation-contributed/v8/mjsunit/harmony/do-expressions-arrow-param-scope.js delete mode 100644 implementation-contributed/v8/mjsunit/harmony/do-expressions-control.js delete mode 100644 implementation-contributed/v8/mjsunit/harmony/do-expressions.js delete mode 100644 implementation-contributed/v8/mjsunit/harmony/regress/regress-4658.js delete mode 100644 implementation-contributed/v8/mjsunit/harmony/regress/regress-4755.js delete mode 100644 implementation-contributed/v8/mjsunit/harmony/regress/regress-4904.js delete mode 100644 implementation-contributed/v8/mjsunit/harmony/regress/regress-546967.js delete mode 100644 implementation-contributed/v8/mjsunit/harmony/regress/regress-crbug-578038.js create mode 100644 implementation-contributed/v8/mjsunit/regress/regress-896326.js delete mode 100644 implementation-contributed/v8/mjsunit/regress/regress-crbug-546968.js create mode 100644 implementation-contributed/v8/mjsunit/regress/regress-crbug-903043.js delete mode 100644 implementation-contributed/v8/mjsunit/regress/regress-osr-in-case-label.js delete mode 100644 implementation-contributed/v8/mjsunit/regress/regress-osr-in-literal.js diff --git a/implementation-contributed/v8/intl/intl.status b/implementation-contributed/v8/intl/intl.status index 3280852788..2d16bbadbd 100644 --- a/implementation-contributed/v8/intl/intl.status +++ b/implementation-contributed/v8/intl/intl.status @@ -29,9 +29,6 @@ [ALWAYS, { # TODO(jochen): The following test is flaky. 'overrides/caching': [PASS, FAIL], - - # https://bugs.chromium.org/p/v8/issues/detail?id=8414 - 'regress-8414': [FAIL], }], # ALWAYS ['variant == no_wasm_traps', { @@ -52,16 +49,11 @@ 'relative-time-format/default-locale-fr-CA': [FAIL], 'relative-time-format/default-locale-pt-BR': [FAIL], - # These tests use some locales which are unsupported on Android. - 'regress-8413-day': [FAIL], - 'regress-8413-era': [FAIL], - 'regress-8413-hour': [FAIL], - 'regress-8413-minute': [FAIL], - 'regress-8413-month': [FAIL], - 'regress-8413-second': [FAIL], - 'regress-8413-timeZoneName': [FAIL], - 'regress-8413-weekday': [FAIL], - 'regress-8413-year': [FAIL], + # https://bugs.chromium.org/p/v8/issues/detail?id=8432 + 'regress-8432': [FAIL], + + # https://crbug.com/v8/8414 + 'regress-8414': [FAIL], }], # 'system == android' ['tsan', { # Run for too long under some tsan configs. diff --git a/implementation-contributed/v8/intl/regress-8413-day.js b/implementation-contributed/v8/intl/regress-8413-day.js index 52881ac671..3bb5a30d5f 100644 --- a/implementation-contributed/v8/intl/regress-8413-day.js +++ b/implementation-contributed/v8/intl/regress-8413-day.js @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +// "ar-SA" has problem on Android, split it to regress-8432.js // All the known locales egrep by // find third_party/icu/source/data/locales/*.txt|cut -d: -f 1| \ // sort -u|cut -d/ -f6|cut -d. -f1|tr "_" "-" @@ -9,7 +10,7 @@ let locales = [ "af-NA", "af", "af-ZA", "agq-CM", "agq", "ak-GH", "ak", "am-ET", "am", "an", "ar-001", "ar-AE", "ar-BH", "ar-DJ", "ar-DZ", "ar-EG", "ar-EH", "ar-ER", "ar-IL", "ar-IQ", "ar-JO", "ar-KM", "ar-KW", "ar-LB", "ar-LY", "ar-MA", - "ar-MR", "ar-OM", "ar-PS", "ar-QA", "ar-SA", "ar-SD", "ar-SO", "ar-SS", + "ar-MR", "ar-OM", "ar-PS", "ar-QA", /* "ar-SA", */ "ar-SD", "ar-SO", "ar-SS", "ars", "ar-SY", "ar-TD", "ar-TN", "ar", "ar-YE", "asa", "asa-TZ", "as-IN", "ast-ES", "ast", "as", "az-AZ", "az-Cyrl-AZ", "az-Cyrl", "az-Latn-AZ", "az-Latn", "az", "bas-CM", "bas", "be-BY", "bem", "bem-ZM", "be", "bez", diff --git a/implementation-contributed/v8/intl/regress-8413-era.js b/implementation-contributed/v8/intl/regress-8413-era.js index 7efbca8fc5..1330c47a20 100644 --- a/implementation-contributed/v8/intl/regress-8413-era.js +++ b/implementation-contributed/v8/intl/regress-8413-era.js @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +// "ar-SA" has problem on Android, split it to regress-8432.js // All the known locales egrep by // find third_party/icu/source/data/locales/*.txt|cut -d: -f 1| \ // sort -u|cut -d/ -f6|cut -d. -f1|tr "_" "-" @@ -9,7 +10,7 @@ let locales = [ "af-NA", "af", "af-ZA", "agq-CM", "agq", "ak-GH", "ak", "am-ET", "am", "an", "ar-001", "ar-AE", "ar-BH", "ar-DJ", "ar-DZ", "ar-EG", "ar-EH", "ar-ER", "ar-IL", "ar-IQ", "ar-JO", "ar-KM", "ar-KW", "ar-LB", "ar-LY", "ar-MA", - "ar-MR", "ar-OM", "ar-PS", "ar-QA", "ar-SA", "ar-SD", "ar-SO", "ar-SS", + "ar-MR", "ar-OM", "ar-PS", "ar-QA", /* "ar-SA", */ "ar-SD", "ar-SO", "ar-SS", "ars", "ar-SY", "ar-TD", "ar-TN", "ar", "ar-YE", "asa", "asa-TZ", "as-IN", "ast-ES", "ast", "as", "az-AZ", "az-Cyrl-AZ", "az-Cyrl", "az-Latn-AZ", "az-Latn", "az", "bas-CM", "bas", "be-BY", "bem", "bem-ZM", "be", "bez", diff --git a/implementation-contributed/v8/intl/regress-8413-hour.js b/implementation-contributed/v8/intl/regress-8413-hour.js index 5b08ac2291..b392658548 100644 --- a/implementation-contributed/v8/intl/regress-8413-hour.js +++ b/implementation-contributed/v8/intl/regress-8413-hour.js @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +// "ar-SA" has problem on Android, split it to regress-8432.js // All the known locales egrep by // find third_party/icu/source/data/locales/*.txt|cut -d: -f 1| \ // sort -u|cut -d/ -f6|cut -d. -f1|tr "_" "-" @@ -9,7 +10,7 @@ let locales = [ "af-NA", "af", "af-ZA", "agq-CM", "agq", "ak-GH", "ak", "am-ET", "am", "an", "ar-001", "ar-AE", "ar-BH", "ar-DJ", "ar-DZ", "ar-EG", "ar-EH", "ar-ER", "ar-IL", "ar-IQ", "ar-JO", "ar-KM", "ar-KW", "ar-LB", "ar-LY", "ar-MA", - "ar-MR", "ar-OM", "ar-PS", "ar-QA", "ar-SA", "ar-SD", "ar-SO", "ar-SS", + "ar-MR", "ar-OM", "ar-PS", "ar-QA", /* "ar-SA", */ "ar-SD", "ar-SO", "ar-SS", "ars", "ar-SY", "ar-TD", "ar-TN", "ar", "ar-YE", "asa", "asa-TZ", "as-IN", "ast-ES", "ast", "as", "az-AZ", "az-Cyrl-AZ", "az-Cyrl", "az-Latn-AZ", "az-Latn", "az", "bas-CM", "bas", "be-BY", "bem", "bem-ZM", "be", "bez", diff --git a/implementation-contributed/v8/intl/regress-8413-minute.js b/implementation-contributed/v8/intl/regress-8413-minute.js index 3542319731..a267a9ecc2 100644 --- a/implementation-contributed/v8/intl/regress-8413-minute.js +++ b/implementation-contributed/v8/intl/regress-8413-minute.js @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +// "ar-SA" has problem on Android, split it to regress-8432.js // All the known locales egrep by // find third_party/icu/source/data/locales/*.txt|cut -d: -f 1| \ // sort -u|cut -d/ -f6|cut -d. -f1|tr "_" "-" @@ -9,7 +10,7 @@ let locales = [ "af-NA", "af", "af-ZA", "agq-CM", "agq", "ak-GH", "ak", "am-ET", "am", "an", "ar-001", "ar-AE", "ar-BH", "ar-DJ", "ar-DZ", "ar-EG", "ar-EH", "ar-ER", "ar-IL", "ar-IQ", "ar-JO", "ar-KM", "ar-KW", "ar-LB", "ar-LY", "ar-MA", - "ar-MR", "ar-OM", "ar-PS", "ar-QA", "ar-SA", "ar-SD", "ar-SO", "ar-SS", + "ar-MR", "ar-OM", "ar-PS", "ar-QA", /* "ar-SA", */ "ar-SD", "ar-SO", "ar-SS", "ars", "ar-SY", "ar-TD", "ar-TN", "ar", "ar-YE", "asa", "asa-TZ", "as-IN", "ast-ES", "ast", "as", "az-AZ", "az-Cyrl-AZ", "az-Cyrl", "az-Latn-AZ", "az-Latn", "az", "bas-CM", "bas", "be-BY", "bem", "bem-ZM", "be", "bez", diff --git a/implementation-contributed/v8/intl/regress-8413-month.js b/implementation-contributed/v8/intl/regress-8413-month.js index 530745b555..e14f1a345d 100644 --- a/implementation-contributed/v8/intl/regress-8413-month.js +++ b/implementation-contributed/v8/intl/regress-8413-month.js @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +// "ar-SA" has problem on Android, split it to regress-8432.js // All the known locales egrep by // find third_party/icu/source/data/locales/*.txt|cut -d: -f 1| \ // sort -u|cut -d/ -f6|cut -d. -f1|tr "_" "-" @@ -9,7 +10,7 @@ let locales = [ "af-NA", "af", "af-ZA", "agq-CM", "agq", "ak-GH", "ak", "am-ET", "am", "an", "ar-001", "ar-AE", "ar-BH", "ar-DJ", "ar-DZ", "ar-EG", "ar-EH", "ar-ER", "ar-IL", "ar-IQ", "ar-JO", "ar-KM", "ar-KW", "ar-LB", "ar-LY", "ar-MA", - "ar-MR", "ar-OM", "ar-PS", "ar-QA", "ar-SA", "ar-SD", "ar-SO", "ar-SS", + "ar-MR", "ar-OM", "ar-PS", "ar-QA", /* "ar-SA", */ "ar-SD", "ar-SO", "ar-SS", "ars", "ar-SY", "ar-TD", "ar-TN", "ar", "ar-YE", "asa", "asa-TZ", "as-IN", "ast-ES", "ast", "as", "az-AZ", "az-Cyrl-AZ", "az-Cyrl", "az-Latn-AZ", "az-Latn", "az", "bas-CM", "bas", "be-BY", "bem", "bem-ZM", "be", "bez", diff --git a/implementation-contributed/v8/intl/regress-8413-second.js b/implementation-contributed/v8/intl/regress-8413-second.js index 37aaefbfee..480c747d9b 100644 --- a/implementation-contributed/v8/intl/regress-8413-second.js +++ b/implementation-contributed/v8/intl/regress-8413-second.js @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +// "ar-SA" has problem on Android, split it to regress-8432.js // All the known locales egrep by // find third_party/icu/source/data/locales/*.txt|cut -d: -f 1| \ // sort -u|cut -d/ -f6|cut -d. -f1|tr "_" "-" @@ -9,7 +10,7 @@ let locales = [ "af-NA", "af", "af-ZA", "agq-CM", "agq", "ak-GH", "ak", "am-ET", "am", "an", "ar-001", "ar-AE", "ar-BH", "ar-DJ", "ar-DZ", "ar-EG", "ar-EH", "ar-ER", "ar-IL", "ar-IQ", "ar-JO", "ar-KM", "ar-KW", "ar-LB", "ar-LY", "ar-MA", - "ar-MR", "ar-OM", "ar-PS", "ar-QA", "ar-SA", "ar-SD", "ar-SO", "ar-SS", + "ar-MR", "ar-OM", "ar-PS", "ar-QA", /* "ar-SA", */ "ar-SD", "ar-SO", "ar-SS", "ars", "ar-SY", "ar-TD", "ar-TN", "ar", "ar-YE", "asa", "asa-TZ", "as-IN", "ast-ES", "ast", "as", "az-AZ", "az-Cyrl-AZ", "az-Cyrl", "az-Latn-AZ", "az-Latn", "az", "bas-CM", "bas", "be-BY", "bem", "bem-ZM", "be", "bez", diff --git a/implementation-contributed/v8/intl/regress-8413-timeZoneName.js b/implementation-contributed/v8/intl/regress-8413-timeZoneName.js index 28fda9861f..a0bfbc5e9d 100644 --- a/implementation-contributed/v8/intl/regress-8413-timeZoneName.js +++ b/implementation-contributed/v8/intl/regress-8413-timeZoneName.js @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +// "ar-SA" has problem on Android, split it to regress-8432.js // All the known locales egrep by // find third_party/icu/source/data/locales/*.txt|cut -d: -f 1| \ // sort -u|cut -d/ -f6|cut -d. -f1|tr "_" "-" @@ -9,7 +10,7 @@ let locales = [ "af-NA", "af", "af-ZA", "agq-CM", "agq", "ak-GH", "ak", "am-ET", "am", "an", "ar-001", "ar-AE", "ar-BH", "ar-DJ", "ar-DZ", "ar-EG", "ar-EH", "ar-ER", "ar-IL", "ar-IQ", "ar-JO", "ar-KM", "ar-KW", "ar-LB", "ar-LY", "ar-MA", - "ar-MR", "ar-OM", "ar-PS", "ar-QA", "ar-SA", "ar-SD", "ar-SO", "ar-SS", + "ar-MR", "ar-OM", "ar-PS", "ar-QA", /* "ar-SA", */ "ar-SD", "ar-SO", "ar-SS", "ars", "ar-SY", "ar-TD", "ar-TN", "ar", "ar-YE", "asa", "asa-TZ", "as-IN", "ast-ES", "ast", "as", "az-AZ", "az-Cyrl-AZ", "az-Cyrl", "az-Latn-AZ", "az-Latn", "az", "bas-CM", "bas", "be-BY", "bem", "bem-ZM", "be", "bez", diff --git a/implementation-contributed/v8/intl/regress-8413-weekday.js b/implementation-contributed/v8/intl/regress-8413-weekday.js index 9d399e727f..9a373221b1 100644 --- a/implementation-contributed/v8/intl/regress-8413-weekday.js +++ b/implementation-contributed/v8/intl/regress-8413-weekday.js @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +// "ar-SA" has problem on Android, split it to regress-8432.js // All the known locales egrep by // find third_party/icu/source/data/locales/*.txt|cut -d: -f 1| \ // sort -u|cut -d/ -f6|cut -d. -f1|tr "_" "-" @@ -9,7 +10,7 @@ let locales = [ "af-NA", "af", "af-ZA", "agq-CM", "agq", "ak-GH", "ak", "am-ET", "am", "an", "ar-001", "ar-AE", "ar-BH", "ar-DJ", "ar-DZ", "ar-EG", "ar-EH", "ar-ER", "ar-IL", "ar-IQ", "ar-JO", "ar-KM", "ar-KW", "ar-LB", "ar-LY", "ar-MA", - "ar-MR", "ar-OM", "ar-PS", "ar-QA", "ar-SA", "ar-SD", "ar-SO", "ar-SS", + "ar-MR", "ar-OM", "ar-PS", "ar-QA", /* "ar-SA", */ "ar-SD", "ar-SO", "ar-SS", "ars", "ar-SY", "ar-TD", "ar-TN", "ar", "ar-YE", "asa", "asa-TZ", "as-IN", "ast-ES", "ast", "as", "az-AZ", "az-Cyrl-AZ", "az-Cyrl", "az-Latn-AZ", "az-Latn", "az", "bas-CM", "bas", "be-BY", "bem", "bem-ZM", "be", "bez", diff --git a/implementation-contributed/v8/intl/regress-8413-year.js b/implementation-contributed/v8/intl/regress-8413-year.js index 9702a2542d..ecb8ab4722 100644 --- a/implementation-contributed/v8/intl/regress-8413-year.js +++ b/implementation-contributed/v8/intl/regress-8413-year.js @@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +// "ar-SA" has problem on Android, split it to regress-8432.js // All the known locales egrep by // find third_party/icu/source/data/locales/*.txt|cut -d: -f 1| \ // sort -u|cut -d/ -f6|cut -d. -f1|tr "_" "-" @@ -9,7 +10,7 @@ let locales = [ "af-NA", "af", "af-ZA", "agq-CM", "agq", "ak-GH", "ak", "am-ET", "am", "an", "ar-001", "ar-AE", "ar-BH", "ar-DJ", "ar-DZ", "ar-EG", "ar-EH", "ar-ER", "ar-IL", "ar-IQ", "ar-JO", "ar-KM", "ar-KW", "ar-LB", "ar-LY", "ar-MA", - "ar-MR", "ar-OM", "ar-PS", "ar-QA", "ar-SA", "ar-SD", "ar-SO", "ar-SS", + "ar-MR", "ar-OM", "ar-PS", "ar-QA", /* "ar-SA", */ "ar-SD", "ar-SO", "ar-SS", "ars", "ar-SY", "ar-TD", "ar-TN", "ar", "ar-YE", "asa", "asa-TZ", "as-IN", "ast-ES", "ast", "as", "az-AZ", "az-Cyrl-AZ", "az-Cyrl", "az-Latn-AZ", "az-Latn", "az", "bas-CM", "bas", "be-BY", "bem", "bem-ZM", "be", "bez", diff --git a/implementation-contributed/v8/intl/regress-8432.js b/implementation-contributed/v8/intl/regress-8432.js new file mode 100644 index 0000000000..5bf9fb6cd8 --- /dev/null +++ b/implementation-contributed/v8/intl/regress-8432.js @@ -0,0 +1,42 @@ +// 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. + +// Somehow only ar-SA fail on Android in regress-8413*.js +// Split it into this test just for ar-SA +// This is likely to be an ICU data trimming issue only apply to Android. +let locales = [ "ar-SA" ]; + +// "Table 5: Components of date and time formats" as in +// https://ecma-international.org/ecma-402/#sec-datetimeformat-abstracts +let table5 = [ + ["weekday", ["narrow", "short", "long"]], + ["era", ["narrow", "short", "long"]], + ["year", ["2-digit", "numeric"]], + ["month", ["2-digit", "numeric", "narrow", "short", "long"]], + ["day", ["2-digit", "numeric"]], + ["hour", ["2-digit", "numeric"]], + ["minute", ["2-digit", "numeric"]], + ["second", ["2-digit", "numeric"]], + ["timeZoneName", ["short", "long"]] +]; + +// Test each locale +for (let loc of locales) { + // Test each property in Table 5 + for (let row of table5) { + let prop = row[0]; + let values = row[1]; + // Test each value of the property + for (let value of values) { + let opt = {}; + opt[prop] = value; + let dft = new Intl.DateTimeFormat([loc], opt); + let result = dft.resolvedOptions(); + assertTrue(values.indexOf(result[prop]) >= 0, + "Expect new Intl.DateTimeFormat([" + loc + "], {" + prop + ": '" + + value + "'}).resolvedOptions()['" + prop + "'] to return one of [" + + values + "] but got '" + result[prop] + "'"); + } + } +} diff --git a/implementation-contributed/v8/mjsunit/es6/classes.js b/implementation-contributed/v8/mjsunit/es6/classes.js index a123dadc52..b0f44db92b 100644 --- a/implementation-contributed/v8/mjsunit/es6/classes.js +++ b/implementation-contributed/v8/mjsunit/es6/classes.js @@ -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-do-expressions +// Flags: --allow-natives-syntax (function TestBasics() { var C = class C {} @@ -1038,31 +1038,6 @@ function testClassRestrictedProperties(C) { (function testReturnFromClassLiteral() { - function usingDoExpressionInBody() { - let x = 42; - let dummy = function() {x}; - try { - class C { - dummy() {C} - [do {return}]() {} - }; - } finally { - return x; - } - } - assertEquals(42, usingDoExpressionInBody()); - - function usingDoExpressionInExtends() { - let x = 42; - let dummy = function() {x}; - try { - class C extends (do {return}) { dummy() {C} }; - } finally { - return x; - } - } - assertEquals(42, usingDoExpressionInExtends()); - function usingYieldInBody() { function* foo() { class C { diff --git a/implementation-contributed/v8/mjsunit/es9/regress/regress-902965.js b/implementation-contributed/v8/mjsunit/es9/regress/regress-902965.js new file mode 100644 index 0000000000..e2035b242f --- /dev/null +++ b/implementation-contributed/v8/mjsunit/es9/regress/regress-902965.js @@ -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. + +// Previously, spreading in-object properties would always treat double fields +// as tagged, potentially dereferencing a Float64. +function inobjectDouble() { + "use strict"; + this.x = -3.9; +} +const instance = new inobjectDouble(); +const clone = { ...instance, }; diff --git a/implementation-contributed/v8/mjsunit/es9/regress/regress-903070.js b/implementation-contributed/v8/mjsunit/es9/regress/regress-903070.js new file mode 100644 index 0000000000..cca02ee0c4 --- /dev/null +++ b/implementation-contributed/v8/mjsunit/es9/regress/regress-903070.js @@ -0,0 +1,15 @@ +// 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 clone(src) { + return { ...src }; +} + +function inobjectDoubles() { + "use strict"; + this.p0 = -6400510997704731; +} + +// Check that unboxed double is not treated as tagged +assertEquals({ p0: -6400510997704731 }, clone(new inobjectDoubles())); diff --git a/implementation-contributed/v8/mjsunit/harmony/bigint/as-int-n.js b/implementation-contributed/v8/mjsunit/harmony/bigint/as-int-n.js index 154a0929e5..ef48cadcc6 100644 --- a/implementation-contributed/v8/mjsunit/harmony/bigint/as-int-n.js +++ b/implementation-contributed/v8/mjsunit/harmony/bigint/as-int-n.js @@ -145,6 +145,10 @@ assertEquals(-4n, BigInt.asIntN(3, "12")); assertEquals(0x123456789abcdefn, BigInt.asIntN(64, 0xabcdef0123456789abcdefn)); +}{ + // Regression test for crbug.com/v8/8426. + assertEquals(-0x8000000000000000n, + BigInt.asIntN(64, -0x8000000000000000n)); } // BigInt.asUintN diff --git a/implementation-contributed/v8/mjsunit/harmony/default-parameter-do-expression.js b/implementation-contributed/v8/mjsunit/harmony/default-parameter-do-expression.js deleted file mode 100644 index cb80d246bc..0000000000 --- a/implementation-contributed/v8/mjsunit/harmony/default-parameter-do-expression.js +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2016 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: --harmony-do-expressions --nolazy - -function hoist_unique_do_var() { - var f = (y = do { var unique = 3 }) => unique; - assertEquals(3, f()); - assertThrows(() => unique, ReferenceError); -} -hoist_unique_do_var(); - -function hoist_duplicate_do_var() { - var duplicate = 100; - var f = (y = do { var duplicate = 3 }) => duplicate; - assertEquals(3, f()); - // TODO(verwaest): The {duplicate} declarations were invalidly merged. - assertEquals(3, duplicate); -} -hoist_duplicate_do_var(); diff --git a/implementation-contributed/v8/mjsunit/harmony/do-expressions-arrow-param-scope.js b/implementation-contributed/v8/mjsunit/harmony/do-expressions-arrow-param-scope.js deleted file mode 100644 index f5d5097995..0000000000 --- a/implementation-contributed/v8/mjsunit/harmony/do-expressions-arrow-param-scope.js +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright 2017 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: --harmony-do-expressions - -(function testBasic() { - let f = (x = eval("var z = 42; z"), y = do { 43 }) => x + y; - assertEquals(85, f()); -})(); - -(function testReturnParam() { - let f = (x = eval("var z = 42; z"), y = do { x }) => x + y; - assertEquals(84, f()); -})(); - -(function testCaptureParam() { - let f = (x = eval("var z = 42; z"), y = do { () => x }) => x + y(); - assertEquals(84, f()); -})(); - -(function testScoped() { - let f = (x = eval("var z = 42; z"), y = do { let z; x }) => x + y; - assertEquals(84, f()); -})(); - -(function testCaptureScoped() { - let f = (x = eval("var z = 42; z"), y = do { let z; () => x }) => x + y(); - assertEquals(84, f()); -})(); - -(function testCaptureOuter() { - let z = 44; - let f = (x = eval("var z = 42; z"), y = do { () => z }) => x + y(); - assertEquals(86, f()) -})(); - -(function testCaptureOuterScoped() { - let z = 44; - let f = (x = eval("var z = 42; z"), y = do { let q; () => z }) => x + y(); - assertEquals(86, f()) -})(); - -(function testWith() { - let f = (x = eval("var z = 42; z"), - y = do { - with ({foo: "bar"}) { - () => x } - }) => x + y(); - assertEquals(84, f()) -})(); - -(function testTry() { - let f = (x = eval("var z = 42; z"), - y = do { - try { () => x } - catch (e) { } - }) => x + y(); - assertEquals(84, f()) -})(); - -(function testCatch() { - let f = (x = eval("var z = 42; z"), - y = do { - try { throw 42 } - catch (e) { () => x } - }) => x + y(); - assertEquals(84, f()) -})(); - -(function testFinally() { - let z = 44; - let q; - let f = (x = eval("var z = 42; z"), - y = do { - try { } - catch (e) { } - finally { q = () => z } - q; - }) => x + y(); - assertEquals(86, f()) -})(); - -(function testFinallyThrow() { - let z = 44; - let q; - let f = (x = eval("var z = 42; z"), - y = do { - try { throw 42; } - catch (e) { } - finally { q = () => z } - q; - }) => x + y(); - assertEquals(86, f()) -})(); diff --git a/implementation-contributed/v8/mjsunit/harmony/do-expressions-control.js b/implementation-contributed/v8/mjsunit/harmony/do-expressions-control.js deleted file mode 100644 index 12c54295cc..0000000000 --- a/implementation-contributed/v8/mjsunit/harmony/do-expressions-control.js +++ /dev/null @@ -1,109 +0,0 @@ -// Copyright 2016 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 --harmony-do-expressions - -(function TestDoForInDoBreak() { - function f(o, i) { - var a = "result@" + do { - var r = "("; - for (var x in o) { - var b = "end@" + do { - if (x == i) { break } else { r += o[x]; x } - } - } - r + ")"; - } - return a + "," + b; - } - assertEquals("result@(3),end@0", f([3], 2)); - assertEquals("result@(35),end@1", f([3,5], 2)); - assertEquals("result@(35),end@1", f([3,5,7], 2)); - assertEquals("result@(35),end@1", f([3,5,7,9], 2)); - %OptimizeFunctionOnNextCall(f); - assertEquals("result@(3),end@0", f([3], 2)); - assertEquals("result@(35),end@1", f([3,5], 2)); - assertEquals("result@(35),end@1", f([3,5,7], 2)); - assertEquals("result@(35),end@1", f([3,5,7,9], 2)); -})(); - -(function TestDoForInDoContinue() { - function f(o, i) { - var a = "result@" + do { - var r = "(" - for (var x in o) { - var b = "end@" + do { - if (x == i) { continue } else { r += o[x]; x } - } - } - r + ")" - } - return a + "," + b - } - assertEquals("result@(3),end@0", f([3], 2)); - assertEquals("result@(35),end@1", f([3,5], 2)); - assertEquals("result@(35),end@1", f([3,5,7], 2)); - assertEquals("result@(359),end@3", f([3,5,7,9], 2)); - %OptimizeFunctionOnNextCall(f); - assertEquals("result@(3),end@0", f([3], 2)); - assertEquals("result@(35),end@1", f([3,5], 2)); - assertEquals("result@(35),end@1", f([3,5,7], 2)); - assertEquals("result@(359),end@3", f([3,5,7,9], 2)); -})(); - -(function TestDoForNestedWithTargetLabels() { - function f(mode) { - var loop = true; - var head = "<"; - var tail = ">"; - var middle = - "1" + do { loop1: for(; loop; head += "A") { - "2" + do { loop2: for(; loop; head += "B") { - "3" + do { loop3: for(; loop; head += "C") { - "4" + do { loop4: for(; loop; head += "D") { - "5" + do { loop5: for(; loop; head += "E") { - "6" + do { loop6: for(; loop; head += "F") { - loop = false; - switch (mode) { - case "b1": break loop1; - case "b2": break loop2; - case "b3": break loop3; - case "b4": break loop4; - case "b5": break loop5; - case "b6": break loop6; - case "c1": continue loop1; - case "c2": continue loop2; - case "c3": continue loop3; - case "c4": continue loop4; - case "c5": continue loop5; - case "c6": continue loop6; - default: "7"; - } - }} - }} - }} - }} - }} - }} - return head + middle + tail; - } - function test() { - assertEquals( "<1undefined>", f("b1")); - assertEquals( "", f("c1")); - assertEquals( "", f("b2")); - assertEquals( "", f("c2")); - assertEquals( "", f("b3")); - assertEquals( "", f("c3")); - assertEquals( "", f("b4")); - assertEquals( "", f("c4")); - assertEquals( "", f("b5")); - assertEquals( "", f("c5")); - assertEquals( "", f("b6")); - assertEquals("", f("c6")); - assertEquals("", f("xx")); - } - test(); - %OptimizeFunctionOnNextCall(f); - test(); -})(); diff --git a/implementation-contributed/v8/mjsunit/harmony/do-expressions.js b/implementation-contributed/v8/mjsunit/harmony/do-expressions.js deleted file mode 100644 index f66c71eb83..0000000000 --- a/implementation-contributed/v8/mjsunit/harmony/do-expressions.js +++ /dev/null @@ -1,305 +0,0 @@ -// Copyright 2015 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: --harmony-do-expressions --allow-natives-syntax --no-always-opt --opt - -function returnValue(v) { return v; } -function MyError() {} -var global = this; - -function TestBasic() { - // Looping and lexical declarations - assertEquals(512, returnValue(do { - let n = 2; - for (let i = 0; i < 4; i++) n <<= 2; - })); - - // Strings do the right thing - assertEquals("spooky halloween", returnValue(do { - "happy halloween".replace('happy', 'spooky'); - })); - - // Do expressions with no completion produce an undefined value - assertEquals(undefined, returnValue(do {})); - assertEquals(undefined, returnValue(do { var x = 99; })); - assertEquals(undefined, returnValue(do { function f() {}; })); - assertEquals(undefined, returnValue(do { let z = 33; })); - - // Propagation of exception - assertThrows(function() { - (do { - throw new MyError(); - "potatoes"; - }); - }, MyError); - - assertThrows(function() { - return do { - throw new MyError(); - "potatoes"; - }; - }, MyError); - - // Return value within do-block overrides `return |do-expression|` - assertEquals("inner-return", (function() { - return "outer-return" + do { - return "inner-return"; - ""; - }; - })()); - - var count = 0, n = 1; - // Breaking out |do-expression| - assertEquals(3, (function() { - for (var i = 0; i < 10; ++i) (count += 2 * do { if (i === 3) break; ++n }); - return i; - })()); - // (2 * 2) + (2 * 3) + (2 * 4) - assertEquals(18, count); - - // Continue in |do-expression| - count = 0, n = 1; - assertEquals([1, 3, 5, 7, 9], (function() { - var values = []; - for (var i = 0; i < 10; ++i) { - count += 2 * (do { - if ((i & 1) === 0) continue; - values.push(i); - ++n; - }) + 1; - } - // (2*2) + 1 + (2*3) + 1 + (2*4) + 1 + (2*5) + 1 + (2*6) + 1 - return values; - })()); - assertEquals(count, 45); - - assertThrows("(do { break; });", SyntaxError); - assertThrows("(do { continue; });", SyntaxError); - - // Real-world use case for desugaring - var array = [1, 2, 3, 4, 5], iterable = [6, 7, 8,9]; - assertEquals([1, 2, 3, 4, 5, 6, 7, 8, 9], do { - for (var element of iterable) array.push(element); - array; - }); - - // Nested do-expressions - assertEquals(125, do { (do { (do { 5 * 5 * 5 }) }) }); - - // Directives are not honoured - (do { - "use strict"; - foo = 80; - assertEquals(foo, 80); - }); - - // Non-empty operand stack testing - var O = { - method1() { - let x = 256; - return x + do { - for (var i = 0; i < 4; ++i) x += i; - } + 17; - }, - method2() { - let x = 256; - this.reset(); - return x + do { - for (var i = 0; i < this.length(); ++i) x += this.index() * 2; - }; - }, - _index: 0, - index() { - return ++this._index; - }, - _length: 4, - length() { return this._length; }, - reset() { this._index = 0; } - }; - assertEquals(535, O["method" + do { 1 } + ""]()); - assertEquals(532, O["method" + do { ({ valueOf() { return "2"; } }); }]()); - assertEquals(532, O[ - do { let s = ""; for (let c of "method") s += c; } + "2"]()); -} -TestBasic(); - - -function TestDeoptimization1() { - function f(v) { - return 88 + do { - v.a * v.b + v.c; - }; - } - - var o1 = {}; - o1.a = 10; - o1.b = 5; - o1.c = 50; - - var o2 = {}; - o2.c = 100; - o2.a = 10; - o2.b = 10; - - assertEquals(188, f(o1)); - assertEquals(188, f(o1)); - %OptimizeFunctionOnNextCall(f); - assertEquals(188, f(o1)); - assertOptimized(f); - assertEquals(288, f(o2)); - assertUnoptimized(f); - assertEquals(288, f(o2)); -} -TestDeoptimization1(); - - -function TestInParameterInitializers() { - var first_name = "George"; - var last_name = "Jetson"; - function fn1(name = do { first_name + " " + last_name }) { - return name; - } - assertEquals("George Jetson", fn1()); - - var _items = [1, 2, 3, NaN, 4, 5]; - function fn2(items = do { - let items = []; - for (var el of _items) { - if (el !== el) { - items; - break; - } - items.push(el), items; - } - }) { - return items; - } - assertEquals([1, 2, 3], fn2()); - - function thrower() { throw new MyError(); } - function fn3(exception = do { try { thrower(); } catch (e) { e } }) { - return exception; - } - assertDoesNotThrow(fn3); - assertInstanceof(fn3(), MyError); - - function fn4(exception = do { throw new MyError() }) {} - function catcher(fn) { - try { - fn(); - assertUnreachable("fn() initializer should throw"); - } catch (e) { - assertInstanceof(e, MyError); - } - } - catcher(fn4); -} -TestInParameterInitializers(); - - -function TestWithEval() { - (function sloppy1() { - assertEquals(do { eval("var x = 5"), x }, 5); - assertEquals(x, 5); - })(); - - assertThrows(function strict1() { - "use strict"; - (do { eval("var x = 5"), x }, 5); - }, ReferenceError); - - assertThrows(function strict2() { - (do { eval("'use strict'; var x = 5"), x }, 5); - }, ReferenceError); -} -TestWithEval(); - - -function TestHoisting() { - (do { var a = 1; }); - assertEquals(a, 1); - assertEquals(global.a, undefined); - - (do { - for (let it of [1, 2, 3, 4, 5]) { - var b = it; - } - }); - assertEquals(b, 5); - assertEquals(global.b, undefined); - - { - let x = 1 - - // TODO(caitp): ensure VariableStatements in |do-expressions| in parameter - // initializers, are evaluated in the same VariableEnvironment as they would - // be for eval(). - // function f1(a = do { var x = 2 }, b = x) { return b } - // assertEquals(1, f1()) - - // function f2(a = x, b = do { var x = 2 }) { return a } - // assertEquals(1, f2()) - - function f3({a = do { var x = 2 }, b = x}) { return b } - assertEquals(2, f3({})) - - function f4({a = x, b = do { var x = 2 }}) { return b } - assertEquals(undefined, f4({})) - - function f5(a = do { var y = 0 }) {} - assertThrows(() => y, ReferenceError) - } - - // TODO(caitp): Always block-scope function declarations in |do| expressions - //(do { - // assertEquals(true, inner_func()); - // function inner_func() { return true; } - //}); - //assertThrows(function() { return innerFunc(); }, ReferenceError); -} -TestHoisting(); - - -// v8:4661 - -function tryFinallySimple() { (do { try {} finally {} }); } -tryFinallySimple(); -tryFinallySimple(); -tryFinallySimple(); -tryFinallySimple(); - -var finallyRanCount = 0; -function tryFinallyDoExpr() { - return (do { - try { - throw "BOO"; - } catch (e) { - "Caught: " + e + " (" + finallyRanCount + ")" - } finally { - ++finallyRanCount; - } - }); -} -assertEquals("Caught: BOO (0)", tryFinallyDoExpr()); -assertEquals(1, finallyRanCount); -assertEquals("Caught: BOO (1)", tryFinallyDoExpr()); -assertEquals(2, finallyRanCount); -assertEquals("Caught: BOO (2)", tryFinallyDoExpr()); -assertEquals(3, finallyRanCount); -assertEquals("Caught: BOO (3)", tryFinallyDoExpr()); -assertEquals(4, finallyRanCount); - - -function TestOSR() { - var numbers = do { - let nums = []; - for (let i = 0; i < 1000; ++i) { - let value = (Math.random() * 100) | 0; - nums.push(value === 0 ? 1 : value), nums; - } - }; - assertEquals(numbers.length, 1000); -} - -for (var i = 0; i < 64; ++i) TestOSR(); diff --git a/implementation-contributed/v8/mjsunit/harmony/generators.js b/implementation-contributed/v8/mjsunit/harmony/generators.js index a4fc1c4aa4..b98164c135 100644 --- a/implementation-contributed/v8/mjsunit/harmony/generators.js +++ b/implementation-contributed/v8/mjsunit/harmony/generators.js @@ -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-do-expressions --allow-natives-syntax +// Flags: --allow-natives-syntax function MaybeOptimizeOrDeoptimize(f) { @@ -428,14 +428,6 @@ function Throw(generator, ...args) { assertEquals({value: 4, done: false}, Next(g)); } -{ - function* foo() { yield 2; (do {yield 3}) + 42; yield 4 } - g = foo(); - assertEquals({value: 2, done: false}, Next(g)); - assertEquals({value: 3, done: false}, Next(g)); - assertEquals({value: 4, done: false}, Next(g)); -} - { function* foo() { yield 2; return (yield 3) + 42; yield 4 } g = foo(); diff --git a/implementation-contributed/v8/mjsunit/harmony/regress/regress-4658.js b/implementation-contributed/v8/mjsunit/harmony/regress/regress-4658.js deleted file mode 100644 index 35bea12adc..0000000000 --- a/implementation-contributed/v8/mjsunit/harmony/regress/regress-4658.js +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright 2015 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: --harmony-do-expressions - -(function testWithSimpleLoopVariable() { - var f = (x, y = (do { var s=0; for (var e of x) s += e; s; })) => y*(y+1); - var result = f([1,2,3]); // core dump here, if not fixed. - assertEquals(result, 42); -})(); - -(function testWithComplexLoopVariable() { - var f = (x, i=x[0]-1, a=[], - y = (do { var s=0; - for (a[i] of x) s += a[i++]; - s; - })) => y*(a[0]+a[1]*a[2]); - var result = f([1,2,3]); // core dump here, if not fixed. - assertEquals(result, 42); -})(); diff --git a/implementation-contributed/v8/mjsunit/harmony/regress/regress-4755.js b/implementation-contributed/v8/mjsunit/harmony/regress/regress-4755.js deleted file mode 100644 index 2a0df9dba4..0000000000 --- a/implementation-contributed/v8/mjsunit/harmony/regress/regress-4755.js +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright 2016 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 --harmony-do-expressions - -(function DoTryCatchInsideBinop() { - function f(a, b) { - return a + do { try { throw "boom" } catch(e) { b } } - } - assertEquals(3, f(1, 2)); - assertEquals(3, f(1, 2)); - %OptimizeFunctionOnNextCall(f); - assertEquals(3, f(1, 2)); -})(); - -(function DoTryCatchInsideCall() { - function f(a, b) { - return Math.max(a, do { try { throw a } catch(e) { e + b } }) - } - assertEquals(3, f(1, 2)); - assertEquals(3, f(1, 2)); - %OptimizeFunctionOnNextCall(f); - assertEquals(3, f(1, 2)); -})(); - -(function DoTryCatchInsideTry() { - function f(a, b) { - try { return do { try { throw a } catch(e) { e + b } } } catch(e) {} - } - assertEquals(3, f(1, 2)); - assertEquals(3, f(1, 2)); - %OptimizeFunctionOnNextCall(f); - assertEquals(3, f(1, 2)); -})(); - -(function DoTryCatchInsideFinally() { - function f(a, b) { - try {} finally { return do { try { throw a } catch(e) { e + b } } } - } - assertEquals(3, f(1, 2)); - assertEquals(3, f(1, 2)); - %OptimizeFunctionOnNextCall(f); - assertEquals(3, f(1, 2)); -})(); diff --git a/implementation-contributed/v8/mjsunit/harmony/regress/regress-4904.js b/implementation-contributed/v8/mjsunit/harmony/regress/regress-4904.js deleted file mode 100644 index a57d246b6f..0000000000 --- a/implementation-contributed/v8/mjsunit/harmony/regress/regress-4904.js +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright 2015 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: --harmony-do-expressions - -(function testCatchScopeInDoExpression() { - var f = (s = 17, y = do { try { throw 25; } catch(e) { s += e; }; }) => s; - var result = f(); - assertEquals(result, 42); -})(); - -(function testCatchScopeInDoExpression() { - var f = (s = 17, y = do { let t; try { throw 25; } catch(e) { s += e; }; }) => s; - var result = f(); - assertEquals(result, 42); -})(); - -(function testCatchScopeInDoExpression() { - let t1; - var f = (s = 17, y = do { let t2; try { throw 25; } catch(e) { s += e; }; }) => s; - var result = f(); - assertEquals(result, 42); -})(); diff --git a/implementation-contributed/v8/mjsunit/harmony/regress/regress-546967.js b/implementation-contributed/v8/mjsunit/harmony/regress/regress-546967.js deleted file mode 100644 index 0315c43634..0000000000 --- a/implementation-contributed/v8/mjsunit/harmony/regress/regress-546967.js +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2015 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: --harmony-do-expressions --allow-natives-syntax - -function func1() { - for (var i = 0; i < 64; ++i) func2(); -} - -%OptimizeFunctionOnNextCall(func1); -func1(); - -function func2() { - var v = do {}; -} diff --git a/implementation-contributed/v8/mjsunit/harmony/regress/regress-crbug-578038.js b/implementation-contributed/v8/mjsunit/harmony/regress/regress-crbug-578038.js deleted file mode 100644 index 42774b84ed..0000000000 --- a/implementation-contributed/v8/mjsunit/harmony/regress/regress-crbug-578038.js +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright 2015 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: --harmony-do-expressions - -(function testWithoutOtherLiteral() { - var result = ((x = [...[42]]) => x)(); - assertEquals(result, [42]); -})(); - -(function testWithSomeOtherLiteral() { - []; // important: an array literal before the arrow function - var result = ((x = [...[42]]) => x)(); // will core dump, if not fixed. - assertEquals(result, [42]); -})(); diff --git a/implementation-contributed/v8/mjsunit/regress/regress-813440.js b/implementation-contributed/v8/mjsunit/regress/regress-813440.js index d2aef2528b..8fcb695f5a 100644 --- a/implementation-contributed/v8/mjsunit/regress/regress-813440.js +++ b/implementation-contributed/v8/mjsunit/regress/regress-813440.js @@ -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: --invoke-weak-callbacks --omit-quit --wasm-async-compilation --expose-wasm --allow-natives-syntax +// Flags: --invoke-weak-callbacks --omit-quit --expose-wasm --allow-natives-syntax load("test/mjsunit/wasm/wasm-constants.js"); load("test/mjsunit/wasm/wasm-module-builder.js"); diff --git a/implementation-contributed/v8/mjsunit/regress/regress-896326.js b/implementation-contributed/v8/mjsunit/regress/regress-896326.js new file mode 100644 index 0000000000..88c2e56e2c --- /dev/null +++ b/implementation-contributed/v8/mjsunit/regress/regress-896326.js @@ -0,0 +1,11 @@ +// 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: --stack-size=100 + +function f() { +} + +var large_array = Array(150 * 1024); +assertThrows('new f(... large_array)', RangeError); diff --git a/implementation-contributed/v8/mjsunit/regress/regress-crbug-546968.js b/implementation-contributed/v8/mjsunit/regress/regress-crbug-546968.js deleted file mode 100644 index 51f20c4204..0000000000 --- a/implementation-contributed/v8/mjsunit/regress/regress-crbug-546968.js +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright 2015 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 --harmony-do-expressions - -function f() { - print( - do { - for (var i = 0; i < 10; i++) { if (i == 5) %OptimizeOsr(); } - } - ); -} -f(); diff --git a/implementation-contributed/v8/mjsunit/regress/regress-crbug-903043.js b/implementation-contributed/v8/mjsunit/regress/regress-crbug-903043.js new file mode 100644 index 0000000000..a877e6e12a --- /dev/null +++ b/implementation-contributed/v8/mjsunit/regress/regress-crbug-903043.js @@ -0,0 +1,39 @@ +// 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 + +(function() { + function foo() { + const x = 1e-1; + return Object.is(-0, x * (-1e-308)); + } + + assertFalse(foo()); + assertFalse(foo()); + %OptimizeFunctionOnNextCall(foo); + assertFalse(foo()); +})(); + +(function() { + function foo(x) { + return Object.is(-0, x * (-1e-308)); + } + + assertFalse(foo(1e-1)); + assertFalse(foo(1e-1)); + %OptimizeFunctionOnNextCall(foo); + assertFalse(foo(1e-1)); +})(); + +(function() { + function foo(x) { + return Object.is(-0, x); + } + + assertFalse(foo(1e-1 * (-1e-308))); + assertFalse(foo(1e-1 * (-1e-308))); + %OptimizeFunctionOnNextCall(foo); + assertFalse(foo(1e-1 * (-1e-308))); +})(); diff --git a/implementation-contributed/v8/mjsunit/regress/regress-osr-in-case-label.js b/implementation-contributed/v8/mjsunit/regress/regress-osr-in-case-label.js deleted file mode 100644 index 3ad9e33646..0000000000 --- a/implementation-contributed/v8/mjsunit/regress/regress-osr-in-case-label.js +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright 2015 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 --harmony-do-expressions - -function f(x) { - switch (x) { - case 1: return "one"; - case 2: return "two"; - case do { for (var i = 0; i < 10; i++) { if (i == 5) %OptimizeOsr(); } }: - case 3: return "WAT"; - } -} - -assertEquals("one", f(1)); -assertEquals("two", f(2)); -assertEquals("WAT", f(3)); diff --git a/implementation-contributed/v8/mjsunit/regress/regress-osr-in-literal.js b/implementation-contributed/v8/mjsunit/regress/regress-osr-in-literal.js deleted file mode 100644 index 7553b9c725..0000000000 --- a/implementation-contributed/v8/mjsunit/regress/regress-osr-in-literal.js +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright 2015 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 --harmony-do-expressions - -"use strict"; - -var p = {}; -var testCases = [ - { s:"[1, do { _OSR_ 2 }, 3]", r:[1, 2, 3] }, - { s:"[1, ...[2], do { _OSR_ 3 }, 4]", r:[1, 2, 3, 4] }, - { s:"[1, ...do { _OSR_ [2,3] }, 4]", r:[1, 2, 3, 4] }, - { s:"{ a:do { _OSR_ 1 } }", r:{ a:1 } }, - { s:"{ a:do { _OSR_ 2 }, __proto__:p }", r:{ a:2, __proto__:p } }, - { s:"{ a:do { _OSR_ 3 }, get b() { return 4; } }", r:{ a:3, b:4 } }, - { s:"{ [do { _OSR_ 'b' }]: 3 }", r:{ b:3 } }, - { s:"{ [do { _OSR_ 'b' }]: 3, c: 4 }", r:{ b:3, c:4 } }, - { s:"{ [do { _OSR_ 'b' }]: 3, __proto__:p }", r:{ b:3, __proto__:p } }, - { s:"{ get [do { _OSR_ 'c' }]() { return 4; } }", r:{ c:4 } }, - { s:"class { [do { _OSR_ 'f' }]() {} }" }, - { s:"class { [do { _OSR_ 'f' }]() {}; g() {} }" }, -]; - -for (var i = 0; i < testCases.length; ++i) { - var source = "(function f" + i + "(x) { return " + testCases[i].s + "})"; - var osr = "for (var i = 0; i < 10; i++) { if (i == 5) %OptimizeOsr(); }"; - var result = eval(source.replace("_OSR_", osr))(); - if (testCases[i].r) assertEquals(testCases[i].r, result); -} diff --git a/implementation-contributed/v8/mjsunit/regress/wasm/regress-734108.js b/implementation-contributed/v8/mjsunit/regress/wasm/regress-734108.js index d8774f4a84..74a1717b8d 100644 --- a/implementation-contributed/v8/mjsunit/regress/wasm/regress-734108.js +++ b/implementation-contributed/v8/mjsunit/regress/wasm/regress-734108.js @@ -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: --wasm-async-compilation - __v_0 = new Uint8Array([ 0x00, 0x61, 0x73, 0x6d, 0x01, 0x00, 0x00, 0x00, 0x01, 0x05, 0x01, 0x60, 0x00, 0x01, 0x7f, 0x03, 0x02, 0x01, 0x00, 0x05, 0x03, 0x01,