From a5d7cad1829fc1bdab2f913ed63312d7c425409b Mon Sep 17 00:00:00 2001 From: test262-automation <test262-automation@bocoup.com> Date: Thu, 25 Oct 2018 18:47:42 +0000 Subject: [PATCH] [v8-test262-automation] Changes from https://github.com/v8/v8.git at sha 5d90d70a on Thu Oct 25 2018 18:47:05 GMT+0000 (Coordinated Universal Time) --- .../intl/segmenter/segment-grapheme-next.js | 40 +++++++++++++++++++ .../segment-iterator-ownPropertyDescriptor.js | 16 ++++++++ .../v8/intl/segmenter/segment-line-next.js | 40 +++++++++++++++++++ .../intl/segmenter/segment-sentence-next.js | 40 +++++++++++++++++++ .../v8/intl/segmenter/segment-word-next.js | 40 +++++++++++++++++++ .../mjsunit/es6/array-spread-large-holey.js | 17 ++++++++ .../v8/mjsunit/mjsunit.status | 4 +- .../v8/mjsunit/regress/regress-897512.js | 24 +++++++++++ 8 files changed, 219 insertions(+), 2 deletions(-) create mode 100644 implementation-contributed/v8/intl/segmenter/segment-grapheme-next.js create mode 100644 implementation-contributed/v8/intl/segmenter/segment-line-next.js create mode 100644 implementation-contributed/v8/intl/segmenter/segment-sentence-next.js create mode 100644 implementation-contributed/v8/intl/segmenter/segment-word-next.js create mode 100644 implementation-contributed/v8/mjsunit/es6/array-spread-large-holey.js create mode 100644 implementation-contributed/v8/mjsunit/regress/regress-897512.js diff --git a/implementation-contributed/v8/intl/segmenter/segment-grapheme-next.js b/implementation-contributed/v8/intl/segmenter/segment-grapheme-next.js new file mode 100644 index 0000000000..41e812e692 --- /dev/null +++ b/implementation-contributed/v8/intl/segmenter/segment-grapheme-next.js @@ -0,0 +1,40 @@ +// 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: --harmony-intl-segmenter + +const seg = new Intl.Segmenter([], {granularity: "grapheme"}) +for (const text of [ + "Hello world!", // English + " Hello world! ", // English with space before/after + " Hello world? Foo bar!", // English + "Jedovatou mambu objevila žena v zahrádkářské kolonii.", // Czech + "Việt Nam: Nhất thể hóa sẽ khác Trung Quốc?", // Vietnamese + "ΣοβαÏÎÏ‚ ενστάσεις Κομισιόν για τον Ï€Ïοϋπολογισμό της Ιταλίας", // Greek + "Решение Индии о покупке роÑÑийÑких С-400 раÑценили как вызов СШÐ", // Russian + "×”×¨×•×¤× ×©×”×¦×™×œ × ×©×™× ×•×”× ×¢×¨×” ששועבדה ×¢", // Hebrew, + "ترامب للملك سلمان: أنا جاد للغاية.. عليك دÙع المزيد", // Arabic + "à¤à¤¾à¤°à¤¤ की à¤à¤¸ 400 मिसाइल के मà¥à¤•à¤¾à¤¬à¤²à¥‡ पाक की थाड, जानें कौन कितना ताकतवर", // Hindi + "ரெட௠அலரà¯à®Ÿà¯ எசà¯à®šà®°à®¿à®•à¯à®•à¯ˆ; பà¯à®¤à¯à®šà¯à®šà¯‡à®°à®¿à®¯à®¿à®²à¯ நாளை அரச௠விடà¯à®®à¯à®±à¯ˆ!", // Tamil + "'ఉతà±à°¤à°°à±à°µà±à°²à± అందే వరకౠఓటరà±à°² à°¤à±à°¦à°¿ జాబితానౠవెబà±â€Œà°¸à±ˆà°Ÿà±à°²à±‹ పెటà±à°Ÿà°µà°¦à±à°¦à±'", // Telugu + "å°åŒ—》抹黑柯P失敗?朱å¸æ’酸:姚文智氣pupu嗆大è€é—†", // Chinese + "วัดไทรตีระฆังเบาลงช่วงเข้าพรรษา เจ้าà¸à¸²à¸§à¸²à¸ªà¹€à¸œà¸¢à¸„นร้à¸à¸‡à¹€à¸£à¸µà¸¢à¸™à¸£à¸±à¸šà¸œà¸¥à¸à¸£à¸£à¸¡à¹à¸¥à¹‰à¸§", // Thai + "ä¹å·žåŒ—部ã®ä¸€éƒ¨ãŒæš´é¢¨åŸŸã«å…¥ã‚Šã¾ã—ãŸ(æ—¥ç›´äºˆå ±å£« 2018å¹´10月06æ—¥) - 日本気象å”会 tenki.jp", // Japanese + "ë²•ì› â€œë‹¤ìŠ¤ 지분 처분권·수ìµê¶Œ ëª¨ë‘ MBê°€ ë³´ìœ â€", // Korean + ]) { + const iter = seg.segment(text); + let segments = []; + let oldPos = -1; + for (let result = iter.next(); !result.done; result = iter.next()) { + const v = result.value; + assertEquals(undefined, v.breakType); + assertEquals("string", typeof v.segment); + assertTrue(v.segment.length > 0); + segments.push(v.segment); + assertEquals("number", typeof v.position); + assertTrue(oldPos < v.position); + oldPos = v.position; + } + assertEquals(text, segments.join('')); +} diff --git a/implementation-contributed/v8/intl/segmenter/segment-iterator-ownPropertyDescriptor.js b/implementation-contributed/v8/intl/segmenter/segment-iterator-ownPropertyDescriptor.js index 7409382a99..e706a0afb7 100644 --- a/implementation-contributed/v8/intl/segmenter/segment-iterator-ownPropertyDescriptor.js +++ b/implementation-contributed/v8/intl/segmenter/segment-iterator-ownPropertyDescriptor.js @@ -73,3 +73,19 @@ for (let rec of otherReceivers) { assertThrows(() => prototype.following.call(rec), TypeError); assertThrows(() => prototype.preceding.call(rec), TypeError); } + +// Check the property of the return object of next() +let nextReturn = segmentIterator.next(); + +function checkProperty(obj, property) { + let desc = Object.getOwnPropertyDescriptor(obj, property); + assertTrue(desc.writable); + assertTrue(desc.enumerable); + assertTrue(desc.configurable); +} + +checkProperty(nextReturn, 'done'); +checkProperty(nextReturn, 'value'); +checkProperty(nextReturn.value, 'segment'); +checkProperty(nextReturn.value, 'breakType'); +checkProperty(nextReturn.value, 'position'); diff --git a/implementation-contributed/v8/intl/segmenter/segment-line-next.js b/implementation-contributed/v8/intl/segmenter/segment-line-next.js new file mode 100644 index 0000000000..a4c76acfd1 --- /dev/null +++ b/implementation-contributed/v8/intl/segmenter/segment-line-next.js @@ -0,0 +1,40 @@ +// 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: --harmony-intl-segmenter + +const seg = new Intl.Segmenter([], {granularity: "line"}) +for (const text of [ + "Hello world!", // English + " Hello world! ", // English with space before/after + " Hello world? Foo bar!", // English + "Jedovatou mambu objevila žena v zahrádkářské kolonii.", // Czech + "Việt Nam: Nhất thể hóa sẽ khác Trung Quốc?", // Vietnamese + "ΣοβαÏÎÏ‚ ενστάσεις Κομισιόν για τον Ï€Ïοϋπολογισμό της Ιταλίας", // Greek + "Решение Индии о покупке роÑÑийÑких С-400 раÑценили как вызов СШÐ", // Russian + "×”×¨×•×¤× ×©×”×¦×™×œ × ×©×™× ×•×”× ×¢×¨×” ששועבדה ×¢", // Hebrew, + "ترامب للملك سلمان: أنا جاد للغاية.. عليك دÙع المزيد", // Arabic + "à¤à¤¾à¤°à¤¤ की à¤à¤¸ 400 मिसाइल के मà¥à¤•à¤¾à¤¬à¤²à¥‡ पाक की थाड, जानें कौन कितना ताकतवर", // Hindi + "ரெட௠அலரà¯à®Ÿà¯ எசà¯à®šà®°à®¿à®•à¯à®•à¯ˆ; பà¯à®¤à¯à®šà¯à®šà¯‡à®°à®¿à®¯à®¿à®²à¯ நாளை அரச௠விடà¯à®®à¯à®±à¯ˆ!", // Tamil + "'ఉతà±à°¤à°°à±à°µà±à°²à± అందే వరకౠఓటరà±à°² à°¤à±à°¦à°¿ జాబితానౠవెబà±â€Œà°¸à±ˆà°Ÿà±à°²à±‹ పెటà±à°Ÿà°µà°¦à±à°¦à±'", // Telugu + "å°åŒ—》抹黑柯P失敗?朱å¸æ’酸:姚文智氣pupu嗆大è€é—†", // Chinese + "วัดไทรตีระฆังเบาลงช่วงเข้าพรรษา เจ้าà¸à¸²à¸§à¸²à¸ªà¹€à¸œà¸¢à¸„นร้à¸à¸‡à¹€à¸£à¸µà¸¢à¸™à¸£à¸±à¸šà¸œà¸¥à¸à¸£à¸£à¸¡à¹à¸¥à¹‰à¸§", // Thai + "ä¹å·žåŒ—部ã®ä¸€éƒ¨ãŒæš´é¢¨åŸŸã«å…¥ã‚Šã¾ã—ãŸ(æ—¥ç›´äºˆå ±å£« 2018å¹´10月06æ—¥) - 日本気象å”会 tenki.jp", // Japanese + "ë²•ì› â€œë‹¤ìŠ¤ 지분 처분권·수ìµê¶Œ ëª¨ë‘ MBê°€ ë³´ìœ â€", // Korean + ]) { + const iter = seg.segment(text); + let segments = []; + let oldPos = -1; + for (let result = iter.next(); !result.done; result = iter.next()) { + const v = result.value; + assertTrue(["soft", "hard"].includes(iter.breakType), iter.breakType); + assertEquals("string", typeof v.segment); + assertTrue(v.segment.length > 0); + segments.push(v.segment); + assertEquals("number", typeof v.position); + assertTrue(oldPos < v.position); + oldPos = v.position; + } + assertEquals(text, segments.join('')); +} diff --git a/implementation-contributed/v8/intl/segmenter/segment-sentence-next.js b/implementation-contributed/v8/intl/segmenter/segment-sentence-next.js new file mode 100644 index 0000000000..8a76781e58 --- /dev/null +++ b/implementation-contributed/v8/intl/segmenter/segment-sentence-next.js @@ -0,0 +1,40 @@ +// 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: --harmony-intl-segmenter + +const seg = new Intl.Segmenter([], {granularity: "sentence"}) +for (const text of [ + "Hello world!", // English + " Hello world! ", // English with space before/after + " Hello world? Foo bar!", // English + "Jedovatou mambu objevila žena v zahrádkářské kolonii.", // Czech + "Việt Nam: Nhất thể hóa sẽ khác Trung Quốc?", // Vietnamese + "ΣοβαÏÎÏ‚ ενστάσεις Κομισιόν για τον Ï€Ïοϋπολογισμό της Ιταλίας", // Greek + "Решение Индии о покупке роÑÑийÑких С-400 раÑценили как вызов СШÐ", // Russian + "×”×¨×•×¤× ×©×”×¦×™×œ × ×©×™× ×•×”× ×¢×¨×” ששועבדה ×¢", // Hebrew, + "ترامب للملك سلمان: أنا جاد للغاية.. عليك دÙع المزيد", // Arabic + "à¤à¤¾à¤°à¤¤ की à¤à¤¸ 400 मिसाइल के मà¥à¤•à¤¾à¤¬à¤²à¥‡ पाक की थाड, जानें कौन कितना ताकतवर", // Hindi + "ரெட௠அலரà¯à®Ÿà¯ எசà¯à®šà®°à®¿à®•à¯à®•à¯ˆ; பà¯à®¤à¯à®šà¯à®šà¯‡à®°à®¿à®¯à®¿à®²à¯ நாளை அரச௠விடà¯à®®à¯à®±à¯ˆ!", // Tamil + "'ఉతà±à°¤à°°à±à°µà±à°²à± అందే వరకౠఓటరà±à°² à°¤à±à°¦à°¿ జాబితానౠవెబà±â€Œà°¸à±ˆà°Ÿà±à°²à±‹ పెటà±à°Ÿà°µà°¦à±à°¦à±'", // Telugu + "å°åŒ—》抹黑柯P失敗?朱å¸æ’酸:姚文智氣pupu嗆大è€é—†", // Chinese + "วัดไทรตีระฆังเบาลงช่วงเข้าพรรษา เจ้าà¸à¸²à¸§à¸²à¸ªà¹€à¸œà¸¢à¸„นร้à¸à¸‡à¹€à¸£à¸µà¸¢à¸™à¸£à¸±à¸šà¸œà¸¥à¸à¸£à¸£à¸¡à¹à¸¥à¹‰à¸§", // Thai + "ä¹å·žåŒ—部ã®ä¸€éƒ¨ãŒæš´é¢¨åŸŸã«å…¥ã‚Šã¾ã—ãŸ(æ—¥ç›´äºˆå ±å£« 2018å¹´10月06æ—¥) - 日本気象å”会 tenki.jp", // Japanese + "ë²•ì› â€œë‹¤ìŠ¤ 지분 처분권·수ìµê¶Œ ëª¨ë‘ MBê°€ ë³´ìœ â€", // Korean + ]) { + const iter = seg.segment(text); + let segments = []; + let oldPos = -1; + for (let result = iter.next(); !result.done; result = iter.next()) { + const v = result.value; + assertTrue(["sep", "term"].includes(iter.breakType), iter.breakType); + assertEquals("string", typeof v.segment); + assertTrue(v.segment.length > 0); + segments.push(v.segment); + assertEquals("number", typeof v.position); + assertTrue(oldPos < v.position); + oldPos = v.position; + } + assertEquals(text, segments.join('')); +} diff --git a/implementation-contributed/v8/intl/segmenter/segment-word-next.js b/implementation-contributed/v8/intl/segmenter/segment-word-next.js new file mode 100644 index 0000000000..53b73793df --- /dev/null +++ b/implementation-contributed/v8/intl/segmenter/segment-word-next.js @@ -0,0 +1,40 @@ +// 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: --harmony-intl-segmenter + +const seg = new Intl.Segmenter([], {granularity: "word"}) +for (const text of [ + "Hello world!", // English + " Hello world! ", // English with space before/after + " Hello world? Foo bar!", // English + "Jedovatou mambu objevila žena v zahrádkářské kolonii.", // Czech + "Việt Nam: Nhất thể hóa sẽ khác Trung Quốc?", // Vietnamese + "ΣοβαÏÎÏ‚ ενστάσεις Κομισιόν για τον Ï€Ïοϋπολογισμό της Ιταλίας", // Greek + "Решение Индии о покупке роÑÑийÑких С-400 раÑценили как вызов СШÐ", // Russian + "×”×¨×•×¤× ×©×”×¦×™×œ × ×©×™× ×•×”× ×¢×¨×” ששועבדה ×¢", // Hebrew, + "ترامب للملك سلمان: أنا جاد للغاية.. عليك دÙع المزيد", // Arabic + "à¤à¤¾à¤°à¤¤ की à¤à¤¸ 400 मिसाइल के मà¥à¤•à¤¾à¤¬à¤²à¥‡ पाक की थाड, जानें कौन कितना ताकतवर", // Hindi + "ரெட௠அலரà¯à®Ÿà¯ எசà¯à®šà®°à®¿à®•à¯à®•à¯ˆ; பà¯à®¤à¯à®šà¯à®šà¯‡à®°à®¿à®¯à®¿à®²à¯ நாளை அரச௠விடà¯à®®à¯à®±à¯ˆ!", // Tamil + "'ఉతà±à°¤à°°à±à°µà±à°²à± అందే వరకౠఓటరà±à°² à°¤à±à°¦à°¿ జాబితానౠవెబà±â€Œà°¸à±ˆà°Ÿà±à°²à±‹ పెటà±à°Ÿà°µà°¦à±à°¦à±'", // Telugu + "å°åŒ—》抹黑柯P失敗?朱å¸æ’酸:姚文智氣pupu嗆大è€é—†", // Chinese + "วัดไทรตีระฆังเบาลงช่วงเข้าพรรษา เจ้าà¸à¸²à¸§à¸²à¸ªà¹€à¸œà¸¢à¸„นร้à¸à¸‡à¹€à¸£à¸µà¸¢à¸™à¸£à¸±à¸šà¸œà¸¥à¸à¸£à¸£à¸¡à¹à¸¥à¹‰à¸§", // Thai + "ä¹å·žåŒ—部ã®ä¸€éƒ¨ãŒæš´é¢¨åŸŸã«å…¥ã‚Šã¾ã—ãŸ(æ—¥ç›´äºˆå ±å£« 2018å¹´10月06æ—¥) - 日本気象å”会 tenki.jp", // Japanese + "ë²•ì› â€œë‹¤ìŠ¤ 지분 처분권·수ìµê¶Œ ëª¨ë‘ MBê°€ ë³´ìœ â€", // Korean + ]) { + const iter = seg.segment(text); + let segments = []; + let oldPos = -1; + for (let result = iter.next(); !result.done; result = iter.next()) { + const v = result.value; + assertTrue(["word", "none"].includes(iter.breakType), iter.breakType); + assertEquals("string", typeof v.segment); + assertTrue(v.segment.length > 0); + segments.push(v.segment); + assertEquals("number", typeof v.position); + assertTrue(oldPos < v.position); + oldPos = v.position; + } + assertEquals(text, segments.join('')); +} diff --git a/implementation-contributed/v8/mjsunit/es6/array-spread-large-holey.js b/implementation-contributed/v8/mjsunit/es6/array-spread-large-holey.js new file mode 100644 index 0000000000..c319c187df --- /dev/null +++ b/implementation-contributed/v8/mjsunit/es6/array-spread-large-holey.js @@ -0,0 +1,17 @@ +// 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. + +// Test spreading of large holey arrays, which are supposedly allocated in +// LargeObjectSpace. Holes should be replaced with undefined. + +var arr = new Array(2e5); + +for (var i = 0; i < 10; i++) { + arr[i] = i; +} + +var arr2 = [...arr]; +assertTrue(arr2.hasOwnProperty(10)); +assertEquals(undefined, arr2[10]); +assertEquals(9, arr2[9]); diff --git a/implementation-contributed/v8/mjsunit/mjsunit.status b/implementation-contributed/v8/mjsunit/mjsunit.status index 4c961b1480..955622c05e 100644 --- a/implementation-contributed/v8/mjsunit/mjsunit.status +++ b/implementation-contributed/v8/mjsunit/mjsunit.status @@ -176,8 +176,8 @@ 'wasm/embenchen/*': [PASS, SLOW], 'wasm/grow-memory': [PASS, SLOW], 'wasm/unreachable-validation': [PASS, SLOW], - 'wasm/atomics-stress': [PASS, SLOW, NO_VARIANTS, ['mode != release', SKIP], ['(arch == arm or arch == arm64) and simulator_run', SKIP]], - 'wasm/atomics64-stress': [PASS, SLOW, NO_VARIANTS, ['mode != release', SKIP], ['(arch == arm or arch == arm64) and simulator_run', SKIP]], + 'wasm/atomics-stress': [PASS, SLOW, NO_VARIANTS, ['mode != release or dcheck_always_on', SKIP], ['(arch == arm or arch == arm64) and simulator_run', SKIP], ['tsan', SKIP]], + 'wasm/atomics64-stress': [PASS, SLOW, NO_VARIANTS, ['mode != release or dcheck_always_on', SKIP], ['(arch == arm or arch == arm64) and simulator_run', SKIP], ['tsan', SKIP]], 'wasm/compare-exchange-stress': [PASS, SLOW, NO_VARIANTS], 'wasm/compare-exchange64-stress': [PASS, SLOW, NO_VARIANTS], diff --git a/implementation-contributed/v8/mjsunit/regress/regress-897512.js b/implementation-contributed/v8/mjsunit/regress/regress-897512.js new file mode 100644 index 0000000000..0e676a06c2 --- /dev/null +++ b/implementation-contributed/v8/mjsunit/regress/regress-897512.js @@ -0,0 +1,24 @@ +// 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. + +// Fill up the Array prototype's elements. +for (let i = 0; i < 100; i++) Array.prototype.unshift(3.14); + +// Create a holey double elements array. +const o31 = [1.1]; +o31[37] = 2.2; + +// Concat converts to dictionary elements. +const o51 = o31.concat(false); + +// Set one element to undefined to trigger the movement bug. +o51[0] = undefined; + +assertEquals(o51.length, 39); + +// Sort triggers the bug. +o51.sort(); + +// TODO(chromium:897512): The length should be 39. +assertEquals(o51.length, 101); -- GitLab