diff options
author | Myles Borins <mylesborins@google.com> | 2017-08-01 11:36:44 -0500 |
---|---|---|
committer | Myles Borins <mylesborins@google.com> | 2017-08-01 15:23:15 -0500 |
commit | 0a66b223e149a841669bfad5598e4254589730cb (patch) | |
tree | 5ec050f7f78aafbf5b1e0e50d639fb843141e162 /deps/v8/test/mjsunit | |
parent | 1782b3836ba58ef0da6b687f2bb970c0bd8199ad (diff) | |
download | node-new-0a66b223e149a841669bfad5598e4254589730cb.tar.gz |
deps: update V8 to 6.0.286.52
PR-URL: https://github.com/nodejs/node/pull/14004
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Diffstat (limited to 'deps/v8/test/mjsunit')
258 files changed, 5264 insertions, 517 deletions
diff --git a/deps/v8/test/mjsunit/allocation-site-info.js b/deps/v8/test/mjsunit/allocation-site-info.js index ba4ae17cf0..c7184af6f2 100644 --- a/deps/v8/test/mjsunit/allocation-site-info.js +++ b/deps/v8/test/mjsunit/allocation-site-info.js @@ -26,7 +26,7 @@ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // Flags: --allow-natives-syntax --expose-gc -// Flags: --crankshaft --no-always-opt +// Flags: --opt --no-always-opt var elements_kind = { fast_smi_only : 'fast smi only elements', @@ -136,7 +136,7 @@ assertKind(elements_kind.fast, obj); obj = fastliteralcase(get_standard_literal(), 3); assertKind(elements_kind.fast, obj); -// Make sure this works in crankshafted code too. +// Make sure this works in optimized code too. %OptimizeFunctionOnNextCall(get_standard_literal); get_standard_literal(); obj = get_standard_literal(); @@ -347,7 +347,7 @@ instanceof_check(realmBArray); assertOptimized(instanceof_check); // Try to optimize again, but first clear all type feedback, and allow it -// to be monomorphic on first call. Only after crankshafting do we introduce +// to be monomorphic on first call. Only after optimizing do we introduce // realmBArray. This should deopt the method. %DeoptimizeFunction(instanceof_check); %ClearFunctionFeedback(instanceof_check); @@ -360,6 +360,12 @@ assertOptimized(instanceof_check); instanceof_check(realmBArray); assertUnoptimized(instanceof_check); +// Perform a gc because without it the test below can experience an +// allocation failure at an inconvenient point. Allocation mementos get +// cleared on gc, and they can't deliver elements kind feedback when that +// happens. +gc(); + // Case: make sure nested arrays benefit from allocation site feedback as // well. (function() { diff --git a/deps/v8/test/mjsunit/arguments.js b/deps/v8/test/mjsunit/arguments.js index 97ec7cca6d..8c6186e1b9 100644 --- a/deps/v8/test/mjsunit/arguments.js +++ b/deps/v8/test/mjsunit/arguments.js @@ -248,26 +248,107 @@ assertEquals(117, arg_set(0xFFFFFFFF)); return arguments }; var args = f(1, 2); + %HeapObjectVerify(args); assertEquals(1, args[0]); assertEquals(2, args[1]); assertEquals(key, args[key]); assertEquals(2, args.length); delete args[0]; + %HeapObjectVerify(args); assertEquals(undefined, args[0]); assertEquals(2, args[1]); assertEquals(key, args[key]); assertEquals(2, args.length); delete args[1]; + %HeapObjectVerify(args); assertEquals(undefined, args[0]); assertEquals(undefined, args[1]); assertEquals(key, args[key]); assertEquals(2, args.length); delete args[key]; + %HeapObjectVerify(args); assertEquals(undefined, args[0]); assertEquals(undefined, args[1]); assertEquals(undefined, args[key]); assertEquals(2, args.length); })(); + +(function testDeleteSlowSloppyArguments2() { + function f(a) { + return arguments + }; + var args = f(1, 2); + %HeapObjectVerify(args); + assertEquals(1, args[0]); + assertEquals(2, args[1]); + assertEquals(2, args.length); + + delete args[1]; + %HeapObjectVerify(args); + assertEquals(1, args[0]); + assertEquals(undefined, args[1]); + assertEquals(undefined, args[2]); + assertEquals(2, args.length); + + delete args[0]; + %HeapObjectVerify(args); + assertEquals(undefined, args[0]); + assertEquals(undefined, args[1]); + assertEquals(undefined, args[2]); + assertEquals(2, args.length); +})(); + +(function testSloppyArgumentProperties() { + function f(a, b) { return arguments } + let args = f(1, 2, 3, 4); + %HeapObjectVerify(args); + assertEquals(4, args.length); + args.foo = "foo"; + %HeapObjectVerify(args); + assertEquals("foo", args.foo); + assertEquals(4, args.length); + + delete args.foo; + %HeapObjectVerify(args); + assertEquals(undefined, args.foo); + assertEquals(4, args.length); +})(); + + +(function testSloppyArgumentsLengthMapChange() { + function f(a) { return arguments }; + let args1 = f(1); + let args2 = f(1,2); + assertTrue(%HaveSameMap(args1, args2)); + args2.length = 12; + assertTrue(%HaveSameMap(args1, args2)); + args2.length = "aa" + assertTrue(%HaveSameMap(args1, args2)); + + let args3 = f(1); + let args4 = f(1,2); + // Creating holes causes map transitions. + assertTrue(%HaveSameMap(args1, args3)); + assertTrue(%HaveSameMap(args1, args4)); + delete args3[0]; + assertFalse(%HaveSameMap(args1, args3)); + delete args4[1]; + assertFalse(%HaveSameMap(args1, args4)); +})(); + +(function testSloppyArgumentsLengthMapChange() { + function f(a) { return arguments }; + let args1 = f(1); + let args2 = f(1,2); + assertTrue(%HaveSameMap(args1, args2)); + // Changing the length type doesn't causes a map transition. + args2.length = 12; + assertTrue(%HaveSameMap(args1, args2)); + args2.length = 12.0; + assertTrue(%HaveSameMap(args1, args2)); + args2.length = "aa" + assertTrue(%HaveSameMap(args1, args2)); +})(); diff --git a/deps/v8/test/mjsunit/array-constructor-feedback.js b/deps/v8/test/mjsunit/array-constructor-feedback.js index 45ea0d53e1..d5715f6d2d 100644 --- a/deps/v8/test/mjsunit/array-constructor-feedback.js +++ b/deps/v8/test/mjsunit/array-constructor-feedback.js @@ -26,7 +26,7 @@ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // Flags: --allow-natives-syntax --expose-gc -// Flags: --no-always-opt --crankshaft +// Flags: --no-always-opt --opt // Test element kind of objects. @@ -119,10 +119,13 @@ function assertKind(expected, obj, name_opt) { return new Array(one, two, three); } - barn(1, 2, 3); - barn(1, 2, 3); + a = barn(1, 2, 3); + a[1] = "a string"; + a = barn(1, 2, 3); + assertKind(elements_kind.fast, a); %OptimizeFunctionOnNextCall(barn); - barn(1, 2, 3); + a = barn(1, 2, 3); + assertKind(elements_kind.fast, a); assertOptimized(barn); a = barn(1, "oops", 3); assertOptimized(barn); diff --git a/deps/v8/test/mjsunit/array-feedback.js b/deps/v8/test/mjsunit/array-feedback.js index c585920df1..01856c57d0 100644 --- a/deps/v8/test/mjsunit/array-feedback.js +++ b/deps/v8/test/mjsunit/array-feedback.js @@ -26,7 +26,7 @@ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // Flags: --allow-natives-syntax --expose-gc -// Flags: --crankshaft --no-always-opt +// Flags: --opt --no-always-opt var elements_kind = { fast_smi_only : 'fast smi only elements', diff --git a/deps/v8/test/mjsunit/array-literal-feedback.js b/deps/v8/test/mjsunit/array-literal-feedback.js index d27f089c22..f3e39ddf4e 100644 --- a/deps/v8/test/mjsunit/array-literal-feedback.js +++ b/deps/v8/test/mjsunit/array-literal-feedback.js @@ -26,7 +26,7 @@ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // Flags: --allow-natives-syntax --expose-gc -// Flags: --crankshaft --no-always-opt +// Flags: --opt --no-always-opt var elements_kind = { fast_smi_only : 'fast smi only elements', diff --git a/deps/v8/test/mjsunit/array-literal-transitions.js b/deps/v8/test/mjsunit/array-literal-transitions.js index ce46cb7a7c..2db6fd35c5 100644 --- a/deps/v8/test/mjsunit/array-literal-transitions.js +++ b/deps/v8/test/mjsunit/array-literal-transitions.js @@ -26,7 +26,7 @@ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // Flags: --allow-natives-syntax --expose-gc --ignition-osr --no-always-opt -// Flags: --crankshaft +// Flags: --opt // IC and Crankshaft support for smi-only elements in dynamic array literals. function get(foo) { return foo; } // Used to generate dynamic values. diff --git a/deps/v8/test/mjsunit/array-push5.js b/deps/v8/test/mjsunit/array-push5.js index 4d75dc8b7c..9961ff98c3 100644 --- a/deps/v8/test/mjsunit/array-push5.js +++ b/deps/v8/test/mjsunit/array-push5.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 --crankshaft --no-always-opt +// Flags: --allow-natives-syntax --opt --no-always-opt var v = 0; diff --git a/deps/v8/test/mjsunit/array-shift4.js b/deps/v8/test/mjsunit/array-shift4.js index aa0c546233..5d28fd306a 100644 --- a/deps/v8/test/mjsunit/array-shift4.js +++ b/deps/v8/test/mjsunit/array-shift4.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 --crankshaft +// Flags: --allow-natives-syntax --opt // Inlining shift with holey smi arrays shouldn't deopt just because it // encounters the hole on the copy step. diff --git a/deps/v8/test/mjsunit/array-slice.js b/deps/v8/test/mjsunit/array-slice.js index b017dd506a..1fe1418459 100644 --- a/deps/v8/test/mjsunit/array-slice.js +++ b/deps/v8/test/mjsunit/array-slice.js @@ -25,7 +25,10 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Flags: --allow-natives-syntax + // Check that slicing array of holes keeps it as array of holes + (function() { var array = new Array(10); for (var i = 0; i < 7; i++) { @@ -222,7 +225,10 @@ // Check slicing on arguments object. (function() { function func(expected, a0, a1, a2) { - assertEquals(expected, Array.prototype.slice.call(arguments, 1)); + let result = Array.prototype.slice.call(arguments, 1); + %HeapObjectVerify(result); + %HeapObjectVerify(arguments); + assertEquals(expected, result); } func([]); @@ -240,7 +246,10 @@ assertEquals(undefined, y); y = 239; assertEquals(1, arguments.length); // arguments length is the same. - assertEquals([x], Array.prototype.slice.call(arguments, 0)); + let result = Array.prototype.slice.call(arguments, 0); + %HeapObjectVerify(result); + %HeapObjectVerify(arguments); + assertEquals([x], result); } func('a'); @@ -251,7 +260,10 @@ function func(x, y) { assertEquals(1, arguments.length); arguments.length = 7; - assertEquals([x,,,,,,,], Array.prototype.slice.call(arguments, 0)); + let result = Array.prototype.slice.call(arguments, 0); + assertEquals([x,,,,,,,], result); + %HeapObjectVerify(result); + %HeapObjectVerify(arguments); } func('a'); @@ -263,7 +275,10 @@ function func(x, y) { assertEquals(1, arguments.length); arguments.length = 'foobar'; - assertEquals([], Array.prototype.slice.call(arguments, 0)); + let result = Array.prototype.slice.call(arguments, 0); + assertEquals([], result); + %HeapObjectVerify(result); + %HeapObjectVerify(arguments); } func('a'); @@ -275,7 +290,10 @@ function func(x, y) { assertEquals(1, arguments.length); arguments[3] = 239; - assertEquals([x], Array.prototype.slice.call(arguments, 0)); + let result = Array.prototype.slice.call(arguments, 0); + assertEquals([x], result); + %HeapObjectVerify(result); + %HeapObjectVerify(arguments); } func('a'); @@ -286,7 +304,10 @@ function func(x, y, z) { assertEquals(3, arguments.length); delete arguments[1]; - assertEquals([x,,z], Array.prototype.slice.call(arguments, 0)); + let result = Array.prototype.slice.call(arguments, 0); + assertEquals([x,,z], result); + %HeapObjectVerify(result); + %HeapObjectVerify(arguments); } func('a', 'b', 'c'); @@ -300,6 +321,8 @@ var result = Array.prototype.slice.call(arguments); delete arguments.__proto__[1]; assertEquals([1,5,3], result); + %HeapObjectVerify(result); + %HeapObjectVerify(arguments); } f(1,2,3); })(); diff --git a/deps/v8/test/mjsunit/array-store-and-grow.js b/deps/v8/test/mjsunit/array-store-and-grow.js index 4de7a376e3..ee831ad061 100644 --- a/deps/v8/test/mjsunit/array-store-and-grow.js +++ b/deps/v8/test/mjsunit/array-store-and-grow.js @@ -25,7 +25,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// Flags: --allow-natives-syntax --crankshaft --no-always-opt +// Flags: --allow-natives-syntax --opt --no-always-opt // Verifies that the KeyedStoreIC correctly handles out-of-bounds stores // to an array that grow it by a single element. Test functions are diff --git a/deps/v8/test/mjsunit/asm/asm-memory.js b/deps/v8/test/mjsunit/asm/asm-memory.js new file mode 100644 index 0000000000..6f9b2fe639 --- /dev/null +++ b/deps/v8/test/mjsunit/asm/asm-memory.js @@ -0,0 +1,55 @@ +// 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: --allow-natives-syntax + +(function TestUnalignedMemory() { + // Test that a buffer whose length is not a multiple of the element size of a + // heap view throws the proper {RangeError} during instantiation. + function Module(stdlib, foreign, heap) { + "use asm"; + var a = new stdlib.Int32Array(heap); + function f() {} + return { f:f }; + } + assertThrows(() => Module(this, {}, new ArrayBuffer(2)), RangeError); + assertThrows(() => Module(this, {}, new ArrayBuffer(10)), RangeError); + assertDoesNotThrow(() => Module(this, {}, new ArrayBuffer(4))); + assertDoesNotThrow(() => Module(this, {}, new ArrayBuffer(16))); + assertFalse(%IsAsmWasmCode(Module)); +})(); + +(function TestMissingMemory() { + // Test that a buffer is required for instantiation of modules containing any + // heap views. JavaScript needs to create individual buffers for each view. + function Module(stdlib, foreign, heap) { + "use asm"; + var a = new stdlib.Int16Array(heap); + var b = new stdlib.Int32Array(heap); + function f() { + a[0] = 0x1234; + return b[0] | 0; + } + return { f:f }; + } + var m = Module(this, {}, undefined); + assertFalse(%IsAsmWasmCode(Module)); + assertEquals(0, m.f()); +})(); + +(function TestNonBufferMemory() { + // Test that a buffer has to be an instance of {ArrayBuffer} in order to be + // valid. JavaScript will also accept any other array-like object. + function Module(stdlib, foreign, heap) { + "use asm"; + var a = new stdlib.Int32Array(heap); + function f() { + return a[0] | 0; + } + return { f:f }; + } + var m = Module(this, {}, [ 23, 42 ]); + assertFalse(%IsAsmWasmCode(Module)); + assertEquals(23, m.f()); +})(); diff --git a/deps/v8/test/mjsunit/asm/asm-stdlib.js b/deps/v8/test/mjsunit/asm/asm-stdlib.js new file mode 100644 index 0000000000..65d0b76ff7 --- /dev/null +++ b/deps/v8/test/mjsunit/asm/asm-stdlib.js @@ -0,0 +1,46 @@ +// 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: --allow-natives-syntax + +(function FailProxyAsStdlib() { + // Test that passing a proxy as "stdlib" will cause module instantiation to + // fail while still only triggering one observable property load. + function Module(stdlib, foreign, heap) { + "use asm"; + var a = stdlib.Math.PI; + function f() { return a } + return { f:f }; + } + var trap_was_called = 0; + var proxy = new Proxy(this, { get:function(target, property, receiver) { + trap_was_called++; + if (property == "Math") return { PI:23 }; + return Reflect.get(target, property, receiver); + }}); + var m = Module(proxy); + assertFalse(%IsAsmWasmCode(Module)); + assertEquals(1, trap_was_called); + assertEquals(23, m.f()); +})(); + +(function FailGetterInStdlib() { + // Test that accessors as part of "stdlib" will cause module instantiation to + // fail while still only triggering one observable property load. + function Module(stdlib, foreign, heap) { + "use asm"; + var a = new stdlib.Int8Array(heap); + function f() { return a[0] | 0 } + return { f:f }; + } + var trap_was_called = 0; + var observer = { get Int8Array() { + trap_was_called++; + return function() { return [ 23 ] }; + }}; + var m = Module(observer); + assertFalse(%IsAsmWasmCode(Module)); + assertEquals(1, trap_was_called); + assertEquals(23, m.f()); +})(); diff --git a/deps/v8/test/mjsunit/asm/asm-validation.js b/deps/v8/test/mjsunit/asm/asm-validation.js index 0925d103ea..ed5b748aad 100644 --- a/deps/v8/test/mjsunit/asm/asm-validation.js +++ b/deps/v8/test/mjsunit/asm/asm-validation.js @@ -474,8 +474,26 @@ function assertValidAsm(func) { assertFalse(o instanceof WebAssembly.Instance); assertTrue(o instanceof Object); assertTrue(o.__proto__ === Object.prototype); + var p = Object.getOwnPropertyDescriptor(o, "x") + assertTrue(p.writable); + assertTrue(p.enumerable); + assertTrue(p.configurable); + assertTrue(typeof o.x === 'function'); o.x = 5; assertTrue(typeof o.x === 'number'); assertTrue(o.__single_function__ === undefined); assertTrue(o.__foreign_init__ === undefined); })(); + +(function TestAsmExportOrderPreserved() { + function Module() { + "use asm"; + function f() {} + function g() {} + return { a:f, b:g, x:f, c:g, d:f }; + } + var m = Module(); + assertValidAsm(Module); + var props = Object.getOwnPropertyNames(m); + assertEquals(["a","b","x","c","d"], props); +})(); diff --git a/deps/v8/test/mjsunit/asm/call-annotation.js b/deps/v8/test/mjsunit/asm/call-annotation.js new file mode 100644 index 0000000000..e2260441e0 --- /dev/null +++ b/deps/v8/test/mjsunit/asm/call-annotation.js @@ -0,0 +1,179 @@ +// 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: --allow-natives-syntax --validate-asm + +// This file contains test cases that are particularly interesting for a single +// pass asm.js parsing and validation implementation in regards to the return +// type annotation via the "|0" operation. + +var g_was_called = 0; +function g() { + g_was_called++; + return "23.4"; +} + +(function SuccessExternCoercion() { + function Module(stdlib, imports, heap) { + "use asm"; + var g = imports.g; + function f(a) { + a = a | 0; + a = a + (g() | 0) | 0; + return a | 0; + } + return { f:f }; + } + g_was_called = 0; + var m = Module(this, { g:g }); + assertTrue(%IsAsmWasmCode(Module)); + assertEquals(24, m.f(1)); + assertEquals(1, g_was_called); +})(); + +(function FailPrecedenceLeftStronger() { + function Module(stdlib, imports, heap) { + "use asm"; + var g = imports.g; + function f(a) { + a = a | 0; + a = a + g() | 0; + return a | 0; + } + return { f:f }; + } + g_was_called = 0; + var m = Module(this, { g:g }); + assertFalse(%IsAsmWasmCode(Module)); + assertEquals(123, m.f(1)); + assertEquals(1, g_was_called); +})(); + +(function FailPrecedenceRightStronger() { + function Module(stdlib, imports, heap) { + "use asm"; + var g = imports.g; + function f(a) { + a = a | 0; + a = (g() | 0 + a) | 0; + return a | 0; + } + return { f:f }; + } + g_was_called = 0; + var m = Module(this, { g:g }); + assertFalse(%IsAsmWasmCode(Module)); + assertEquals(127, m.f(127)); + assertEquals(1, g_was_called); +})(); + +(function FailParenthesizedAnnotation() { + function Module(stdlib, imports, heap) { + "use asm"; + var g = imports.g; + function f(a) { + a = a | 0; + a = (g()) | 0; + return a | 0; + } + return { f:f }; + } + g_was_called = 0; + var m = Module(this, { g:g }); + // TODO(6127): Only properly rejected by "new" parser. + // assertFalse(%IsAsmWasmCode(Module)); + assertEquals(23, m.f(1)); + assertEquals(1, g_was_called); +})(); + +(function FailNonZeroAnnotation() { + function Module(stdlib, imports, heap) { + "use asm"; + var g = imports.g; + function f(a) { + a = a | 0; + a = g() | 127; + return a | 0; + } + return { f:f }; + } + g_was_called = 0; + var m = Module(this, { g:g }); + assertFalse(%IsAsmWasmCode(Module)); + assertEquals(127, m.f(1)); + assertEquals(1, g_was_called); +})(); + +(function FailNestedAnnotation1() { + function Module(stdlib, imports, heap) { + "use asm"; + var g = imports.g; + function f(a) { + a = a | 0; + a = g() | g() | 0; + return a | 0; + } + return { f:f }; + } + g_was_called = 0; + var m = Module(this, { g:g }); + assertFalse(%IsAsmWasmCode(Module)); + assertEquals(23, m.f(1)); + assertEquals(2, g_was_called); +})(); + +(function FailNestedAnnotation2() { + function Module(stdlib, imports, heap) { + "use asm"; + var g = imports.g; + function f(a) { + a = a | 0; + a = g() | 0 | g() | 0; + return a | 0; + } + return { f:f }; + } + g_was_called = 0; + var m = Module(this, { g:g }); + assertFalse(%IsAsmWasmCode(Module)); + assertEquals(23, m.f(1)); + assertEquals(2, g_was_called); +})(); + +(function SuccessMixedWithDoubleAnnotation() { + function Module(stdlib, imports, heap) { + "use asm"; + var g = imports.g; + function f(a) { + a = +a; + a = a + +(g() | 0); + return +a; + } + return { f:f }; + } + g_was_called = 0; + var m = Module(this, { g:g }); + assertTrue(%IsAsmWasmCode(Module)); + assertEquals(23.5, m.f(0.5)); + assertEquals(1, g_was_called); +})(); + +(function SuccessMixedWithFloatAnnotation() { + function Module(stdlib, imports, heap) { + "use asm"; + var g = imports.g; + var fround = stdlib.Math.fround; + function f(a) { + a = fround(a); + a = fround(a + fround(g() | 0)); + return fround(a); + } + return { f:f }; + } + g_was_called = 0; + var m = Module(this, { g:g }); + assertTrue(%IsAsmWasmCode(Module)); + assertEquals(23.5, m.f(0.5)); + assertEquals(1, g_was_called); +})(); diff --git a/deps/v8/test/mjsunit/asm/call-stdlib.js b/deps/v8/test/mjsunit/asm/call-stdlib.js new file mode 100644 index 0000000000..5d883f324a --- /dev/null +++ b/deps/v8/test/mjsunit/asm/call-stdlib.js @@ -0,0 +1,85 @@ +// 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: --allow-natives-syntax --validate-asm + +// This file contains test cases that are particularly interesting because they +// omit the usual call-site coercion of function calls that target well-known +// stdlib functions. + +(function SuccessStdlibWithoutAnnotation() { + function Module(stdlib, imports, heap) { + "use asm"; + var imul = stdlib.Math.imul; + function f(a, b) { + a = a | 0; + b = b | 0; + var r = 0; + r = imul(a, b); + return r | 0; + } + return { f:f }; + } + var m = Module(this); + assertTrue(%IsAsmWasmCode(Module)); + assertEquals(966, m.f(23, 42)); + assertEquals(-0x0fffffff, m.f(0x7ffffff, 0x7ffffff)); +})(); + +(function SuccessStdlibWithoutAnnotationThenRound() { + function Module(stdlib, imports, heap) { + "use asm"; + var fround = stdlib.Math.fround; + var imul = stdlib.Math.imul; + function f(a, b) { + a = a | 0; + b = b | 0; + var r = fround(0); + r = fround(imul(a, b)); + return fround(r); + } + return { f:f }; + } + var m = Module(this); + assertTrue(%IsAsmWasmCode(Module)); + assertEquals(966, m.f(23, 42)); + assertEquals(-0x0fffffff - 1, m.f(0x7ffffff, 0x7ffffff)); +})(); + +(function FailureStdlibWithoutAnnotationMismatch() { + function Module(stdlib, imports, heap) { + "use asm"; + var fround = stdlib.Math.fround; + var imul = stdlib.Math.imul; + function f(a, b) { + a = a | 0; + b = b | 0; + var r = fround(0); + r = imul(a, b); + return r | 0; + } + return { f:f }; + } + var m = Module(this); + assertFalse(%IsAsmWasmCode(Module)); + assertEquals(966, m.f(23, 42)); + assertEquals(-0x0fffffff, m.f(0x7ffffff, 0x7ffffff)); +})(); + +(function SuccessStdlibWithoutAnnotationUsedInReturn() { + function Module(stdlib, imports, heap) { + "use asm"; + var imul = stdlib.Math.imul; + function f(a, b) { + a = a | 0; + b = b | 0; + return imul(a, b); + } + return { f:f }; + } + var m = Module(this); + assertTrue(%IsAsmWasmCode(Module)); + assertEquals(966, m.f(23, 42)); + assertEquals(-0x0fffffff, m.f(0x7ffffff, 0x7ffffff)); +})(); diff --git a/deps/v8/test/mjsunit/asm/global-imports.js b/deps/v8/test/mjsunit/asm/global-imports.js new file mode 100644 index 0000000000..60c0930fa8 --- /dev/null +++ b/deps/v8/test/mjsunit/asm/global-imports.js @@ -0,0 +1,74 @@ +// 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: --allow-natives-syntax --validate-asm + +function MODULE_TEMPLATE(stdlib, foreign, buffer) { + "use asm"; + var fround = stdlib.Math.fround; + IMPORT; + function f(int, flt, dbl) { + int = int | 0; + flt = fround(flt); + dbl = +dbl; + return EXPRESSION; + } + return { f:f }; +} + +var throws = {}; +var test_count = 0; +const stdlib = this; +const buffer = new ArrayBuffer(1024); +function p(x) { return x * x; } + +function assertThrowsOrEquals(result, fun) { + if (result === throws) { + assertThrows(fun, TypeError); + } else { + assertEquals(result, fun(1, 2.3, 4.2)); + } +} + +function RunAsmJsTest(asm_source, imports, result, valid) { + var nonasm_source = asm_source.replace(new RegExp("use asm"), ""); + + var js_module = eval("(" + nonasm_source + ")") + var js_instance = js_module(stdlib, imports, buffer); + assertThrowsOrEquals(result, js_instance.f); + + var asm_module = eval("(" + asm_source + ")"); + var asm_instance = asm_module(stdlib, imports, buffer); + assertEquals(valid, %IsAsmWasmCode(asm_module)); + assertThrowsOrEquals(result, asm_instance.f); +} + +function Run(imp, exp, imports, result, valid) { + var name = "test" + (++test_count); + var src = MODULE_TEMPLATE.toString(); + src = src.replace("IMPORT", imp); + src = src.replace("EXPRESSION", exp); + src = src.replace("MODULE_TEMPLATE", name); + RunAsmJsTest(src, imports, result, valid); +} + +// Imports of values from foreign. +Run("var x = foreign.x | 0", "(x + int) | 0", {x:12}, 13, true); +Run("var x = foreign.x | 0", "(x = int) | 0", {x:12}, 1, true); +Run("var x = foreign.x | 0", "+(x + dbl)", {x:12}, 16.2, false); +Run("var x = +foreign.x", "+(x + dbl)", {x:1.2}, 5.4, true); +Run("var x = +foreign.x", "+(x = dbl)", {x:1.2}, 4.2, true); +Run("var x = +foreign.x", "(x + int) | 0", {x:1.2}, 2, false); +Run("const x = foreign.x | 0", "(x + int) | 0", {x:12}, 13, true); +Run("const x = foreign.x | 0", "(x = int) | 0", {x:12}, throws, false); +Run("const x = foreign.x | 0", "+(x + dbl)", {x:12}, 16.2, false); +Run("const x = +foreign.x", "+(x + dbl)", {x:1.2}, 5.4, true); +Run("const x = +foreign.x", "+(x = dbl)", {x:1.2}, throws, false); +Run("const x = +foreign.x", "(x + int) | 0", {x:1.2}, 2, false); + +// Imports of functions and values from stdlib and foreign. +Run("var x = foreign.x", "x(dbl) | 0", { x:p }, 17, true); +Run("var x = foreign.x", "(x = fround, x(dbl)) | 0", { x:p }, 4, false); +Run("var x = stdlib.Math.E", "(x = 3.1415, 1) | 0", {}, 1, false); +Run("var x = stdlib.Math.imul", "(x = fround, 1) | 0", {}, 1, false); diff --git a/deps/v8/test/mjsunit/asm/immutable.js b/deps/v8/test/mjsunit/asm/immutable.js new file mode 100644 index 0000000000..29c15cc7d9 --- /dev/null +++ b/deps/v8/test/mjsunit/asm/immutable.js @@ -0,0 +1,48 @@ +// 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: --allow-natives-syntax + +(function FailImmutableFunction() { + function Module(stdlib, imports, heap) { + "use asm"; + function f(a) { + a = a | 0; + if (a) { + a = f((a - 1) | 0) | 0; + f = 0; + return (a + 1) | 0; + } + return 23; + } + return { f:f }; + } + var m = Module(this); + assertFalse(%IsAsmWasmCode(Module)); + assertEquals(23, m.f(0)); + assertEquals(24, m.f(1)); + assertThrows(() => m.f(2)); +})(); + +(function FailImmutableFunctionTable() { + function Module(stdlib, imports, heap) { + "use asm"; + function f(a) { + a = a | 0; + if (a) { + a = funTable[a & 0]((a - 1) | 0) | 0; + funTable = 0; + return (a + 1) | 0; + } + return 23; + } + var funTable = [ f ]; + return { f:f }; + } + var m = Module(this); + assertFalse(%IsAsmWasmCode(Module)); + assertEquals(23, m.f(0)); + assertEquals(24, m.f(1)); + assertThrows(() => m.f(2)); +})(); diff --git a/deps/v8/test/mjsunit/asm/int32-mul.js b/deps/v8/test/mjsunit/asm/int32-mul.js index 4c5e38668a..1f2066b78b 100644 --- a/deps/v8/test/mjsunit/asm/int32-mul.js +++ b/deps/v8/test/mjsunit/asm/int32-mul.js @@ -6,7 +6,7 @@ function Module(stdlib, foreign, heap) { "use asm"; function f1(i) { i = i|0; - return (i | 0) * 3 | 0; + return (i | 0) * -3 | 0; } function f2(i) { i = i|0; @@ -26,7 +26,7 @@ function Module(stdlib, foreign, heap) { var m = Module(this, {}, new ArrayBuffer(1024)); for (var i = -2147483648; i < 2147483648; i += 3999771) { - assertEquals(i * 3 | 0, m.f1(i)); + assertEquals(i * -3 | 0, m.f1(i)); assertEquals(i * 7 | 0, m.f2(i)); assertEquals(i * 1024 | 0, m.f3(i)); assertEquals(i * 333339 | 0, m.f4(i)); diff --git a/deps/v8/test/mjsunit/asm/regress-718745.js b/deps/v8/test/mjsunit/asm/regress-718745.js new file mode 100644 index 0000000000..eb5416808b --- /dev/null +++ b/deps/v8/test/mjsunit/asm/regress-718745.js @@ -0,0 +1,13 @@ +// 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. + +function Module(stdlib) { + "use asm"; + var fround = stdlib.Math.fround; + function f(a) { + a = (fround(a)); + } + return { f:f }; +} +Module(this).f(); diff --git a/deps/v8/test/mjsunit/asm/return-types.js b/deps/v8/test/mjsunit/asm/return-types.js new file mode 100644 index 0000000000..7ecdd4267e --- /dev/null +++ b/deps/v8/test/mjsunit/asm/return-types.js @@ -0,0 +1,123 @@ +// 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: --allow-natives-syntax --validate-asm + +(function SuccessReturnTypesMatch() { + function Module(stdlib, imports, heap) { + "use asm"; + function f(a) { + a = a | 0; + if ((a | 0) == 1) return 2.3; + if ((a | 0) == 2) return 4.2; + return 6.5; + } + return { f:f }; + } + var m = Module(this); + assertTrue(%IsAsmWasmCode(Module)); + assertEquals(2.3, m.f(1)); + assertEquals(4.2, m.f(2)); + assertEquals(6.5, m.f(3)); +})(); + +(function FailReturnTypesMismatch() { + function Module(stdlib, imports, heap) { + "use asm"; + function f(a) { + a = a | 0; + if ((a | 0) == 1) return 2.3; + if ((a | 0) == 2) return 123; + return 4.2; + } + return { f:f }; + } + var m = Module(this); + assertFalse(%IsAsmWasmCode(Module)); + assertEquals(2.3, m.f(1)); + assertEquals(123, m.f(2)); + assertEquals(4.2, m.f(3)); +})(); + +(function FailFallOffNonVoidFunction() { + function Module(stdlib, imports, heap) { + "use asm"; + function f(a) { + a = a | 0; + if ((a | 0) == 1) return 2.3; + if ((a | 0) == 2) return 4.2; + } + return { f:f }; + } + var m = Module(this); + assertFalse(%IsAsmWasmCode(Module)); + assertEquals(2.3, m.f(1)); + assertEquals(4.2, m.f(2)); + assertEquals(undefined, m.f(3)); +})(); + +(function FailNonVoidVoidMismatch() { + function Module(stdlib, imports, heap) { + "use asm"; + function f(a) { + a = a | 0; + if ((a | 0) == 1) return 2.3; + if ((a | 0) == 2) return; + } + return { f:f }; + } + var m = Module(this); + assertFalse(%IsAsmWasmCode(Module)); + assertEquals(2.3, m.f(1)); + assertEquals(undefined, m.f(2)); + assertEquals(undefined, m.f(3)); +})(); + +(function FailVoidNonVoidMismatch() { + function Module(stdlib, imports, heap) { + "use asm"; + function f(a) { + a = a | 0; + if ((a | 0) == 1) return; + if ((a | 0) == 2) return 2.3; + } + return { f:f }; + } + var m = Module(this); + assertFalse(%IsAsmWasmCode(Module)); + assertEquals(undefined, m.f(1)); + assertEquals(2.3, m.f(2)); + assertEquals(undefined, m.f(3)); +})(); + +(function SuccessVoidFunction() { + function Module(stdlib, imports, heap) { + "use asm"; + function f(a) { + a = a | 0; + if ((a | 0) == 1) return; + return; + } + return { f:f }; + } + var m = Module(this); + assertTrue(%IsAsmWasmCode(Module)); + assertEquals(undefined, m.f(1)); + assertEquals(undefined, m.f(2)); +})(); + +(function SuccessFallOffVoidFunction() { + function Module(stdlib, imports, heap) { + "use asm"; + function f(a) { + a = a | 0; + if ((a | 0) == 1) return; + } + return { f:f }; + } + var m = Module(this); + assertTrue(%IsAsmWasmCode(Module)); + assertEquals(undefined, m.f(1)); + assertEquals(undefined, m.f(2)); +})(); diff --git a/deps/v8/test/mjsunit/basic-promise.js b/deps/v8/test/mjsunit/basic-promise.js index 9905fa475f..da12f28198 100644 --- a/deps/v8/test/mjsunit/basic-promise.js +++ b/deps/v8/test/mjsunit/basic-promise.js @@ -8,14 +8,6 @@ // exceptions which are swallowed in a then clause. failWithMessage = (msg) => %AbortJS(msg); -let decrement = () => { %DecrementWaitCount(); } -let increment = () => { %IncrementWaitCount(); } - -function WaitForPromise(p) { - increment(); - p.then(decrement, decrement); -} - function newPromise() { var outerResolve; var outerReject; @@ -23,7 +15,7 @@ function newPromise() { outerResolve = resolve; outerReject = reject; }); - WaitForPromise(promise); // explicitly wait for promise to resolve. + Promise.resolve(promise); return { resolve: outerResolve, reject: outerReject, diff --git a/deps/v8/test/mjsunit/compiler/array-constructor.js b/deps/v8/test/mjsunit/compiler/array-constructor.js new file mode 100644 index 0000000000..583817b7d8 --- /dev/null +++ b/deps/v8/test/mjsunit/compiler/array-constructor.js @@ -0,0 +1,89 @@ +// 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: --allow-natives-syntax + +// Test Array call with known Boolean. +(() => { + function foo(x) { return Array(!!x); } + + assertEquals([true], foo(true)); + assertEquals([false], foo(false)); + %OptimizeFunctionOnNextCall(foo); + assertEquals([true], foo(true)); + assertEquals([false], foo(false)); +})(); + +// Test Array construct with known Boolean. +(() => { + function foo(x) { return new Array(!!x); } + + assertEquals([true], foo(true)); + assertEquals([false], foo(false)); + %OptimizeFunctionOnNextCall(foo); + assertEquals([true], foo(true)); + assertEquals([false], foo(false)); +})(); + +// Test Array call with known String. +(() => { + function foo(x) { return Array("" + x); } + + assertEquals(["a"], foo("a")); + assertEquals(["b"], foo("b")); + %OptimizeFunctionOnNextCall(foo); + assertEquals(["a"], foo("a")); + assertEquals(["b"], foo("b")); +})(); + +// Test Array construct with known String. +(() => { + function foo(x) { return new Array("" + x); } + + assertEquals(["a"], foo("a")); + assertEquals(["b"], foo("b")); + %OptimizeFunctionOnNextCall(foo); + assertEquals(["a"], foo("a")); + assertEquals(["b"], foo("b")); +})(); + +// Test Array call with known fixed small integer. +(() => { + function foo() { return Array(2); } + + assertEquals(2, foo().length); + assertEquals(2, foo().length); + %OptimizeFunctionOnNextCall(foo); + assertEquals(2, foo().length); +})(); + +// Test Array construct with known fixed small integer. +(() => { + function foo() { return new Array(2); } + + assertEquals(2, foo().length); + assertEquals(2, foo().length); + %OptimizeFunctionOnNextCall(foo); + assertEquals(2, foo().length); +})(); + +// Test Array call with multiple parameters. +(() => { + function foo(x, y, z) { return Array(x, y, z); } + + assertEquals([1, 2, 3], foo(1, 2, 3)); + assertEquals([1, 2, 3], foo(1, 2, 3)); + %OptimizeFunctionOnNextCall(foo); + assertEquals([1, 2, 3], foo(1, 2, 3)); +})(); + +// Test Array construct with multiple parameters. +(() => { + function foo(x, y, z) { return new Array(x, y, z); } + + assertEquals([1, 2, 3], foo(1, 2, 3)); + assertEquals([1, 2, 3], foo(1, 2, 3)); + %OptimizeFunctionOnNextCall(foo); + assertEquals([1, 2, 3], foo(1, 2, 3)); +})(); diff --git a/deps/v8/test/mjsunit/compiler/constructor-inlining-no-harmony-restrict-constructor-return.js b/deps/v8/test/mjsunit/compiler/constructor-inlining-no-harmony-restrict-constructor-return.js new file mode 100644 index 0000000000..6dbaf6bf3f --- /dev/null +++ b/deps/v8/test/mjsunit/compiler/constructor-inlining-no-harmony-restrict-constructor-return.js @@ -0,0 +1,12 @@ +// 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: --allow-natives-syntax --no-harmony-restrict-constructor-return --max-deopt-count 200 + +this.FLAG_harmony_restrict_constructor_return = false; +try { + load('mjsunit/compiler/constructor-inlining.js'); +} catch(e) { + load('test/mjsunit/compiler/constructor-inlining.js'); +} diff --git a/deps/v8/test/mjsunit/compiler/constructor-inlining.js b/deps/v8/test/mjsunit/compiler/constructor-inlining.js new file mode 100644 index 0000000000..b01885d8ba --- /dev/null +++ b/deps/v8/test/mjsunit/compiler/constructor-inlining.js @@ -0,0 +1,128 @@ +// 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: --allow-natives-syntax --harmony-restrict-constructor-return --max-deopt-count 200 + +if (this.FLAG_harmony_restrict_constructor_return === undefined) + this.FLAG_harmony_restrict_constructor_return = true; +var counter = 0; +var deopt_at = -1; + +class Base { + constructor(use, x){ + if (deopt_at-- == 0) { + %_DeoptimizeNow(); + %DeoptimizeFunction(testConstructorInlining); + } + counter++; + this.x = x; + if (use) { + return x; + } + } +} + +class Derived extends Base { + constructor(use, x, y, deopt = false) { + super(use, x); + counter++; + if (deopt_at-- == 0) %_DeoptimizeNow(); + this.y = y; + if (use) { + return y; + } + } +} + +var DerivedDeoptCreate = new Proxy(Derived, { + get: function(target, name) { + if (name=='prototype') { + counter++; + if (deopt_at-- == 0) %DeoptimizeFunction(Derived); + } + return target[name]; + } +}); + +function Constr(use, x){ + counter++; + if (deopt_at-- == 0) %_DeoptimizeNow(); + this.x = x; + if (use) { + return x; + } +} + +%SetForceInlineFlag(Base); +%SetForceInlineFlag(Derived); +%SetForceInlineFlag(Constr); + +var a = {}; +var b = {}; + +function testConstructorInlining(){ + assertEquals(a, new Constr(true, a)); + assertEquals(7, new Constr(false, 7).x); + assertEquals(5, new Constr(true, 5).x); + + assertEquals(a, new Base(true, a)); + assertEquals(7, new Base(false, 7).x); + if (FLAG_harmony_restrict_constructor_return) { + // not using assertThrows to ensure proper inlining + try { + new Base(true, 5); + assertTrue(false); + } catch (e) { + if (!(e instanceof TypeError)) throw e; + } + } else { + assertEquals(5, new Base(true, 5).x); + } + + assertEquals(b, new Derived(true, a, b)); + assertEquals(a, new Derived(true, a, undefined)); + assertEquals(5, new Derived(false, 5, 7).x); + assertEquals(7, new Derived(false, 5, 7).y); + try { + new Derived(true, a, 7) + assertTrue(false); + } catch (e) { + if (!(e instanceof TypeError)) throw e; + } + if (FLAG_harmony_restrict_constructor_return) { + try { + new Derived(true, 5, a) + assertTrue(false); + } catch (e) { + if (!(e instanceof TypeError)) throw e; + } + } else { + assertEquals(a, new Derived(true, 5, a)); + } + + %OptimizeFunctionOnNextCall(Derived); + assertEquals(b, new DerivedDeoptCreate(true, a, b)); + %OptimizeFunctionOnNextCall(Derived); + assertEquals(a, new DerivedDeoptCreate(true, a, undefined)); + %OptimizeFunctionOnNextCall(Derived); + assertEquals(5, new DerivedDeoptCreate(false, 5, 7).x); + %OptimizeFunctionOnNextCall(Derived); + assertEquals(7, new DerivedDeoptCreate(false, 5, 7).y); +} + +testConstructorInlining(); +%OptimizeFunctionOnNextCall(testConstructorInlining); +testConstructorInlining(); + +var last = undefined; +for(var i = 0; deopt_at < 0; ++i) { + deopt_at = i; + counter = 0; + %OptimizeFunctionOnNextCall(testConstructorInlining); + testConstructorInlining(); + if (last !== undefined) { + assertEquals(counter, last) + } + last = counter; +} diff --git a/deps/v8/test/mjsunit/compiler/deopt-inlined-from-call.js b/deps/v8/test/mjsunit/compiler/deopt-inlined-from-call.js index db9eb96824..8fa8af5a9b 100644 --- a/deps/v8/test/mjsunit/compiler/deopt-inlined-from-call.js +++ b/deps/v8/test/mjsunit/compiler/deopt-inlined-from-call.js @@ -25,7 +25,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// Flags: --allow-natives-syntax --crankshaft --no-always-opt +// Flags: --allow-natives-syntax --opt --no-always-opt var global = this; diff --git a/deps/v8/test/mjsunit/compiler/deopt-numberoroddball-binop.js b/deps/v8/test/mjsunit/compiler/deopt-numberoroddball-binop.js index d14c8471bc..2c6473d15f 100644 --- a/deps/v8/test/mjsunit/compiler/deopt-numberoroddball-binop.js +++ b/deps/v8/test/mjsunit/compiler/deopt-numberoroddball-binop.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 --crankshaft +// Flags: --allow-natives-syntax --opt (function() { function foo(x, y) { return x << y; } diff --git a/deps/v8/test/mjsunit/compiler/deopt-string-outofbounds.js b/deps/v8/test/mjsunit/compiler/deopt-string-outofbounds.js index ef85eee2b2..ebdcc6cce5 100644 --- a/deps/v8/test/mjsunit/compiler/deopt-string-outofbounds.js +++ b/deps/v8/test/mjsunit/compiler/deopt-string-outofbounds.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 --crankshaft --no-always-opt +// Flags: --allow-natives-syntax --opt --no-always-opt var s = "12345"; diff --git a/deps/v8/test/mjsunit/compiler/escape-analysis-16.js b/deps/v8/test/mjsunit/compiler/escape-analysis-16.js new file mode 100644 index 0000000000..4cd9ae43fd --- /dev/null +++ b/deps/v8/test/mjsunit/compiler/escape-analysis-16.js @@ -0,0 +1,18 @@ +// 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: --allow-natives-syntax --no-turbo-loop-peeling --turbo-escape + +function foo(){ + var o = {a : 5} + for (var i = 0; i < 100; ++i) { + o.a = 5; + o.a = 7; + } +} + +foo(); +foo(); +%OptimizeFunctionOnNextCall(foo) +foo(); diff --git a/deps/v8/test/mjsunit/compiler/escape-analysis-phi-type-2.js b/deps/v8/test/mjsunit/compiler/escape-analysis-phi-type-2.js new file mode 100644 index 0000000000..2c2135b6da --- /dev/null +++ b/deps/v8/test/mjsunit/compiler/escape-analysis-phi-type-2.js @@ -0,0 +1,41 @@ +// 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: --allow-natives-syntax --turbo-escape + +function f(x) { + var o = {a : 0, b: 0}; + if (x == 0) { + o.a = 1 + } else { + if (x <= 1) { + if (x == 2) { + o.a = 2; + } else { + o.a = 1 + } + o.a = 2; + } else { + if (x == 2) { + o.a = "x"; + } else { + o.a = "x"; + } + o.b = 22; + } + o.b = 22; + } + return o.a + 1; +} + +f(0,0); +f(1,0); +f(2,0); +f(3,0); +f(0,1); +f(1,1); +f(2,1); +f(3,1); +%OptimizeFunctionOnNextCall(f); +assertEquals(f(2), "x1"); diff --git a/deps/v8/test/mjsunit/compiler/escape-analysis-phi-type.js b/deps/v8/test/mjsunit/compiler/escape-analysis-phi-type.js new file mode 100644 index 0000000000..806b09b3de --- /dev/null +++ b/deps/v8/test/mjsunit/compiler/escape-analysis-phi-type.js @@ -0,0 +1,24 @@ +// 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: --allow-natives-syntax --turbo-escape --turbo-experimental --no-turbo-loop-peeling + +function f(x) { + var o = {a : 0}; + var l = [1,2,3,4]; + var res; + for (var i = 0; i < 3; ++i) { + if (x%2 == 0) { o.a = 1; b = false} + res = l[o.a]; + o.a = x; + } + return res; +} + +f(0); +f(1); +f(0); +f(1); +%OptimizeFunctionOnNextCall(f); +assertEquals(undefined, f(101)); diff --git a/deps/v8/test/mjsunit/compiler/escape-analysis-representation.js b/deps/v8/test/mjsunit/compiler/escape-analysis-representation.js index 127d92ea7d..1c7cae76c9 100644 --- a/deps/v8/test/mjsunit/compiler/escape-analysis-representation.js +++ b/deps/v8/test/mjsunit/compiler/escape-analysis-representation.js @@ -25,7 +25,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// Flags: --allow-natives-syntax --use-escape-analysis --max-opt-count=100 +// Flags: --allow-natives-syntax --use-escape-analysis // This tests that captured objects materialized through the deoptimizer // have field descriptors with a representation matching the values that diff --git a/deps/v8/test/mjsunit/compiler/increment-typefeedback.js b/deps/v8/test/mjsunit/compiler/increment-typefeedback.js index dca488b13f..53e5ed678f 100644 --- a/deps/v8/test/mjsunit/compiler/increment-typefeedback.js +++ b/deps/v8/test/mjsunit/compiler/increment-typefeedback.js @@ -25,7 +25,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// Flags: --allow-natives-syntax --crankshaft +// Flags: --allow-natives-syntax --opt function f(x) { x++; diff --git a/deps/v8/test/mjsunit/compiler/inline-accessors.js b/deps/v8/test/mjsunit/compiler/inline-accessors.js index 90e0263b42..b3985bf9dc 100644 --- a/deps/v8/test/mjsunit/compiler/inline-accessors.js +++ b/deps/v8/test/mjsunit/compiler/inline-accessors.js @@ -25,7 +25,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// Flags: --allow-natives-syntax --inline-accessors --max-opt-count=100 +// Flags: --allow-natives-syntax --inline-accessors var accessorCallCount, setterArgument, setterValue, obj, forceDeopt; diff --git a/deps/v8/test/mjsunit/compiler/inline-arguments.js b/deps/v8/test/mjsunit/compiler/inline-arguments.js index 1579926e24..13f4a33e7b 100644 --- a/deps/v8/test/mjsunit/compiler/inline-arguments.js +++ b/deps/v8/test/mjsunit/compiler/inline-arguments.js @@ -25,7 +25,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// Flags: --allow-natives-syntax --max-opt-count=100 +// Flags: --allow-natives-syntax function A() { } diff --git a/deps/v8/test/mjsunit/compiler/inlined-array-pop-opt.js b/deps/v8/test/mjsunit/compiler/inlined-array-pop-opt.js index 8263fc2f37..08cbdbef8c 100644 --- a/deps/v8/test/mjsunit/compiler/inlined-array-pop-opt.js +++ b/deps/v8/test/mjsunit/compiler/inlined-array-pop-opt.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 --crankshaft +// Flags: --allow-natives-syntax --opt (function() { function foo(a) { return a.pop(); } diff --git a/deps/v8/test/mjsunit/compiler/inlined-call.js b/deps/v8/test/mjsunit/compiler/inlined-call.js index 97f2514387..772dcbee8b 100644 --- a/deps/v8/test/mjsunit/compiler/inlined-call.js +++ b/deps/v8/test/mjsunit/compiler/inlined-call.js @@ -25,7 +25,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// Flags: --allow-natives-syntax --crankshaft +// Flags: --allow-natives-syntax --opt var global = this; diff --git a/deps/v8/test/mjsunit/compiler/instanceof.js b/deps/v8/test/mjsunit/compiler/instanceof.js index cb88e7c284..f6a364e607 100644 --- a/deps/v8/test/mjsunit/compiler/instanceof.js +++ b/deps/v8/test/mjsunit/compiler/instanceof.js @@ -131,3 +131,15 @@ F.__proto__ = null; assertFalse(foo(new A())); assertTrue(foo(new F())); })(); + +(function() { + function foo() { + var a = new A(); + return a instanceof A; + } + + assertTrue(foo()); + assertTrue(foo()); + %OptimizeFunctionOnNextCall(foo); + assertTrue(foo()); +})(); diff --git a/deps/v8/test/mjsunit/compiler/integral32-add-sub.js b/deps/v8/test/mjsunit/compiler/integral32-add-sub.js index c85397cc8a..16515d3990 100644 --- a/deps/v8/test/mjsunit/compiler/integral32-add-sub.js +++ b/deps/v8/test/mjsunit/compiler/integral32-add-sub.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 --crankshaft +// Flags: --allow-natives-syntax --opt (function() { function foo(x) { diff --git a/deps/v8/test/mjsunit/compiler/manual-concurrent-recompile.js b/deps/v8/test/mjsunit/compiler/manual-concurrent-recompile.js index 094c338dcd..19b4d2a0f1 100644 --- a/deps/v8/test/mjsunit/compiler/manual-concurrent-recompile.js +++ b/deps/v8/test/mjsunit/compiler/manual-concurrent-recompile.js @@ -27,7 +27,7 @@ // Flags: --allow-natives-syntax --expose-gc // Flags: --concurrent-recompilation --block-concurrent-recompilation -// Flags: --crankshaft --no-always-opt +// Flags: --opt --no-always-opt if (!%IsConcurrentRecompilationSupported()) { print("Concurrent recompilation is disabled. Skipping this test."); diff --git a/deps/v8/test/mjsunit/compiler/object-getprototypeof.js b/deps/v8/test/mjsunit/compiler/object-getprototypeof.js new file mode 100644 index 0000000000..ac172dbeb2 --- /dev/null +++ b/deps/v8/test/mjsunit/compiler/object-getprototypeof.js @@ -0,0 +1,15 @@ +// 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: --allow-natives-syntax + +var prototype = Object.create(null); +var object = Object.create(prototype); + +function foo() { return Object.getPrototypeOf(object); } + +assertSame(prototype, foo()); +assertSame(prototype, foo()); +%OptimizeFunctionOnNextCall(foo); +assertSame(prototype, foo()); diff --git a/deps/v8/test/mjsunit/compiler/opt-next-call-turbo.js b/deps/v8/test/mjsunit/compiler/opt-next-call-turbo.js index 39f29c9e5c..eb8df4b50c 100644 --- a/deps/v8/test/mjsunit/compiler/opt-next-call-turbo.js +++ b/deps/v8/test/mjsunit/compiler/opt-next-call-turbo.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 --crankshaft --turbo-filter=* +// Flags: --allow-natives-syntax --opt --turbo-filter=* function foo() { with ({ value:"fooed" }) { return value; } diff --git a/deps/v8/test/mjsunit/compiler/opt-next-call.js b/deps/v8/test/mjsunit/compiler/opt-next-call.js index f1ae5bda09..2878efefe9 100644 --- a/deps/v8/test/mjsunit/compiler/opt-next-call.js +++ b/deps/v8/test/mjsunit/compiler/opt-next-call.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 --crankshaft +// Flags: --allow-natives-syntax --opt function foo() { return "fooed"; diff --git a/deps/v8/test/mjsunit/compiler/optimized-float32array-length.js b/deps/v8/test/mjsunit/compiler/optimized-float32array-length.js index 6fde8d6daf..6e08e4a57f 100644 --- a/deps/v8/test/mjsunit/compiler/optimized-float32array-length.js +++ b/deps/v8/test/mjsunit/compiler/optimized-float32array-length.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 --crankshaft +// Flags: --allow-natives-syntax --opt var a = new Float32Array(1); function len(a) { return a.length; } diff --git a/deps/v8/test/mjsunit/compiler/optimized-float64array-length.js b/deps/v8/test/mjsunit/compiler/optimized-float64array-length.js index 13a7539054..7d48d09c68 100644 --- a/deps/v8/test/mjsunit/compiler/optimized-float64array-length.js +++ b/deps/v8/test/mjsunit/compiler/optimized-float64array-length.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 --crankshaft +// Flags: --allow-natives-syntax --opt var a = new Float64Array(1); function len(a) { return a.length; } diff --git a/deps/v8/test/mjsunit/compiler/optimized-int32array-length.js b/deps/v8/test/mjsunit/compiler/optimized-int32array-length.js index cd1b7a775a..00bf8d12a4 100644 --- a/deps/v8/test/mjsunit/compiler/optimized-int32array-length.js +++ b/deps/v8/test/mjsunit/compiler/optimized-int32array-length.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 --crankshaft +// Flags: --allow-natives-syntax --opt var a = new Int32Array(1); function len(a) { return a.length; } diff --git a/deps/v8/test/mjsunit/compiler/optimized-uint32array-length.js b/deps/v8/test/mjsunit/compiler/optimized-uint32array-length.js index fe56e68cb5..3a88ed7d25 100644 --- a/deps/v8/test/mjsunit/compiler/optimized-uint32array-length.js +++ b/deps/v8/test/mjsunit/compiler/optimized-uint32array-length.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 --crankshaft +// Flags: --allow-natives-syntax --opt var a = new Uint32Array(1); function len(a) { return a.length; } diff --git a/deps/v8/test/mjsunit/compiler/reflect-getprototypeof.js b/deps/v8/test/mjsunit/compiler/reflect-getprototypeof.js new file mode 100644 index 0000000000..a5ea89140e --- /dev/null +++ b/deps/v8/test/mjsunit/compiler/reflect-getprototypeof.js @@ -0,0 +1,15 @@ +// 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: --allow-natives-syntax + +var prototype = Object.create(null); +var object = Object.create(prototype); + +function foo() { return Reflect.getPrototypeOf(object); } + +assertSame(prototype, foo()); +assertSame(prototype, foo()); +%OptimizeFunctionOnNextCall(foo); +assertSame(prototype, foo()); diff --git a/deps/v8/test/mjsunit/compiler/regress-5320.js b/deps/v8/test/mjsunit/compiler/regress-5320.js index 026a51e7cb..e2fa65de31 100644 --- a/deps/v8/test/mjsunit/compiler/regress-5320.js +++ b/deps/v8/test/mjsunit/compiler/regress-5320.js @@ -25,7 +25,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// Flags: --allow-natives-syntax --crankshaft +// Flags: --allow-natives-syntax --opt function OptimizeTruncatingBinaryOp(func) { func(42, -2); diff --git a/deps/v8/test/mjsunit/compiler/regress-715204.js b/deps/v8/test/mjsunit/compiler/regress-715204.js new file mode 100644 index 0000000000..65f97c0ee3 --- /dev/null +++ b/deps/v8/test/mjsunit/compiler/regress-715204.js @@ -0,0 +1,13 @@ +// 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. + +var global = true; +global = false; + +function f() { + global = 1; + return !global; +} + +f(); diff --git a/deps/v8/test/mjsunit/compiler/regress-715651.js b/deps/v8/test/mjsunit/compiler/regress-715651.js new file mode 100644 index 0000000000..a75adc8ae7 --- /dev/null +++ b/deps/v8/test/mjsunit/compiler/regress-715651.js @@ -0,0 +1,38 @@ +// 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: --allow-natives-syntax + +function f() { + this.x = 1; +} + +var a = []; + +// Create enough objects to trigger slack tracking. +for (let i = 0; i < 100; i++) { + new f(); +} + +function h() { + // Create a new object and add an out-of-object property 'y'. + var o = new f(); + o.y = 1.5; + return o; +} + +function g(o) { + // Add more properties so that we trigger extension of out-ot-object + // property store. + o.u = 1.1; + o.v = 1.2; + o.z = 1.3; + // Return a field from the out-of-object-property store. + return o.y; +} + +g(h()); +g(h()); +%OptimizeFunctionOnNextCall(g); +assertEquals(1.5, g(h())); diff --git a/deps/v8/test/mjsunit/compiler/regress-compare-negate.js b/deps/v8/test/mjsunit/compiler/regress-compare-negate.js index 3ae2cc284c..5591af1b32 100644 --- a/deps/v8/test/mjsunit/compiler/regress-compare-negate.js +++ b/deps/v8/test/mjsunit/compiler/regress-compare-negate.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 --turbo --crankshaft +// Flags: --allow-natives-syntax --turbo --opt function CompareNegate(a,b) { a = a|0; diff --git a/deps/v8/test/mjsunit/compiler/regress-string-to-number-add.js b/deps/v8/test/mjsunit/compiler/regress-string-to-number-add.js index e872401c0b..0d524d20fd 100644 --- a/deps/v8/test/mjsunit/compiler/regress-string-to-number-add.js +++ b/deps/v8/test/mjsunit/compiler/regress-string-to-number-add.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 --turbo-type-feedback +// Flags: --allow-natives-syntax function f(x) { var s = x ? "0" : "1"; diff --git a/deps/v8/test/mjsunit/compiler/turbo-number-feedback.js b/deps/v8/test/mjsunit/compiler/turbo-number-feedback.js index 8dcc42c8a1..8875b8c0c3 100644 --- a/deps/v8/test/mjsunit/compiler/turbo-number-feedback.js +++ b/deps/v8/test/mjsunit/compiler/turbo-number-feedback.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 --turbo-type-feedback +// Flags: --allow-natives-syntax (function AddSubtractSmis() { function f0(a, b, c) { diff --git a/deps/v8/test/mjsunit/compiler/uint8-clamped-array.js b/deps/v8/test/mjsunit/compiler/uint8-clamped-array.js index 17a0ad400e..21cc5bbc36 100644 --- a/deps/v8/test/mjsunit/compiler/uint8-clamped-array.js +++ b/deps/v8/test/mjsunit/compiler/uint8-clamped-array.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 --crankshaft +// Flags: --allow-natives-syntax --opt (function() { function foo(a, v) { diff --git a/deps/v8/test/mjsunit/const-field-tracking.js b/deps/v8/test/mjsunit/const-field-tracking.js index ab1dbc1b23..3da6d29bf6 100644 --- a/deps/v8/test/mjsunit/const-field-tracking.js +++ b/deps/v8/test/mjsunit/const-field-tracking.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 --crankshaft --no-always-opt +// Flags: --allow-natives-syntax --opt --no-always-opt var global = this; diff --git a/deps/v8/test/mjsunit/constant-folding-2.js b/deps/v8/test/mjsunit/constant-folding-2.js index e9bea0aab5..e2d334b2f2 100644 --- a/deps/v8/test/mjsunit/constant-folding-2.js +++ b/deps/v8/test/mjsunit/constant-folding-2.js @@ -27,7 +27,7 @@ // Flags: --nodead-code-elimination --fold-constants -// Flags: --allow-natives-syntax --nostress-opt --crankshaft +// Flags: --allow-natives-syntax --nostress-opt --opt function test(f) { f(); diff --git a/deps/v8/test/mjsunit/deopt-minus-zero.js b/deps/v8/test/mjsunit/deopt-minus-zero.js index 47d46cd0f4..38795afa33 100644 --- a/deps/v8/test/mjsunit/deopt-minus-zero.js +++ b/deps/v8/test/mjsunit/deopt-minus-zero.js @@ -25,7 +25,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// Flags: --allow-natives-syntax --expose-gc --crankshaft +// Flags: --allow-natives-syntax --expose-gc --opt function mul (a, b) { return a * b; diff --git a/deps/v8/test/mjsunit/deopt-recursive-eager-once.js b/deps/v8/test/mjsunit/deopt-recursive-eager-once.js index 0c044694b2..ba88b01b1a 100644 --- a/deps/v8/test/mjsunit/deopt-recursive-eager-once.js +++ b/deps/v8/test/mjsunit/deopt-recursive-eager-once.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 --crankshaft --turbo --no-always-opt +// Flags: --allow-natives-syntax --opt --turbo --no-always-opt function foo(i, deopt = false) { if (i == 0) { diff --git a/deps/v8/test/mjsunit/deopt-recursive-lazy-once.js b/deps/v8/test/mjsunit/deopt-recursive-lazy-once.js index ace7bdfda6..f0eec59a4b 100644 --- a/deps/v8/test/mjsunit/deopt-recursive-lazy-once.js +++ b/deps/v8/test/mjsunit/deopt-recursive-lazy-once.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 --crankshaft --turbo --no-always-opt +// Flags: --allow-natives-syntax --opt --turbo --no-always-opt function foo(i, deopt = false) { if (i == 0) { diff --git a/deps/v8/test/mjsunit/deopt-recursive-soft-once.js b/deps/v8/test/mjsunit/deopt-recursive-soft-once.js index af1eb731f4..9338ff553b 100644 --- a/deps/v8/test/mjsunit/deopt-recursive-soft-once.js +++ b/deps/v8/test/mjsunit/deopt-recursive-soft-once.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 --crankshaft --turbo --no-always-opt +// Flags: --allow-natives-syntax --opt --turbo --no-always-opt function foo(i, deopt = false, deoptobj = null) { diff --git a/deps/v8/test/mjsunit/deopt-unlinked.js b/deps/v8/test/mjsunit/deopt-unlinked.js index a1f8e72ddb..e7374da543 100644 --- a/deps/v8/test/mjsunit/deopt-unlinked.js +++ b/deps/v8/test/mjsunit/deopt-unlinked.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 --crankshaft --turbo --no-always-opt +// Flags: --allow-natives-syntax --opt --turbo --no-always-opt function foo() {} diff --git a/deps/v8/test/mjsunit/deopt-with-fp-regs.js b/deps/v8/test/mjsunit/deopt-with-fp-regs.js index 7591f0358d..bdb08053ae 100644 --- a/deps/v8/test/mjsunit/deopt-with-fp-regs.js +++ b/deps/v8/test/mjsunit/deopt-with-fp-regs.js @@ -25,7 +25,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// Flags: --allow-natives-syntax --crankshaft --no-always-opt +// Flags: --allow-natives-syntax --opt --no-always-opt deopt_trigger = 0; side_effect = 0; diff --git a/deps/v8/test/mjsunit/deserialize-optimize-inner.js b/deps/v8/test/mjsunit/deserialize-optimize-inner.js index bbd3875b55..ca78b8a4b0 100644 --- a/deps/v8/test/mjsunit/deserialize-optimize-inner.js +++ b/deps/v8/test/mjsunit/deserialize-optimize-inner.js @@ -2,8 +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 --cache=code --no-lazy --serialize-inner -// Flags: --crankshaft +// Flags: --allow-natives-syntax --cache=code --no-lazy --opt function f(x, y) { return x + y; } diff --git a/deps/v8/test/mjsunit/dictionary-properties.js b/deps/v8/test/mjsunit/dictionary-properties.js index 33360d7f52..cffa48547e 100644 --- a/deps/v8/test/mjsunit/dictionary-properties.js +++ b/deps/v8/test/mjsunit/dictionary-properties.js @@ -11,6 +11,7 @@ function SlowObject() { this.foo = 1; this.bar = 2; this.qux = 3; + this.z = 4; delete this.qux; assertFalse(%HasFastProperties(this)); } @@ -38,6 +39,7 @@ function SlowPrototype() { } SlowPrototype.prototype.bar = 2; SlowPrototype.prototype.baz = 3; +SlowPrototype.prototype.z = 4; delete SlowPrototype.prototype.baz; assertFalse(%HasFastProperties(SlowPrototype.prototype)); var slow_proto = new SlowPrototype; diff --git a/deps/v8/test/mjsunit/div-mul-minus-one.js b/deps/v8/test/mjsunit/div-mul-minus-one.js index c7643ae262..71ad299610 100644 --- a/deps/v8/test/mjsunit/div-mul-minus-one.js +++ b/deps/v8/test/mjsunit/div-mul-minus-one.js @@ -25,7 +25,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// Flags: --allow-natives-syntax --crankshaft +// Flags: --allow-natives-syntax --opt function div(g) { return (g/-1) ^ 1 diff --git a/deps/v8/test/mjsunit/element-read-only.js b/deps/v8/test/mjsunit/element-read-only.js index 9ec027f6cc..dcc7e421b6 100644 --- a/deps/v8/test/mjsunit/element-read-only.js +++ b/deps/v8/test/mjsunit/element-read-only.js @@ -2,17 +2,23 @@ // 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 f(a, b, c, d) { return arguments; } // Ensure non-configurable argument elements stay non-configurable. (function () { var args = f(1); Object.defineProperty(args, "0", {value: 10, configurable: false}); + %HeapObjectVerify(args); assertFalse(Object.getOwnPropertyDescriptor(args, "0").configurable); + %HeapObjectVerify(args); for (var i = 0; i < 10; i++) { args[i] = 1; } + %HeapObjectVerify(args); assertFalse(Object.getOwnPropertyDescriptor(args, "0").configurable); + %HeapObjectVerify(args); })(); // Ensure read-only properties on the prototype chain cause TypeError. @@ -27,7 +33,11 @@ function f(a, b, c, d) { return arguments; } for (var i = 0; i < index; i++) { store(o, i, 0); } + %HeapObjectVerify(proto); + %HeapObjectVerify(o); Object.defineProperty(proto, index, {value: 100, writable: false}); + %HeapObjectVerify(proto); + %HeapObjectVerify(o); assertThrows(function() { store(o, index, 0); }); assertEquals(100, o[index]); })(); @@ -42,7 +52,11 @@ function f(a, b, c, d) { return arguments; } for (var i = 0; i < index; i++) { store(o, i, 0); } + %HeapObjectVerify(proto); + %HeapObjectVerify(o); Object.defineProperty(proto, index, {value: 100, writable: false}); + %HeapObjectVerify(proto); + %HeapObjectVerify(o); assertThrows(function() { store(o, index, 0); }); assertEquals(100, o[index]); })(); @@ -57,7 +71,11 @@ function f(a, b, c, d) { return arguments; } for (var i = 0; i < index; i++) { store(o, i, 0); } + %HeapObjectVerify(proto); + %HeapObjectVerify(o); Object.defineProperty(proto, index, {value: 100, writable: false}); + %HeapObjectVerify(proto); + %HeapObjectVerify(o); assertThrows(function() { store(o, index, 0); }); assertEquals(100, o[index]); })(); @@ -72,7 +90,11 @@ function f(a, b, c, d) { return arguments; } for (var i = 0; i < index; i++) { store(o, i, 0); } + %HeapObjectVerify(proto); + %HeapObjectVerify(o); Object.defineProperty(proto, index, {value: 100, writable: false}); + %HeapObjectVerify(proto); + %HeapObjectVerify(o); assertThrows(function() { store(o, index, 0); }); assertEquals(100, o[index]); })(); @@ -87,12 +109,17 @@ function f(a, b, c, d) { return arguments; } for (var i = 0; i < index; i++) { store(o, i, 0); } + %HeapObjectVerify(proto); + %HeapObjectVerify(o); Object.preventExtensions(proto); + %HeapObjectVerify(proto); + %HeapObjectVerify(o); Object.defineProperty(proto, index, {value: 100, writable: false}); + %HeapObjectVerify(proto); + %HeapObjectVerify(o); assertThrows(function() { store(o, index, 0); }); assertEquals(100, o[index]); })(); - // Extensions prevented arguments object. (function () { var o = []; @@ -103,8 +130,14 @@ function f(a, b, c, d) { return arguments; } for (var i = 0; i < index; i++) { store(o, i, 0); } + %HeapObjectVerify(proto); + %HeapObjectVerify(o); Object.preventExtensions(proto); + %HeapObjectVerify(proto); + %HeapObjectVerify(o); Object.defineProperty(proto, index, {value: 100, writable: false}); + %HeapObjectVerify(proto); + %HeapObjectVerify(o); assertThrows(function() { store(o, index, 0); }); assertEquals(100, o[index]); })(); @@ -120,7 +153,11 @@ function f(a, b, c, d) { return arguments; } store(o, i, 0); } proto[1 << 30] = 1; + %HeapObjectVerify(proto); + %HeapObjectVerify(o); Object.defineProperty(proto, index, {value: 100, writable: false}); + %HeapObjectVerify(proto); + %HeapObjectVerify(o); assertThrows(function() { store(o, index, 0); }); assertEquals(100, o[index]); })(); @@ -134,7 +171,11 @@ function f(a, b, c, d) { return arguments; } for (var i = 0; i < 3; i++) { store(o, i, 0); } + %HeapObjectVerify(proto); + %HeapObjectVerify(o); Object.freeze(proto); + %HeapObjectVerify(proto); + %HeapObjectVerify(o); assertThrows(function() { store(o, 3, 0); }); assertEquals(3, o[3]); })(); @@ -148,7 +189,11 @@ function f(a, b, c, d) { return arguments; } for (var i = 0; i < 3; i++) { store(o, i, 0); } + %HeapObjectVerify(proto); + %HeapObjectVerify(o); Object.freeze(proto); + %HeapObjectVerify(proto); + %HeapObjectVerify(o); assertThrows(function() { store(o, 3, 0); }); assertEquals(3, o[3]); })(); diff --git a/deps/v8/test/mjsunit/elements-transition-hoisting.js b/deps/v8/test/mjsunit/elements-transition-hoisting.js index db5b24f6a0..2b67b62b92 100644 --- a/deps/v8/test/mjsunit/elements-transition-hoisting.js +++ b/deps/v8/test/mjsunit/elements-transition-hoisting.js @@ -26,7 +26,7 @@ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // Flags: --allow-natives-syntax -// Flags: --nostress-opt --crankshaft +// Flags: --nostress-opt --opt // Ensure that ElementsKind transitions in various situations are hoisted (or // not hoisted) correctly, don't change the semantics programs and don't trigger diff --git a/deps/v8/test/mjsunit/ensure-growing-store-learns.js b/deps/v8/test/mjsunit/ensure-growing-store-learns.js index 659ff0d66e..7cb8aaa8ba 100644 --- a/deps/v8/test/mjsunit/ensure-growing-store-learns.js +++ b/deps/v8/test/mjsunit/ensure-growing-store-learns.js @@ -3,7 +3,7 @@ // found in the LICENSE file. // Flags: --allow-natives-syntax --noverify-heap --noenable-slow-asserts -// Flags: --crankshaft --no-always-opt +// Flags: --opt --no-always-opt // --noverify-heap and --noenable-slow-asserts are set because the test is too // slow with it on. @@ -65,11 +65,11 @@ assertTrue(%HasFastSmiElements(a)); // Grow a large array into large object space through the keyed store - // without deoptimizing. Grow by 10s. If we set elements too sparsely, the + // without deoptimizing. Grow by 9s. If we set elements too sparsely, the // array will convert to dictionary mode. a = new Array(99999); assertTrue(%HasFastSmiElements(a)); - for (var i = 0; i < 263000; i += 10) { + for (var i = 0; i < 263000; i += 9) { foo2(a, i); } diff --git a/deps/v8/test/mjsunit/es6/array-iterator-turbo.js b/deps/v8/test/mjsunit/es6/array-iterator-turbo.js index def018eea2..c9182f89e0 100644 --- a/deps/v8/test/mjsunit/es6/array-iterator-turbo.js +++ b/deps/v8/test/mjsunit/es6/array-iterator-turbo.js @@ -3,7 +3,7 @@ // found in the LICENSE file. // Flags: --turbo --turbo-escape --allow-natives-syntax --no-always-opt -// Flags: --crankshaft --turbo-filter=* +// Flags: --opt --turbo-filter=* "use strict"; @@ -43,13 +43,15 @@ let tests = { return sum; }, - FAST_HOLEY_DOUBLE_ELEMENTS(array) { + // TODO(6587): Re-enable the below test case once we no longer deopt due + // to non-truncating uses of {CheckFloat64Hole} nodes. + /*FAST_HOLEY_DOUBLE_ELEMENTS(array) { let sum = 0.0; for (let x of array) { if (x) sum += x; } return sum; - } + }*/ }; let tests = { @@ -84,12 +86,14 @@ let tests = { array2: [0.6, 0.4, 0.2], expected2: 1.2 }, - FAST_HOLEY_DOUBLE_ELEMENTS: { + // TODO(6587): Re-enable the below test case once we no longer deopt due + // to non-truncating uses of {CheckFloat64Hole} nodes. + /*FAST_HOLEY_DOUBLE_ELEMENTS: { array: [0.1, , 0.3, , 0.5, , 0.7, , 0.9, ,], expected: 2.5, array2: [0.1, , 0.3], expected2: 0.4 - } + }*/ }; for (let key of Object.keys(runners)) { @@ -102,29 +106,13 @@ let tests = { %OptimizeFunctionOnNextCall(fn); fn(array); - // TODO(bmeurer): FAST_HOLEY_DOUBLE_ELEMENTS maps generally deopt when - // a hole is encountered. Test should be fixed once that is corrected. - let expect_deopt = /HOLEY_DOUBLE/.test(key); - - if (expect_deopt) { - assertUnoptimized(fn, '', key); - } else { - assertOptimized(fn, '', key); - } + assertOptimized(fn, '', key); assertEquals(expected, fn(array), key); - if (expect_deopt) { - assertUnoptimized(fn, '', key); - } else { - assertOptimized(fn, '', key); - } + assertOptimized(fn, '', key); // Check no deopt when another array with the same map is used assertTrue(%HaveSameMap(array, array2), key); - if (expect_deopt) { - assertUnoptimized(fn, '', key); - } else { - assertOptimized(fn, '', key); - } + assertOptimized(fn, '', key); assertEquals(expected2, fn(array2), key); // CheckMaps bailout @@ -231,6 +219,10 @@ let tests = { let clone = new array.constructor(array); %ArrayBufferNeuter(clone.buffer); assertThrows(() => sum(clone), TypeError); + + // Clear the slate for the next iteration. + %DeoptimizeFunction(sum); + %ClearFunctionFeedback(sum); } } }; diff --git a/deps/v8/test/mjsunit/es6/block-let-crankshaft-sloppy.js b/deps/v8/test/mjsunit/es6/block-let-crankshaft-sloppy.js index d06153ed8a..5711ac270e 100644 --- a/deps/v8/test/mjsunit/es6/block-let-crankshaft-sloppy.js +++ b/deps/v8/test/mjsunit/es6/block-let-crankshaft-sloppy.js @@ -25,7 +25,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// Flags: --allow-natives-syntax --crankshaft +// Flags: --allow-natives-syntax --opt // Check that the following functions are optimizable. var functions = [ f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, diff --git a/deps/v8/test/mjsunit/es6/block-let-crankshaft.js b/deps/v8/test/mjsunit/es6/block-let-crankshaft.js index 99a8b52968..97de765c8a 100644 --- a/deps/v8/test/mjsunit/es6/block-let-crankshaft.js +++ b/deps/v8/test/mjsunit/es6/block-let-crankshaft.js @@ -25,7 +25,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// Flags: --allow-natives-syntax --crankshaft +// Flags: --allow-natives-syntax --opt "use strict"; diff --git a/deps/v8/test/mjsunit/es6/block-scoping-sloppy.js b/deps/v8/test/mjsunit/es6/block-scoping-sloppy.js index 29eadb17d1..d86eb0794f 100644 --- a/deps/v8/test/mjsunit/es6/block-scoping-sloppy.js +++ b/deps/v8/test/mjsunit/es6/block-scoping-sloppy.js @@ -25,7 +25,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// Flags: --allow-natives-syntax --crankshaft +// Flags: --allow-natives-syntax --opt // Test functionality of block scopes. // Hoisting of var declarations. diff --git a/deps/v8/test/mjsunit/es6/block-scoping.js b/deps/v8/test/mjsunit/es6/block-scoping.js index ec13592977..9fa22cddc3 100644 --- a/deps/v8/test/mjsunit/es6/block-scoping.js +++ b/deps/v8/test/mjsunit/es6/block-scoping.js @@ -25,7 +25,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// Flags: --allow-natives-syntax --crankshaft +// Flags: --allow-natives-syntax --opt // Test functionality of block scopes. "use strict"; diff --git a/deps/v8/test/mjsunit/es6/destructuring-assignment.js b/deps/v8/test/mjsunit/es6/destructuring-assignment.js index df9bb0e8c6..579c87718b 100644 --- a/deps/v8/test/mjsunit/es6/destructuring-assignment.js +++ b/deps/v8/test/mjsunit/es6/destructuring-assignment.js @@ -478,3 +478,93 @@ assertEquals(oz, [1, 2, 3, 4, 5]); { firstLetter: "B", rest: ["p", "u", "p", "p", "y"] }, ], log); })(); + +(function testNewTarget() { + assertThrows("(function() { [...new.target] = []; })", SyntaxError); + assertThrows("(function() { [a] = [...new.target] = []; })", SyntaxError); + assertThrows("(function() { [new.target] = []; })", SyntaxError); + assertThrows("(function() { [a] = [new.target] = []; })", SyntaxError); + assertThrows("(function() { ({ a: new.target] = {a: 0}); })", SyntaxError); + assertThrows("(function() { ({ a } = { a: new.target } = {}); })", + SyntaxError); + + function ReturnNewTarget1() { + var result; + [result = new.target] = []; + return result; + } + + function ReturnNewTarget2() { + var result; + [result] = [new.target]; + return result; + } + + function ReturnNewTarget3() { + var result; + ({ result = new.target } = {}); + return result; + } + + function ReturnNewTarget4() { + var result; + ({ result } = { result: new.target }); + return result; + } + + function FakeNewTarget() {} + assertEquals(undefined, ReturnNewTarget1()); + assertEquals(ReturnNewTarget1, new ReturnNewTarget1()); + assertEquals(FakeNewTarget, + Reflect.construct(ReturnNewTarget1, [], FakeNewTarget)); + + assertEquals(undefined, ReturnNewTarget2()); + assertEquals(ReturnNewTarget2, new ReturnNewTarget2()); + assertEquals(FakeNewTarget, + Reflect.construct(ReturnNewTarget2, [], FakeNewTarget)); + + assertEquals(undefined, ReturnNewTarget3()); + assertEquals(ReturnNewTarget3, new ReturnNewTarget3()); + assertEquals(FakeNewTarget, + Reflect.construct(ReturnNewTarget3, [], FakeNewTarget)); + + assertEquals(undefined, ReturnNewTarget4()); + assertEquals(ReturnNewTarget4, new ReturnNewTarget4()); + assertEquals(FakeNewTarget, + Reflect.construct(ReturnNewTarget4, [], FakeNewTarget)); +})(); + +(function testSuperCall() { + function ctor(body) { + return () => eval("(class extends Object { \n" + + " constructor() {\n" + + body + + "\n }\n" + + "})"); + } + assertThrows(ctor("({ new: super() } = {})"), SyntaxError); + assertThrows(ctor("({ new: x } = { new: super() } = {})"), SyntaxError); + assertThrows(ctor("[super()] = []"), SyntaxError); + assertThrows(ctor("[x] = [super()] = []"), SyntaxError); + assertThrows(ctor("[...super()] = []"), SyntaxError); + assertThrows(ctor("[x] = [...super()] = []"), SyntaxError); + + class Base { get foo() { return 1; } } + function ext(body) { + return eval("new (class extends Base {\n" + + " constructor() {\n" + + body + ";\n" + + " return { x: super.foo }" + + "\n }\n" + + "})"); + } + assertEquals(1, ext("let x; [x = super()] = []").x); + assertEquals(1, ext("let x, y; [y] = [x = super()] = []").x); + assertEquals(1, ext("let x; [x] = [super()]").x); + assertEquals(1, ext("let x, y; [y] = [x] = [super()]").x); + + assertEquals(1, ext("let x; ({x = super()} = {})").x); + assertEquals(1, ext("let x, y; ({ x: y } = { x = super() } = {})").x); + assertEquals(1, ext("let x; ({x} = { x: super() })").x); + assertEquals(1, ext("let x, y; ({ x: y } = { x } = { x: super() })").x); +})(); diff --git a/deps/v8/test/mjsunit/es6/regress/regress-6322.js b/deps/v8/test/mjsunit/es6/regress/regress-6322.js new file mode 100644 index 0000000000..41f66171ed --- /dev/null +++ b/deps/v8/test/mjsunit/es6/regress/regress-6322.js @@ -0,0 +1,6 @@ +// 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. + +// Crash with --verify-heap +(function*() { for (let { a = class b { } } of [{}]) { } })().next(); diff --git a/deps/v8/test/mjsunit/es6/rest-params-lazy-parsing.js b/deps/v8/test/mjsunit/es6/rest-params-lazy-parsing.js index c9b81661dc..271ddf3c4a 100644 --- a/deps/v8/test/mjsunit/es6/rest-params-lazy-parsing.js +++ b/deps/v8/test/mjsunit/es6/rest-params-lazy-parsing.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: --min-preparse-length=0 - function variadic(co, ...values) { var sum = 0; while (values.length) { diff --git a/deps/v8/test/mjsunit/es6/string-replace.js b/deps/v8/test/mjsunit/es6/string-replace.js index 0beb57a536..16cadc5369 100644 --- a/deps/v8/test/mjsunit/es6/string-replace.js +++ b/deps/v8/test/mjsunit/es6/string-replace.js @@ -3,7 +3,8 @@ // found in the LICENSE file. var pattern = { - [Symbol.replace]: (string, newValue) => string + newValue + [Symbol.replace]: (string, newValue) => string + newValue, + toString: () => "c" }; // Check object coercible fails. assertThrows(() => String.prototype.replace.call(null, pattern, "x"), @@ -13,5 +14,8 @@ assertEquals("abcdex", "abcde".replace(pattern, "x")); // Non-callable override. pattern[Symbol.replace] = "dumdidum"; assertThrows(() => "abcde".replace(pattern, "x"), TypeError); +// Null override. +pattern[Symbol.replace] = null; +assertEquals("abXde", "abcde".replace(pattern, "X")); assertEquals("[Symbol.replace]", RegExp.prototype[Symbol.replace].name); diff --git a/deps/v8/test/mjsunit/es6/string-split.js b/deps/v8/test/mjsunit/es6/string-split.js index 8ca655cad9..c21f9d3d94 100644 --- a/deps/v8/test/mjsunit/es6/string-split.js +++ b/deps/v8/test/mjsunit/es6/string-split.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. -var pattern = {}; +var pattern = {toString: () => ""}; var limit = { value: 3 }; pattern[Symbol.split] = function(string, limit) { return string.length * limit.value; @@ -15,5 +15,8 @@ assertEquals(15, "abcde".split(pattern, limit)); // Non-callable override. pattern[Symbol.split] = "dumdidum"; assertThrows(() => "abcde".split(pattern, limit), TypeError); +// Null override. +pattern[Symbol.split] = null; +assertEquals(["a", "b", "c", "d", "e"], "abcde".split(pattern)); assertEquals("[Symbol.split]", RegExp.prototype[Symbol.split].name); diff --git a/deps/v8/test/mjsunit/es6/typedarray-construct-by-array-like-prototype-element-added.js b/deps/v8/test/mjsunit/es6/typedarray-construct-by-array-like-prototype-element-added.js new file mode 100644 index 0000000000..edcba43b52 --- /dev/null +++ b/deps/v8/test/mjsunit/es6/typedarray-construct-by-array-like-prototype-element-added.js @@ -0,0 +1,32 @@ +// 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: --allow-natives-syntax + +(function() { + var arr = [0, 1, , 3]; + Array.prototype[2] = 2; + + var constructors = [ + Uint8Array, + Int8Array, + Uint16Array, + Int16Array, + Uint32Array, + Int32Array, + Float32Array, + Float64Array, + Uint8ClampedArray + ]; + + for (var constr of constructors) { + var ta = new constr(arr); + assertArrayEquals([0, 1, 2, 3], ta); + } +})(); + +(function testTypedArrayConstructByArrayLikeInvalidArrayProtector() { + Array.prototype[2] = undefined; + load("test/mjsunit/es6/typedarray-construct-by-array-like.js"); +})(); diff --git a/deps/v8/test/mjsunit/es6/typedarray-construct-by-array-like.js b/deps/v8/test/mjsunit/es6/typedarray-construct-by-array-like.js index 6f3e961a27..7d17812a8d 100644 --- a/deps/v8/test/mjsunit/es6/typedarray-construct-by-array-like.js +++ b/deps/v8/test/mjsunit/es6/typedarray-construct-by-array-like.js @@ -4,7 +4,11 @@ // Flags: --allow-natives-syntax -function TestConstructSmallObject(constr) { +var tests = []; + +// Tests that will be called with each TypedArray constructor. + +tests.push(function TestConstructSmallObject(constr) { var myObject = { 0: 5, 1: 6, length: 2 }; arr = new constr(myObject); @@ -12,9 +16,9 @@ function TestConstructSmallObject(constr) { assertEquals(2, arr.length); assertEquals(5, arr[0]); assertEquals(6, arr[1]); -}; +}); -function TestConstructLargeObject(constr) { +tests.push(function TestConstructLargeObject(constr) { var myObject = {}; const n = 128; for (var i = 0; i < n; i++) { @@ -28,18 +32,18 @@ function TestConstructLargeObject(constr) { for (var i = 0; i < n; i++) { assertEquals(i, arr[i]); } -} +}); -function TestConstructFromArrayWithSideEffects(constr) { +tests.push(function TestConstructFromArrayWithSideEffects(constr) { var arr = [{ valueOf() { arr[1] = 20; return 1; }}, 2]; var ta = new constr(arr); assertEquals(1, ta[0]); assertEquals(2, ta[1]); -} +}); -function TestConstructFromArrayWithSideEffectsHoley(constr) { +tests.push(function TestConstructFromArrayWithSideEffectsHoley(constr) { var arr = [{ valueOf() { arr[1] = 20; return 1; }}, 2, , 4]; var ta = new constr(arr); @@ -48,10 +52,75 @@ function TestConstructFromArrayWithSideEffectsHoley(constr) { assertEquals(2, ta[1]); // ta[2] will be the default value, but we aren't testing that here. assertEquals(4, ta[3]); -} +}); + +tests.push(function TestConstructFromArrayHoleySmi(constr) { + var arr = [0, 1, , 3]; + + var ta = new constr(arr); + + assertArrayEquals([0, 1, defaultValue(constr), 3], ta); +}); + +tests.push(function TestConstructFromArrayHoleyDouble(constr) { + var arr = [0.0, 1.0, , 3.0]; + + var ta = new constr(arr); + + assertArrayEquals([0, 1, defaultValue(constr), 3], ta); +}); + +tests.push(function TestConstructFromArrayHoleySmiWithOtherPrototype(constr) { + var arr = [0, 1, , 3]; + Object.setPrototypeOf(arr, { 2: 2 }); + + var ta = new constr(arr); + + assertArrayEquals([0, 1, 2, 3], ta); +}); +tests.push(function TestConstructFromArrayWithProxyPrototype(constr) { + var arr = [0, 1, , 3]; + var proxy = new Proxy([], { + get: function(target, name) { + if (name === Symbol.iterator) return undefined; + if (name == 2) return 2; + return target[name]; + } + }); + Object.setPrototypeOf(arr, proxy); -function TestConstructFromArray(constr) { + var ta = new constr(arr); + + assertArrayEquals([0, 1, 2, 3], ta); +}); + +tests.push(function TestConstructFromArrayHoleySmiWithSubclass(constr) { + class SubArray extends Array {} + var arr = new SubArray(0, 1); + arr[3] = 3; + + var ta = new constr(arr); + + assertArrayEquals([0, 1, defaultValue(constr), 3], ta); +}); + +tests.push(function TestConstructFromArrayNoIteratorWithGetter(constr) { + var arr = [1, 2, 3]; + arr[Symbol.iterator] = undefined; + + Object.defineProperty(arr, "2", { + get() { + return 22; + } + }); + + var ta = new constr(arr); + + assertArrayEquals([1, 2, 22], ta); +}); + +tests.push(function TestConstructFromArray(constr) { var n = 64; var jsArray = []; for (var i = 0; i < n; i++) { @@ -64,9 +133,9 @@ function TestConstructFromArray(constr) { for (var i = 0; i < n; i++) { assertEquals(i, arr[i]); } -} +}); -function TestConstructFromTypedArray(constr) { +tests.push(function TestConstructFromTypedArray(constr) { var n = 64; var ta = new constr(n); for (var i = 0; i < ta.length; i++) { @@ -79,15 +148,55 @@ function TestConstructFromTypedArray(constr) { for (var i = 0; i < n; i++) { assertEquals(i, arr[i]); } -} +}); -function TestLengthIsMaxSmi(constr) { +tests.push(function TestLengthIsMaxSmi(constr) { var myObject = { 0: 5, 1: 6, length: %_MaxSmi() + 1 }; assertThrows(function() { new constr(myObject); }, RangeError); -} +}); + +tests.push(function TestProxyHoleConverted(constr) { + var source = {0: 0, 2: 2, length: 3}; + var proxy = new Proxy(source, {}); + + var converted = new constr(proxy); + + assertArrayEquals([0, defaultValue(constr), 2], converted); +}); + +tests.push(function TestProxyToObjectValueOfCalled(constr) { + var thrower = { valueOf: function() { throw new TypeError(); } }; + var source = {0: 0, 1: thrower, length: 2}; + var proxy = new Proxy(source, {}); + + assertThrows(() => new constr(proxy), TypeError); +}); + +tests.push(function TestObjectValueOfCalled(constr) { + var thrower = { valueOf: function() { throw new TypeError(); } }; + + var obj = {0: 0, 1: thrower, length: 2}; + assertThrows(() => new constr(obj), TypeError); +}); + +tests.push(function TestSmiPackedArray(constr) { + var ta = new constr([1, 2, 3, 4, 127]); + + assertEquals(5 * constr.BYTES_PER_ELEMENT, ta.byteLength); + assertArrayEquals([1, 2, 3, 4, 127], ta); +}); + +tests.push(function TestOffsetIsUsed(constr) { + TestOffsetIsUsedRunner(constr, 4); + TestOffsetIsUsedRunner(constr, 16); + TestOffsetIsUsedRunner(constr, 32); + TestOffsetIsUsedRunner(constr, 128); +}); + +// Helpers for above tests. function TestOffsetIsUsedRunner(constr, n) { var buffer = new ArrayBuffer(constr.BYTES_PER_ELEMENT * n); @@ -109,21 +218,13 @@ function TestOffsetIsUsedRunner(constr, n) { } } -function TestOffsetIsUsed(constr, n) { - TestOffsetIsUsedRunner(constr, 4); - TestOffsetIsUsedRunner(constr, 16); - TestOffsetIsUsedRunner(constr, 32); - TestOffsetIsUsedRunner(constr, 128); +function defaultValue(constr) { + if (constr == Float32Array || constr == Float64Array) return NaN; + return 0; } -Test(TestConstructSmallObject); -Test(TestConstructLargeObject); -Test(TestConstructFromArrayWithSideEffects); -Test(TestConstructFromArrayWithSideEffectsHoley); -Test(TestConstructFromArray); -Test(TestConstructFromTypedArray); -Test(TestLengthIsMaxSmi); -Test(TestOffsetIsUsed); +tests.forEach(f => Test(f)); + function Test(func) { func(Uint8Array); @@ -136,3 +237,43 @@ function Test(func) { func(Float64Array); func(Uint8ClampedArray); } + +// Other, standalone tests. + +(function TestUint8ClampedIsNotBitCopied() { + var arr = new Int8Array([-1.0, 0, 1.1, 255, 256]); + assertArrayEquals([-1, 0, 1, -1, 0], arr); + var expected = new Uint8ClampedArray([0, 0, 1, 0, 0]); + + var converted = new Uint8ClampedArray(arr); + + assertArrayEquals([0, 0, 1, 0, 0], converted); +})(); + +(function TestInt8ArrayCopying() { + var source = new Uint8Array([0, 1, 127, 128, 255, 256]); + assertArrayEquals([0, 1, 127, 128, 255, 0], source); + + var converted = new Int8Array(source); + + assertArrayEquals([0, 1, 127, -128, -1, 0], converted); +})(); + +(function TestInt16ArrayCopying() { + var source = new Uint16Array([0, 1, 32767, 32768, 65535, 65536]); + assertArrayEquals([0, 1, 32767, 32768, 65535, 0], source); + + var converted = new Int16Array(source); + + assertArrayEquals([0, 1, 32767, -32768, -1, 0], converted); +})(); + +(function TestInt32ArrayCopying() { + var source = + new Uint32Array([0, 1, 2147483647, 2147483648, 4294967295, 4294967296]); + assertArrayEquals([0, 1, 2147483647, 2147483648, 4294967295, 0], source); + + var converted = new Int32Array(source); + + assertArrayEquals([0, 1, 2147483647, -2147483648, -1, 0], converted); +})(); diff --git a/deps/v8/test/mjsunit/es6/typedarray-construct-offset-not-smi.js b/deps/v8/test/mjsunit/es6/typedarray-construct-offset-not-smi.js index 27beb762dc..0a267bc64b 100644 --- a/deps/v8/test/mjsunit/es6/typedarray-construct-offset-not-smi.js +++ b/deps/v8/test/mjsunit/es6/typedarray-construct-offset-not-smi.js @@ -2,18 +2,13 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Flags: --allow-natives-syntax +// Flags: --allow-natives-syntax --mock-arraybuffer-allocator (function TestBufferByteLengthNonSmi() { var non_smi_byte_length = %_MaxSmi() + 1; - try { - var buffer = new ArrayBuffer(non_smi_byte_length); - } catch (e) { - // The ArrayBuffer allocation can fail on 32-bit archs, so no need to try to - // construct the typed array. - return; - } + var buffer = new ArrayBuffer(non_smi_byte_length); + var arr = new Uint16Array(buffer); assertEquals(non_smi_byte_length, arr.byteLength); @@ -26,33 +21,17 @@ (function TestByteOffsetNonSmi() { var non_smi_byte_length = %_MaxSmi() + 11; - try { - var buffer = new ArrayBuffer(non_smi_byte_length); - } catch (e) { - // The ArrayBuffer allocation can fail on 32-bit archs, so no need to try to - // construct the typed array. - return; - } - print(buffer.byteLength); + + var buffer = new ArrayBuffer(non_smi_byte_length); + var whole = new Uint16Array(buffer); - whole[non_smi_byte_length / 2 - 1] = 1; - whole[non_smi_byte_length / 2 - 2] = 2; - whole[non_smi_byte_length / 2 - 3] = 3; - whole[non_smi_byte_length / 2 - 4] = 4; - whole[non_smi_byte_length / 2 - 5] = 5; + assertEquals(non_smi_byte_length, whole.byteLength); assertEquals(non_smi_byte_length / 2, whole.length); - assertEquals(1, whole[non_smi_byte_length / 2 - 1]); var arr = new Uint16Array(buffer, non_smi_byte_length - 10, 5); assertEquals(non_smi_byte_length, arr.buffer.byteLength); assertEquals(10, arr.byteLength); assertEquals(5, arr.length); - - assertEquals(5, arr[0]); - assertEquals(4, arr[1]); - assertEquals(3, arr[2]); - assertEquals(2, arr[3]); - assertEquals(1, arr[4]); })(); diff --git a/deps/v8/test/mjsunit/es6/typedarray-copywithin.js b/deps/v8/test/mjsunit/es6/typedarray-copywithin.js index 1e63508393..c52a38625b 100644 --- a/deps/v8/test/mjsunit/es6/typedarray-copywithin.js +++ b/deps/v8/test/mjsunit/es6/typedarray-copywithin.js @@ -240,8 +240,6 @@ CheckEachTypedArray(function parametersNotCalledIfDetached(constructor) { var array = new constructor([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]); %ArrayBufferNeuter(array.buffer); - // TODO(caitp): this should throw due to being invoked on a TypedArray with a - // detached buffer (per v8:4648). - array.copyWithin(tmp, tmp, tmp); + assertThrows(() => array.copyWithin(tmp, tmp, tmp), TypeError); assertEquals(0, array.length, "array.[[ViewedArrayBuffer]] is detached"); }); diff --git a/deps/v8/test/mjsunit/es6/typedarray-every.js b/deps/v8/test/mjsunit/es6/typedarray-every.js index 4ceee5f3aa..a3498f5786 100644 --- a/deps/v8/test/mjsunit/es6/typedarray-every.js +++ b/deps/v8/test/mjsunit/es6/typedarray-every.js @@ -159,6 +159,11 @@ function TestTypedArrayForEach(constructor) { assertEquals(Array.prototype.every.call(a, function(elt) { x += elt; return true; }), true); assertEquals(x, 4); + + // Detached Operation + var array = new constructor([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]); + %ArrayBufferNeuter(array.buffer); + assertThrows(() => array.every(() => true), TypeError); } for (i = 0; i < typedArrayConstructors.length; i++) { diff --git a/deps/v8/test/mjsunit/es6/typedarray-fill.js b/deps/v8/test/mjsunit/es6/typedarray-fill.js index 260e5ab08a..9ed220373b 100644 --- a/deps/v8/test/mjsunit/es6/typedarray-fill.js +++ b/deps/v8/test/mjsunit/es6/typedarray-fill.js @@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +// Flags: --allow-natives-syntax + var intArrayConstructors = [ Uint8Array, Int8Array, @@ -67,6 +69,18 @@ for (var constructor of typedArrayConstructors) { assertArrayEquals([3, 3], [a[0], a[1]]); Array.prototype.fill.call(a, 4); assertArrayEquals([4, 3], [a[0], a[1]]); + + // Detached Operation + var tmp = { + [Symbol.toPrimitive]() { + assertUnreachable("Parameter should not be processed when " + + "array.[[ViewedArrayBuffer]] is neutered."); + return 0; + } + }; + var array = new constructor([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]); + %ArrayBufferNeuter(array.buffer); + assertThrows(() => array.fill(tmp), TypeError); } for (var constructor of intArrayConstructors) { diff --git a/deps/v8/test/mjsunit/es6/typedarray-find.js b/deps/v8/test/mjsunit/es6/typedarray-find.js index 69ceedc8b5..6f646e5c80 100644 --- a/deps/v8/test/mjsunit/es6/typedarray-find.js +++ b/deps/v8/test/mjsunit/es6/typedarray-find.js @@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +// Flags: --allow-natives-syntax + var typedArrayConstructors = [ Uint8Array, Int8Array, @@ -184,4 +186,17 @@ assertEquals(Array.prototype.find.call(a, function(elt) { x += elt; return false; }), undefined); assertEquals(x, 4); +// Detached Operation +var tmp = { + [Symbol.toPrimitive]() { + assertUnreachable("Parameter should not be processed when " + + "array.[[ViewedArrayBuffer]] is neutered."); + return 0; + } +}; + +var array = new constructor([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]); +%ArrayBufferNeuter(array.buffer); + +assertThrows(() => array.find(tmp), TypeError); } diff --git a/deps/v8/test/mjsunit/es6/typedarray-findindex.js b/deps/v8/test/mjsunit/es6/typedarray-findindex.js index 51c439203d..7447395e77 100644 --- a/deps/v8/test/mjsunit/es6/typedarray-findindex.js +++ b/deps/v8/test/mjsunit/es6/typedarray-findindex.js @@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +// Flags: --allow-natives-syntax + var typedArrayConstructors = [ Uint8Array, Int8Array, @@ -184,4 +186,15 @@ assertEquals(Array.prototype.findIndex.call(a, function(elt) { x += elt; return false; }), -1); assertEquals(x, 4); +// Detached Operation + var tmp = { + [Symbol.toPrimitive]() { + assertUnreachable("Parameter should not be processed when " + + "array.[[ViewedArrayBuffer]] is neutered."); + return 0; + } + }; + var array = new constructor([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]); + %ArrayBufferNeuter(array.buffer); + assertThrows(() => array.findIndex(tmp), TypeError); } diff --git a/deps/v8/test/mjsunit/es6/typedarray-foreach.js b/deps/v8/test/mjsunit/es6/typedarray-foreach.js index b9789805f6..7a846b1ac7 100644 --- a/deps/v8/test/mjsunit/es6/typedarray-foreach.js +++ b/deps/v8/test/mjsunit/es6/typedarray-foreach.js @@ -148,6 +148,11 @@ function TestTypedArrayForEach(constructor) { assertEquals(Array.prototype.forEach.call(a, function(elt) { x += elt; }), undefined); assertEquals(x, 4); + + // Detached Operation + var array = new constructor([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]); + %ArrayBufferNeuter(array.buffer); + assertThrows(() => array.forEach(() => true), TypeError); } for (i = 0; i < typedArrayConstructors.length; i++) { diff --git a/deps/v8/test/mjsunit/es6/typedarray-indexing.js b/deps/v8/test/mjsunit/es6/typedarray-indexing.js index 1c439f9dda..d12a1570c2 100644 --- a/deps/v8/test/mjsunit/es6/typedarray-indexing.js +++ b/deps/v8/test/mjsunit/es6/typedarray-indexing.js @@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +// Flags: --allow-natives-syntax + var typedArrayConstructors = [ Uint8Array, Int8Array, @@ -14,6 +16,14 @@ var typedArrayConstructors = [ Float64Array ]; +var tmp = { + [Symbol.toPrimitive]() { + assertUnreachable("Parameter should not be processed when " + + "array.[[ViewedArrayBuffer]] is neutered."); + return 0; + } +}; + for (var constructor of typedArrayConstructors) { var array = new constructor([1, 2, 3, 1, 2, 3, 1, 2, 3, 1, 2, 3]); @@ -53,6 +63,11 @@ for (var constructor of typedArrayConstructors) { } assertEquals(-1, array.indexOf(NaN)); + // Detached Operation + var array = new constructor([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]); + %ArrayBufferNeuter(array.buffer); + assertThrows(() => array.indexOf(tmp), TypeError); + // ---------------------------------------------------------------------- // %TypedArray%.prototype.lastIndexOf. // ---------------------------------------------------------------------- @@ -89,4 +104,9 @@ for (var constructor of typedArrayConstructors) { assertEquals(-1, array.lastIndexOf(-Infinity)); } assertEquals(-1, array.lastIndexOf(NaN)); + + // Detached Operation + var array = new constructor([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]); + %ArrayBufferNeuter(array.buffer); + assertThrows(() => array.lastIndexOf(tmp), TypeError); } diff --git a/deps/v8/test/mjsunit/es6/typedarray-iteration.js b/deps/v8/test/mjsunit/es6/typedarray-iteration.js index 9560cbc5df..b423ed0f04 100644 --- a/deps/v8/test/mjsunit/es6/typedarray-iteration.js +++ b/deps/v8/test/mjsunit/es6/typedarray-iteration.js @@ -4,6 +4,8 @@ // Tests for standard TypedArray array iteration functions. +// Flags: --allow-natives-syntax + var typedArrayConstructors = [ Uint8Array, Int8Array, @@ -77,6 +79,11 @@ for (var constructor of typedArrayConstructors) { assertArrayLikeEquals([2], a.filter(function(elt) { return elt == 2; }), constructor); + + // Detached Operation + var array = new constructor([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]); + %ArrayBufferNeuter(array.buffer); + assertThrows(() => array.filter(() => false), TypeError); })(); (function TypedArrayMapTest() { @@ -130,6 +137,11 @@ for (var constructor of typedArrayConstructors) { return NaN; }), constructor); } + + // Detached Operation + var array = new constructor([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]); + %ArrayBufferNeuter(array.buffer); + assertThrows(() => array.map((v) => v), TypeError); })(); // @@ -189,6 +201,11 @@ for (var constructor of typedArrayConstructors) { assertEquals(false, Array.prototype.some.call(a, function(elt) { return elt == 2; })); + + // Detached Operation + var array = new constructor([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]); + %ArrayBufferNeuter(array.buffer); + assertThrows(() => array.some((v) => false), TypeError); })(); } diff --git a/deps/v8/test/mjsunit/es6/typedarray-map.js b/deps/v8/test/mjsunit/es6/typedarray-map.js new file mode 100644 index 0000000000..54b535fd30 --- /dev/null +++ b/deps/v8/test/mjsunit/es6/typedarray-map.js @@ -0,0 +1,49 @@ +// 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: --allow-natives-syntax + +var typedArrayConstructors = [ + Uint8Array, + Int8Array, + Uint16Array, + Int16Array, + Uint32Array, + Int32Array, + Uint8ClampedArray, + Float32Array, + Float64Array]; + +function TestTypedArrayMap(constructor) { + assertEquals(1, constructor.prototype.map.length); + + var target; + + class EscapingArray extends constructor { + constructor(...args) { + super(...args); + target = this; + } + } + + class DetachingArray extends constructor { + static get [Symbol.species]() { + return EscapingArray; + } + } + + assertThrows(function(){ + new DetachingArray(5).map(function(v,i,a){ + print(i); + if (i == 1) { + %ArrayBufferNeuter(target.buffer); + } + }) + }, TypeError); + +} + +for (i = 0; i < typedArrayConstructors.length; i++) { + TestTypedArrayMap(typedArrayConstructors[i]); +} diff --git a/deps/v8/test/mjsunit/es6/typedarray-reduce.js b/deps/v8/test/mjsunit/es6/typedarray-reduce.js index 1fddeca0bc..ba5d7f7a20 100644 --- a/deps/v8/test/mjsunit/es6/typedarray-reduce.js +++ b/deps/v8/test/mjsunit/es6/typedarray-reduce.js @@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +// Flags: --allow-natives-syntax + var typedArrayConstructors = [ Uint8Array, Int8Array, @@ -247,4 +249,18 @@ for (var constructor of typedArrayConstructors) { assertEquals(1, constructor.prototype.reduce.length); assertEquals(1, constructor.prototype.reduceRight.length); + + // Detached Operation + var tmp = { + [Symbol.toPrimitive]() { + assertUnreachable("Parameter should not be processed when " + + "array.[[ViewedArrayBuffer]] is neutered."); + return 0; + } + }; + + var array = new constructor([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]); + %ArrayBufferNeuter(array.buffer); + assertThrows(() => array.reduce(sum, tmp), TypeError); + assertThrows(() => array.reduceRight(sum, tmp), TypeError); } diff --git a/deps/v8/test/mjsunit/es6/typedarray-reverse.js b/deps/v8/test/mjsunit/es6/typedarray-reverse.js index f32813e155..bfeb227c5c 100644 --- a/deps/v8/test/mjsunit/es6/typedarray-reverse.js +++ b/deps/v8/test/mjsunit/es6/typedarray-reverse.js @@ -2,6 +2,8 @@ // 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 ArrayMaker(x) { return x; } @@ -51,4 +53,11 @@ for (var constructor of arrayConstructors) { } assertEquals(0, a.reverse.length); + + // Detached Operation + if (constructor != ArrayMaker) { + var array = new constructor([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]); + %ArrayBufferNeuter(array.buffer); + assertThrows(() => array.reverse(), TypeError); + } } diff --git a/deps/v8/test/mjsunit/es6/typedarray-slice.js b/deps/v8/test/mjsunit/es6/typedarray-slice.js index cddc5bbdec..4fa3b9f21f 100644 --- a/deps/v8/test/mjsunit/es6/typedarray-slice.js +++ b/deps/v8/test/mjsunit/es6/typedarray-slice.js @@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +// Flags: --allow-natives-syntax + var typedArrayConstructors = [ Uint8Array, Int8Array, @@ -67,6 +69,18 @@ for (var constructor of typedArrayConstructors) { assertEquals(3, slice[1]); assertTrue(slice instanceof constructor); + // Detached Operation + var tmp = { + [Symbol.toPrimitive]() { + assertUnreachable("Parameter should not be processed when " + + "array.[[ViewedArrayBuffer]] is neutered."); + return 0; + } + }; + var array = new constructor([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]); + %ArrayBufferNeuter(array.buffer); + assertThrows(() => array.slice(tmp, tmp), TypeError); + // Check that the species array must be a typed array class MyTypedArray extends constructor { static get[Symbol.species]() { diff --git a/deps/v8/test/mjsunit/es6/typedarray-sort.js b/deps/v8/test/mjsunit/es6/typedarray-sort.js index 9051a775d0..b69009b22d 100644 --- a/deps/v8/test/mjsunit/es6/typedarray-sort.js +++ b/deps/v8/test/mjsunit/es6/typedarray-sort.js @@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +// Flags: --allow-natives-syntax + var typedArrayConstructors = [ Uint8Array, Int8Array, @@ -60,4 +62,9 @@ for (var constructor of typedArrayConstructors) { b[0] = 3; b[1] = 2; b[2] = 1; a.sort(); assertArrayLikeEquals(a, [1, 2], constructor); + + // Detached Operation + var array = new constructor([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]); + %ArrayBufferNeuter(array.buffer); + assertThrows(() => array.sort(), TypeError); } diff --git a/deps/v8/test/mjsunit/es6/typedarray-tostring.js b/deps/v8/test/mjsunit/es6/typedarray-tostring.js index 9d49cb1cc9..a1fa9c7665 100644 --- a/deps/v8/test/mjsunit/es6/typedarray-tostring.js +++ b/deps/v8/test/mjsunit/es6/typedarray-tostring.js @@ -5,6 +5,8 @@ // Array's toString should call the object's own join method, if one exists and // is callable. Otherwise, just use the original Object.toString function. +// Flags: --allow-natives-syntax + var typedArrayConstructors = [ Uint8Array, Int8Array, @@ -96,4 +98,11 @@ for (var constructor of typedArrayConstructors) { Number.prototype.toLocaleString = NumberToLocaleString; })(); + + // Detached Operation + var array = new constructor([1, 2, 3]); + %ArrayBufferNeuter(array.buffer); + assertThrows(() => array.join(), TypeError); + assertThrows(() => array.toLocalString(), TypeError); + assertThrows(() => array.toString(), TypeError); } diff --git a/deps/v8/test/mjsunit/es6/typedarray.js b/deps/v8/test/mjsunit/es6/typedarray.js index a483e551a9..dcfc9caa30 100644 --- a/deps/v8/test/mjsunit/es6/typedarray.js +++ b/deps/v8/test/mjsunit/es6/typedarray.js @@ -496,6 +496,16 @@ function TestTypedArraySet() { } } + a = new Uint32Array(); + a.set(''); + assertEquals(0, a.length); + + assertThrows(() => a.set('abc'), RangeError); + + a = new Uint8Array(3); + a.set('123'); + assertArrayEquals([1, 2, 3], a); + var a11 = new Int16Array([1, 2, 3, 4, 0, -1]) var a12 = new Uint16Array(15) a12.set(a11, 3) @@ -579,6 +589,21 @@ function TestTypedArraySet() { assertThrows(function() { a.set(0, 1); }, TypeError); assertEquals(1, a.set.length); + + // Shared buffer that does not overlap. + var buf = new ArrayBuffer(32); + var a101 = new Int8Array(buf, 0, 16); + var b101 = new Uint8Array(buf, 16); + b101[0] = 42; + a101.set(b101); + assertArrayPrefix([42], a101); + + buf = new ArrayBuffer(32); + var a101 = new Int8Array(buf, 0, 16); + var b101 = new Uint8Array(buf, 16); + a101[0] = 42; + b101.set(a101); + assertArrayPrefix([42], b101); } TestTypedArraySet(); diff --git a/deps/v8/test/mjsunit/es8/constructor-returning-primitive.js b/deps/v8/test/mjsunit/es8/constructor-returning-primitive.js new file mode 100644 index 0000000000..1c0e7725be --- /dev/null +++ b/deps/v8/test/mjsunit/es8/constructor-returning-primitive.js @@ -0,0 +1,318 @@ +// 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-restrict-constructor-return + +assertThrows( + () => { + new class { + constructor() { + return 1; + } + }(); + }, + TypeError, + "Class constructors may only return object or undefined" +); + +assertThrows( + () => { + new class { + constructor() { + return 2147483649; + } + }(); + }, + TypeError, + "Class constructors may only return object or undefined" +); + +assertThrows( + () => { + new class { + constructor() { + return true; + } + }(); + }, + TypeError, + "Class constructors may only return object or undefined" +); + +assertThrows( + () => { + new class { + constructor() { + return null; + } + }(); + }, + TypeError, + "Class constructors may only return object or undefined" +); + +assertThrows( + () => { + new class { + constructor() { + return "wat"; + } + }(); + }, + TypeError, + "Class constructors may only return object or undefined" +); + +assertThrows( + () => { + new class { + constructor() { + return Symbol(); + } + }(); + }, + TypeError, + "Class constructors may only return object or undefined" +); + +assertThrows( + () => { + new class { + constructor() { + return 2.2; + } + }(); + }, + TypeError, + "Class constructors may only return object or undefined" +); + +assertThrows( + () => { + new class extends Object { + constructor() { + return 1; + } + }(); + }, + TypeError, + "Class constructors may only return object or undefined" +); + +assertThrows( + () => { + new class extends Object { + constructor() { + return 2147483649; + } + }(); + }, + TypeError, + "Class constructors may only return object or undefined" +); + +assertThrows( + () => { + new class extends Object { + constructor() { + return true; + } + }(); + }, + TypeError, + "Class constructors may only return object or undefined" +); + +assertThrows( + () => { + new class extends Object { + constructor() { + return null; + } + }(); + }, + TypeError, + "Class constructors may only return object or undefined" +); + +assertThrows( + () => { + new class extends Object { + constructor() { + return "wat"; + } + }(); + }, + TypeError, + "Class constructors may only return object or undefined" +); + +assertThrows( + () => { + new class extends Object { + constructor() { + return Symbol(); + } + }(); + }, + TypeError, + "Class constructors may only return object or undefined" +); + +assertThrows( + () => { + new class extends Object { + constructor() { + return 2.2; + } + }(); + }, + TypeError, + "Class constructors may only return object or undefined" +); + +assertThrows( + () => { + new class extends Object { + constructor() {} + }(); + }, + ReferenceError, + "Must call super constructor in derived class before accessing " + + "'this' or returning from derived constructor" +); + +(function() { + let ret_val = { x: 1 }; + let x = new class { + constructor() { + return ret_val; + } + }(); + assertSame(ret_val, x); +})(); + +(function() { + class Foo { + constructor() {} + } + let x = new Foo(); + assertTrue(x instanceof Foo); +})(); + +(function() { + class Foo { + constructor() { + return undefined; + } + } + let x = new Foo(); + assertTrue(x instanceof Foo); +})(); + +(function() { + let ret_val = { x: 1 }; + let x = new class extends Object { + constructor() { + return ret_val; + } + }(); + assertSame(ret_val, x); +})(); + +(function() { + class Foo extends Object { + constructor() { + super(); + return undefined; + } + } + + let x = new Foo(); + assertTrue(x instanceof Foo); +})(); + +(function() { + class Foo extends Object { + constructor() { + super(); + } + } + + let x = new Foo(); + assertTrue(x instanceof Foo); +})(); + +(function() { + function foo() { + return 1; + } + let x = new foo(); + assertTrue(x instanceof foo); +})(); + +(function() { + function foo() { + return 2147483649; + } + let x = new foo(); + assertTrue(x instanceof foo); +})(); + +(function() { + function foo() { + return true; + } + let x = new foo(); + assertTrue(x instanceof foo); +})(); + +(function() { + function foo() { + return undefined; + } + let x = new foo(); + assertTrue(x instanceof foo); +})(); + +(function() { + function foo() { + return null; + } + let x = new foo(); + assertTrue(x instanceof foo); +})(); + +(function() { + function foo() { + return "wat"; + } + let x = new foo(); + assertTrue(x instanceof foo); +})(); + +(function() { + function foo() { + return Symbol(); + } + let x = new foo(); + assertTrue(x instanceof foo); +})(); + +(function() { + function foo() { + return 2.2; + } + let x = new foo(); + assertTrue(x instanceof foo); +})(); + +(function() { + var ret_val = { x: 1 }; + function foo() { + return ret_val; + } + let x = new foo(); + assertSame(x, ret_val); +})(); diff --git a/deps/v8/test/mjsunit/field-type-tracking.js b/deps/v8/test/mjsunit/field-type-tracking.js index e6b19b9bbc..2e0cb8bd6f 100644 --- a/deps/v8/test/mjsunit/field-type-tracking.js +++ b/deps/v8/test/mjsunit/field-type-tracking.js @@ -3,7 +3,7 @@ // found in the LICENSE file. // Flags: --allow-natives-syntax --nostress-opt --track-field-types -// Flags: --crankshaft --no-always-opt +// Flags: --opt --no-always-opt (function() { var o = { text: "Hello World!" }; diff --git a/deps/v8/test/mjsunit/fixed-context-shapes-when-recompiling.js b/deps/v8/test/mjsunit/fixed-context-shapes-when-recompiling.js index b78b5562bf..8221665ccb 100644 --- a/deps/v8/test/mjsunit/fixed-context-shapes-when-recompiling.js +++ b/deps/v8/test/mjsunit/fixed-context-shapes-when-recompiling.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: --min-preparse-length=1 --allow-natives-syntax --lazy-inner-functions +// Flags: --allow-natives-syntax --lazy-inner-functions // Test that the information on which variables to allocate in context doesn't // change when recompiling. diff --git a/deps/v8/test/mjsunit/function-arguments-duplicate.js b/deps/v8/test/mjsunit/function-arguments-duplicate.js index 80f03a106b..a0ec37ca10 100644 --- a/deps/v8/test/mjsunit/function-arguments-duplicate.js +++ b/deps/v8/test/mjsunit/function-arguments-duplicate.js @@ -27,10 +27,14 @@ // Execises ArgumentsAccessStub::GenerateNewNonStrictSlow. +// Flags: --allow-natives-syntax + function f(a, a) { assertEquals(2, a); assertEquals(1, arguments[0]); assertEquals(2, arguments[1]); + assertEquals(2, arguments.length); + %HeapObjectVerify(arguments); } f(1, 2); diff --git a/deps/v8/test/mjsunit/getters-on-elements.js b/deps/v8/test/mjsunit/getters-on-elements.js index 85525f8466..c80cdb3f86 100644 --- a/deps/v8/test/mjsunit/getters-on-elements.js +++ b/deps/v8/test/mjsunit/getters-on-elements.js @@ -25,17 +25,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// Flags: --allow-natives-syntax --max-opt-count=100 --noalways-opt -// Flags: --nocollect-maps --crankshaft - -// We specify max-opt-count because we opt/deopt the same function many -// times. - -// We specify nocollect-maps because in gcstress we can end up deoptimizing -// a function in a gc in the stack guard at the beginning of the (optimized) -// function due to leftover map clearing work that results in deoptimizing -// dependent code from those maps. The choice is to insert strategic gc() -// calls or specify this flag. +// Flags: --allow-natives-syntax --noalways-opt --opt // It's nice to run this in other browsers too. var standalone = false; @@ -88,17 +78,38 @@ function base_getter_test(create_func) { foo(a); assertUnoptimized(foo); + // Smi and Double elements transition the KeyedLoadIC to Generic state + // here, because they miss twice with the same map when loading the hole. + // For FAST_HOLEY_ELEMENTS, however, the IC knows how to convert the hole + // to undefined if the prototype is the original array prototype, so it + // stays monomorphic for now... foo(a); foo(a); delete a[0]; assertEquals(0, calls); a.__proto__ = ap; + // ...and later becomes polymorphic when it sees a second map. Optimized + // code will therefore inline the elements access, and deopt right away + // when it loads the hole from index [0]. + // Possible solutions: + // - remove the convert_hole_to_undefined flag from the IC, to force it + // into generic state for all elements kinds. Cost: slower ICs in code + // that doesn't get optimized. + // - teach Turbofan about the same trick: for holey elements with the + // original array prototype, convert hole to undefined inline. Cost: + // larger optimized code size, because the loads for different maps with + // the same elements kind can no longer be consolidated if they handle + // the hole differently. + // - call "foo" twice after setting a.__proto__ and before optimizing it; + // this is the simplest fix so let's do that for now. foo(a); assertEquals(1, calls); - optimize(foo); foo(a); assertEquals(2, calls); + optimize(foo); + foo(a); + assertEquals(3, calls); assertOptimized(foo); // Testcase: getter "deep" in prototype chain. diff --git a/deps/v8/test/mjsunit/global-accessors.js b/deps/v8/test/mjsunit/global-accessors.js index 47f4328b0e..00658f43a5 100644 --- a/deps/v8/test/mjsunit/global-accessors.js +++ b/deps/v8/test/mjsunit/global-accessors.js @@ -26,6 +26,8 @@ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // Test accessors on the global object. +// +// Flags: --no-harmony-strict-legacy-accessor-builtins var x_ = 0; diff --git a/deps/v8/test/mjsunit/harmony/async-generators-basic.js b/deps/v8/test/mjsunit/harmony/async-generators-basic.js index 6d41aada60..29441b119b 100644 --- a/deps/v8/test/mjsunit/harmony/async-generators-basic.js +++ b/deps/v8/test/mjsunit/harmony/async-generators-basic.js @@ -1658,3 +1658,73 @@ assertEqualsAsync({ value: undefined, done: true }, () => it.next("x")); assertEqualsAsync({ value: "nores", done: true }, () => it.return("nores")); assertThrowsAsync(() => it.throw(new MyError("nores")), MyError, "nores"); + +// ---------------------------------------------------------------------------- +// Simple yield*: + +log = []; +async function* asyncGeneratorYieldStar1() { + yield* { + get [Symbol.asyncIterator]() { + log.push({ name: "get @@asyncIterator" }); + return (...args) => { + log.push({ name: "call @@asyncIterator", args }); + return this; + }; + }, + get [Symbol.iterator]() { + log.push({ name: "get @@iterator" }); + return (...args) => { + log.push({ name: "call @@iterator", args }); + return this; + } + }, + get next() { + log.push({ name: "get next" }); + return (...args) => { + log.push({ name: "call next", args }); + return { + get then() { + log.push({ name: "get then" }); + return null; + }, + get value() { + log.push({ name: "get value" }); + throw (exception = new MyError("AbruptValue!")); + }, + get done() { + log.push({ name: "get done" }); + return false; + } + }; + } + }, + get return() { + log.push({ name: "get return" }); + return (...args) => { + log.push({ name: "call return", args }); + return { value: args[0], done: true }; + } + }, + get throw() { + log.push({ name: "get throw" }); + return (...args) => { + log.push({ name: "call throw", args }); + throw args[0]; + }; + }, + }; +} + +it = asyncGeneratorYieldStar1(); +assertThrowsAsync(() => it.next(), MyError); +assertEquals([ + { name: "get @@asyncIterator" }, + { name: "call @@asyncIterator", args: [] }, + { name: "get next" }, + { name: "call next", args: [undefined] }, + { name: "get then" }, + { name: "get done" }, + { name: "get value" }, +], log); +assertEqualsAsync({ value: undefined, done: true }, () => it.next()); diff --git a/deps/v8/test/mjsunit/harmony/atomics.js b/deps/v8/test/mjsunit/harmony/atomics.js index 840d00e78b..ef90076103 100644 --- a/deps/v8/test/mjsunit/harmony/atomics.js +++ b/deps/v8/test/mjsunit/harmony/atomics.js @@ -62,9 +62,9 @@ var IntegerTypedArrayConstructors = [ var si32a = new Int32Array(sab); var si32a2 = new Int32Array(sab, 4); - // Non-integer indexes should throw RangeError. - var nonInteger = [1.4, '1.4', NaN, -Infinity, Infinity, undefined, 'hi', {}]; - nonInteger.forEach(function(i) { + // Indexes that are out of bounds when coerced via ToIndex should throw + // RangeError. + [-Infinity, Infinity].forEach(function(i) { assertThrows(function() { Atomics.compareExchange(si32a, i, 0); }, RangeError); assertThrows(function() { Atomics.load(si32a, i, 0); }, RangeError); @@ -140,7 +140,8 @@ var IntegerTypedArrayConstructors = [ }; // These values all map to index 0 - [-0, 0, 0.0, null, false].forEach(function(i) { + [-0, 0, 0.0, null, false, NaN, {}, '0.2', 'hi', undefined].forEach( + function(i) { var name = String(i); [si32a, si32a2].forEach(function(array) { testOp(Atomics.compareExchange, array, i, 0, name); @@ -564,3 +565,33 @@ function clearArray(sab) { }); })(); + +(function TestValidateIndexBeforeValue() { + var testOp = function(op, sta, name) { + var valueof_has_been_called = 0; + var value = {valueOf: function() { valueof_has_been_called = 1; return 0;}}; + var index = -1; + + // The index should be checked before calling ToInteger on the value, so + // valueof_has_been_called should not be modified. + sta[0] = 0; + assertThrows(function() { op(sta, index, value, value); }, RangeError); + assertEquals(0, valueof_has_been_called); + }; + + IntegerTypedArrayConstructors.forEach(function(t) { + var sab = new SharedArrayBuffer(10 * t.constr.BYTES_PER_ELEMENT); + var sta = new t.constr(sab); + var name = Object.prototype.toString.call(sta); + + testOp(Atomics.compareExchange, sta, name); + testOp(Atomics.load, sta, name); + testOp(Atomics.store, sta, name); + testOp(Atomics.add, sta, name); + testOp(Atomics.sub, sta, name); + testOp(Atomics.and, sta, name); + testOp(Atomics.or, sta, name); + testOp(Atomics.xor, sta, name); + testOp(Atomics.exchange, sta, name); + }); +})(); diff --git a/deps/v8/test/mjsunit/harmony/do-expressions.js b/deps/v8/test/mjsunit/harmony/do-expressions.js index 5adf1545a5..ea0ed2b04e 100644 --- a/deps/v8/test/mjsunit/harmony/do-expressions.js +++ b/deps/v8/test/mjsunit/harmony/do-expressions.js @@ -3,7 +3,7 @@ // found in the LICENSE file. // Flags: --harmony-do-expressions --allow-natives-syntax --no-always-opt -// Flags: --crankshaft +// Flags: --opt function returnValue(v) { return v; } function MyError() {} diff --git a/deps/v8/test/mjsunit/harmony/global-accessors-strict.js b/deps/v8/test/mjsunit/harmony/global-accessors-strict.js new file mode 100644 index 0000000000..15a581e795 --- /dev/null +++ b/deps/v8/test/mjsunit/harmony/global-accessors-strict.js @@ -0,0 +1,54 @@ +// Copyright 2010 the V8 project authors. All rights reserved. +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following +// disclaimer in the documentation and/or other materials provided +// with the distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived +// from this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +// Test accessors on the global object. +// +// Flags: --harmony-strict-legacy-accessor-builtins + +var x_ = 0; + +this.__defineSetter__('x', function(x) { x_ = x; }); +this.__defineGetter__('x', function() { return x_; }); + +this.__defineSetter__('y', function(x) { }); +this.__defineGetter__('y', function() { return 7; }); + +function f(a) { + x = x + a; + return x; +} + +function g(a) { + y = y + a; + return y; +} + +assertEquals(1, f(1)); +assertEquals(3, f(2)); + +assertEquals(7, g(1)); +assertEquals(7, g(2)); diff --git a/deps/v8/test/mjsunit/harmony/regexp-dotall.js b/deps/v8/test/mjsunit/harmony/regexp-dotall.js index 9bf78431a9..eed5d26f05 100644 --- a/deps/v8/test/mjsunit/harmony/regexp-dotall.js +++ b/deps/v8/test/mjsunit/harmony/regexp-dotall.js @@ -56,6 +56,12 @@ function toSlowMode(re) { assertFalse(re.dotAll); } +// Different construction variants with all flags. +{ + assertEquals("gimsuy", new RegExp("", "yusmig").flags); + assertEquals("gimsuy", new RegExp().compile("", "yusmig").flags); +} + // Default '.' behavior. { let re = /^.$/; diff --git a/deps/v8/test/mjsunit/harmony/regexp-named-captures.js b/deps/v8/test/mjsunit/harmony/regexp-named-captures.js index 42dbe0f74f..be90427cfa 100644 --- a/deps/v8/test/mjsunit/harmony/regexp-named-captures.js +++ b/deps/v8/test/mjsunit/harmony/regexp-named-captures.js @@ -147,7 +147,7 @@ assertThrows('/(?<𐒤>a)/u', SyntaxError); // ID_Continue but not ID_Start. assertEquals("a", /(?<π>a)/.exec("bab").groups.π); assertEquals("a", /(?<$>a)/.exec("bab").groups.$); assertEquals("a", /(?<_>a)/.exec("bab").groups._); -assertEquals("a", /(?<$𐒤>a)/.exec("bab").groups.$𐒤); +assertThrows("/(?<$𐒤>a)/", SyntaxError); assertEquals("a", /(?<ಠ_ಠ>a)/.exec("bab").groups.ಠ_ಠ); assertThrows('/(?<❤>a)/', SyntaxError); assertThrows('/(?<𐒤>a)/', SyntaxError); // ID_Continue but not ID_Start. @@ -195,10 +195,15 @@ assertTrue(/(?<\u0041>.)/u.test("a")); // \u NonSurrogate assertTrue(/(?<\u{0041}>.)/u.test("a")); // \u{ Non-surrogate } assertTrue(/(?<a\u{104A4}>.)/u.test("a")); // \u{ Surrogate, ID_Continue } assertThrows("/(?<a\\u{110000}>.)/u", SyntaxError); // \u{ Out-of-bounds } +assertThrows("/(?<a\\uD801>.)/u", SyntaxError); // Lead +assertThrows("/(?<a\\uDCA4>.)/u", SyntaxError); // Trail assertThrows("/(?<a\uD801>.)/u", SyntaxError); // Lead assertThrows("/(?<a\uDCA4>.)/u", SyntaxError); // Trail +assertTrue(RegExp("(?<\\u{0041}>.)", "u").test("a")); // Non-surrogate +assertTrue(RegExp("(?<a\\u{104A4}>.)", "u").test("a")); // Surrogate,ID_Continue assertTrue(RegExp("(?<\u{0041}>.)", "u").test("a")); // Non-surrogate assertTrue(RegExp("(?<a\u{104A4}>.)", "u").test("a")); // Surrogate,ID_Continue +assertTrue(RegExp("(?<\\u0041>.)", "u").test("a")); // Non-surrogate assertThrows("/(?<a\\uD801\uDCA4>.)/", SyntaxError); assertThrows("/(?<a\\uD801>.)/", SyntaxError); @@ -207,10 +212,15 @@ assertTrue(/(?<\u0041>.)/.test("a")); assertThrows("/(?<\\u{0041}>.)/", SyntaxError); assertThrows("/(?<a\\u{104A4}>.)/", SyntaxError); assertThrows("/(?<a\\u{10FFFF}>.)/", SyntaxError); +assertThrows("/(?<a\\uD801>.)/", SyntaxError); // Lead +assertThrows("/(?<a\\uDCA4>.)/", SyntaxError); // Trail; assertThrows("/(?<a\uD801>.)/", SyntaxError); // Lead assertThrows("/(?<a\uDCA4>.)/", SyntaxError); // Trail +assertThrows("/(?<\\u{0041}>.)/", SyntaxError); // Non-surrogate +assertThrows("/(?<a\\u{104A4}>.)/", SyntaxError); // Surrogate, ID_Continue assertTrue(RegExp("(?<\u{0041}>.)").test("a")); // Non-surrogate -assertTrue(RegExp("(?<a\u{104A4}>.)").test("a")); // Surrogate, ID_Continue +assertThrows("(?<a\u{104A4}>.)", SyntaxError); // Surrogate, ID_Continue +assertTrue(RegExp("(?<\\u0041>.)").test("a")); // Non-surrogate // @@replace with a callable replacement argument (no named captures). { diff --git a/deps/v8/test/mjsunit/harmony/regexp-property-binary.js b/deps/v8/test/mjsunit/harmony/regexp-property-binary.js index e1daf08568..8ab3f19329 100644 --- a/deps/v8/test/mjsunit/harmony/regexp-property-binary.js +++ b/deps/v8/test/mjsunit/harmony/regexp-property-binary.js @@ -13,6 +13,19 @@ assertThrows("/\\p{Bidi_C=False}/u"); assertThrows("/\\P{Bidi_Control=Y}/u"); assertThrows("/\\p{AHex=Yes}/u"); +assertThrows("/\\p{Composition_Exclusion}/u"); +assertThrows("/\\p{CE}/u"); +assertThrows("/\\p{Full_Composition_Exclusion}/u"); +assertThrows("/\\p{Comp_Ex}/u"); +assertThrows("/\\p{Grapheme_Link}/u"); +assertThrows("/\\p{Gr_Link}/u"); +assertThrows("/\\p{Hyphen}/u"); +assertThrows("/\\p{NFD_Inert}/u"); +assertThrows("/\\p{NFDK_Inert}/u"); +assertThrows("/\\p{NFC_Inert}/u"); +assertThrows("/\\p{NFKC_Inert}/u"); +assertThrows("/\\p{Segment_Starter}/u"); + t(/\p{Alphabetic}/u, "æ"); f(/\p{Alpha}/u, "1"); @@ -43,9 +56,6 @@ f(/\p{CWT}/u, "1"); t(/\p{Changes_When_Uppercased}/u, "b"); f(/\p{CWU}/u, "1"); -//t(/\p{Composition_Exclusion}/u, "\u0958"); -//f(/\p{CE}/u, "1"); - t(/\p{Dash}/u, "-"); f(/\p{Dash}/u, "1"); @@ -76,9 +86,6 @@ f(/\p{Emoji_Presentation}/u, "x"); t(/\p{Extender}/u, "\u3005"); f(/\p{Ext}/u, "x"); -t(/\p{Full_Composition_Exclusion}/u, "\uFB1F"); -f(/\p{Comp_Ex}/u, "x"); - t(/\p{Grapheme_Base}/u, " "); f(/\p{Gr_Base}/u, "\u0010"); @@ -124,9 +131,6 @@ f(/\p{NChar}/u, "A"); t(/\p{Pattern_White_Space}/u, "\u0009"); f(/\p{Pat_Syn}/u, "A"); -// t(/\p{Prepended_Concatenation_Mark}/u, "\uFDD0"); -// f(/\p{PCM}/u, "A"); - t(/\p{Quotation_Mark}/u, "'"); f(/\p{QMark}/u, "A"); diff --git a/deps/v8/test/mjsunit/indexed-accessors.js b/deps/v8/test/mjsunit/indexed-accessors.js index b69695a99f..534a6c95c3 100644 --- a/deps/v8/test/mjsunit/indexed-accessors.js +++ b/deps/v8/test/mjsunit/indexed-accessors.js @@ -101,7 +101,7 @@ assertEquals(q1.b, 17); // Reported by nth10sd. a = function() {}; -__defineSetter__("0", function() {}); +this.__defineSetter__("0", function() {}); if (a |= '') {}; assertThrows('this[a].__parent__'); assertEquals(a, 0); diff --git a/deps/v8/test/mjsunit/keyed-load-hole-to-undefined.js b/deps/v8/test/mjsunit/keyed-load-hole-to-undefined.js index 9366458a5f..47dc65b0a0 100644 --- a/deps/v8/test/mjsunit/keyed-load-hole-to-undefined.js +++ b/deps/v8/test/mjsunit/keyed-load-hole-to-undefined.js @@ -3,7 +3,7 @@ // found in the LICENSE file. // Flags: --allow-natives-syntax -// Flags: --no-stress-opt --crankshaft --no-always-opt +// Flags: --no-stress-opt --opt --no-always-opt // --nostress-opt is specified because the test corrupts the "pristine" // array prototype chain by storing an element, and this is tracked diff --git a/deps/v8/test/mjsunit/keyed-load-with-string-key.js b/deps/v8/test/mjsunit/keyed-load-with-string-key.js index 2d5f0200d0..ee055e4790 100644 --- a/deps/v8/test/mjsunit/keyed-load-with-string-key.js +++ b/deps/v8/test/mjsunit/keyed-load-with-string-key.js @@ -25,7 +25,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// Flags: --allow-natives-syntax --crankshaft +// Flags: --allow-natives-syntax --opt var o = { diff --git a/deps/v8/test/mjsunit/keyed-load-with-symbol-key.js b/deps/v8/test/mjsunit/keyed-load-with-symbol-key.js index 2c818a84ae..d0be0a0545 100644 --- a/deps/v8/test/mjsunit/keyed-load-with-symbol-key.js +++ b/deps/v8/test/mjsunit/keyed-load-with-symbol-key.js @@ -25,7 +25,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// Flags: --allow-natives-syntax --crankshaft --no-always-opt +// Flags: --allow-natives-syntax --opt --no-always-opt var s = Symbol("foo"); diff --git a/deps/v8/test/mjsunit/keyed-store-generic.js b/deps/v8/test/mjsunit/keyed-store-generic.js new file mode 100644 index 0000000000..c2c48dd96d --- /dev/null +++ b/deps/v8/test/mjsunit/keyed-store-generic.js @@ -0,0 +1,22 @@ +// 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: --allow-natives-syntax --no-stress-opt + +function f(a, i, v) { a[i] = v; } +f("make it generic", 0, 0); + +(function TestIsConcatSpreadableProtector() { + var o = {length: 1, '0': 99}; + %OptimizeObjectForAddingMultipleProperties(o, 0); + f(o, Symbol.isConcatSpreadable, true); + assertEquals([99], [].concat(o)); +})(); + +(function TestSpeciesProtector() { + function MyArray() {} + assertTrue(%SpeciesProtector()); + f(Array.prototype, "constructor", MyArray); + assertFalse(%SpeciesProtector()); +})(); diff --git a/deps/v8/test/mjsunit/math-floor-of-div-minus-zero.js b/deps/v8/test/mjsunit/math-floor-of-div-minus-zero.js index 9a24231ae6..7418a4e257 100644 --- a/deps/v8/test/mjsunit/math-floor-of-div-minus-zero.js +++ b/deps/v8/test/mjsunit/math-floor-of-div-minus-zero.js @@ -25,7 +25,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// Flags: --allow-natives-syntax --nouse-inlining --crankshaft +// Flags: --allow-natives-syntax --nouse-inlining --opt // Test for negative zero that doesn't need bail out diff --git a/deps/v8/test/mjsunit/math-imul.js b/deps/v8/test/mjsunit/math-imul.js index c24f6a3970..e05c000c64 100644 --- a/deps/v8/test/mjsunit/math-imul.js +++ b/deps/v8/test/mjsunit/math-imul.js @@ -25,7 +25,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// Flags: --allow-natives-syntax --max-opt-count=1000 +// Flags: --allow-natives-syntax var imul_func = Math.imul; function imul_polyfill(a, b) { diff --git a/deps/v8/test/mjsunit/messages.js b/deps/v8/test/mjsunit/messages.js index 9c25004861..ff91185a72 100644 --- a/deps/v8/test/mjsunit/messages.js +++ b/deps/v8/test/mjsunit/messages.js @@ -192,33 +192,33 @@ test(function() { }, "this is not a Date object.", TypeError); // kNotGeneric -test(function() { - String.prototype.toString.call(1); -}, "String.prototype.toString is not generic", TypeError); +test(() => String.prototype.toString.call(1), + "String.prototype.toString requires that 'this' be a String", + TypeError); -test(function() { - String.prototype.valueOf.call(1); -}, "String.prototype.valueOf is not generic", TypeError); +test(() => String.prototype.valueOf.call(1), + "String.prototype.valueOf requires that 'this' be a String", + TypeError); -test(function() { - Boolean.prototype.toString.call(1); -}, "Boolean.prototype.toString is not generic", TypeError); +test(() => Boolean.prototype.toString.call(1), + "Boolean.prototype.toString requires that 'this' be a Boolean", + TypeError); -test(function() { - Boolean.prototype.valueOf.call(1); -}, "Boolean.prototype.valueOf is not generic", TypeError); +test(() => Boolean.prototype.valueOf.call(1), + "Boolean.prototype.valueOf requires that 'this' be a Boolean", + TypeError); -test(function() { - Number.prototype.toString.call({}); -}, "Number.prototype.toString is not generic", TypeError); +test(() => Number.prototype.toString.call({}), + "Number.prototype.toString requires that 'this' be a Number", + TypeError); -test(function() { - Number.prototype.valueOf.call({}); -}, "Number.prototype.valueOf is not generic", TypeError); +test(() => Number.prototype.valueOf.call({}), + "Number.prototype.valueOf requires that 'this' be a Number", + TypeError); -test(function() { - Function.prototype.toString.call(1); -}, "Function.prototype.toString is not generic", TypeError); +test(() => Function.prototype.toString.call(1), + "Function.prototype.toString requires that 'this' be a Function", + TypeError); // kNotTypedArray test(function() { diff --git a/deps/v8/test/mjsunit/mjsunit.js b/deps/v8/test/mjsunit/mjsunit.js index bef1b0b59f..754dcbb3de 100644 --- a/deps/v8/test/mjsunit/mjsunit.js +++ b/deps/v8/test/mjsunit/mjsunit.js @@ -123,6 +123,9 @@ var assertMatches; // Assert the result of a promise. var assertPromiseResult; +var promiseTestChain; +var promiseTestCount = 0; + // These bits must be in sync with bits defined in Runtime_GetOptimizationStatus var V8OptimizationStatus = { kIsFunction: 1 << 0, @@ -134,7 +137,7 @@ var V8OptimizationStatus = { kInterpreted: 1 << 6 }; -// Returns true if --no-crankshaft mode is on. +// Returns true if --no-opt mode is on. var isNeverOptimize; // Returns true if --always-opt mode is on. @@ -499,21 +502,35 @@ var failWithMessage; // We have to patch mjsunit because normal assertion failures just throw // exceptions which are swallowed in a then clause. // We use eval here to avoid parsing issues with the natives syntax. + if (!success) success = () => {}; + failWithMessage = (msg) => eval("%AbortJS(msg)"); - if (!fail) + if (!fail) { fail = result => failWithMessage("assertPromiseResult failed: " + result); + } - eval("%IncrementWaitCount()"); - promise.then( - result => { - eval("%DecrementWaitCount()"); - success(result); - }, - result => { - eval("%DecrementWaitCount()"); - fail(result); - } - ); + var test_promise = + promise.then( + result => { + try { + success(result); + } catch (e) { + failWithMessage(e); + } + }, + result => { + fail(result); + } + ) + .then((x)=> { + if (--promiseTestCount == 0) testRunner.notifyDone(); + }); + + if (!promiseTestChain) promiseTestChain = Promise.resolve(); + // waitUntilDone is idempotent. + testRunner.waitUntilDone(); + ++promiseTestCount; + return promiseTestChain.then(test_promise); }; var OptimizationStatusImpl = undefined; @@ -550,10 +567,10 @@ var failWithMessage; assertOptimized = function assertOptimized(fun, sync_opt, name_opt) { if (sync_opt === undefined) sync_opt = ""; var opt_status = OptimizationStatus(fun, sync_opt); - // Tests that use assertOptimized() do not make sense if --no-crankshaft - // option is provided. Such tests must add --crankshaft to flags comment. + // Tests that use assertOptimized() do not make sense if --no-opt + // option is provided. Such tests must add --opt to flags comment. assertFalse((opt_status & V8OptimizationStatus.kNeverOptimize) !== 0, - "test does not make sense with --no-crankshaft"); + "test does not make sense with --no-opt"); assertTrue((opt_status & V8OptimizationStatus.kIsFunction) !== 0, name_opt); if ((opt_status & V8OptimizationStatus.kMaybeDeopted) !== 0) { // When --deopt-every-n-times flag is specified it's no longer guaranteed diff --git a/deps/v8/test/mjsunit/mjsunit.status b/deps/v8/test/mjsunit/mjsunit.status index c8c3c4e927..bb1630aad6 100644 --- a/deps/v8/test/mjsunit/mjsunit.status +++ b/deps/v8/test/mjsunit/mjsunit.status @@ -65,6 +65,7 @@ # Too slow in debug mode for validation of elements. 'regress/regress-430201': [PASS, ['mode == debug', SKIP]], 'regress/regress-430201b': [PASS, ['mode == debug', SKIP]], + 'regress/regress-716044': [PASS, ['mode == debug', SKIP]], ############################################################################## # Too slow in debug mode for GC stress mode. @@ -130,9 +131,6 @@ 'compiler/alloc-number-debug': [PASS, ['mode == release', SKIP]], 'regress/regress-634-debug': [PASS, ['mode == release', SKIP]], - # BUG(336820). TODO(bmeurer): Investigate. - 'regress/regress-336820': [PASS, FAIL], - # BUG(v8:2989). PASS/FAIL on linux32 because crankshaft is turned off for # nosse2. Also for arm novfp3. 'regress/regress-2989': [FAIL, NO_VARIANTS, ['system == linux and arch == x87 or arch == arm and simulator == True', PASS]], @@ -148,7 +146,7 @@ # Slow tests. 'copy-on-write-assert': [PASS, SLOW], 'es6/tail-call-megatest*': [PASS, SLOW, FAST_VARIANTS, ['tsan', SKIP]], - 'es6/typedarray-construct-offset-not-smi': [PASS, SLOW, NO_VARIANTS], + 'es6/typedarray-construct-offset-not-smi': [PASS, SLOW], 'harmony/regexp-property-script-extensions': [PASS, SLOW], 'numops-fuzz-part*': [PASS, ['mode == debug', SLOW]], 'readonly': [PASS, SLOW], @@ -186,15 +184,8 @@ # which makes the test useless. 'big-object-literal': [PASS, ['mode == debug', SKIP]], - # BUG(v8:5778): These fail with --future, which we are about to turn on. - # Investigate. - 'regress/regress-105': [SKIP], - - # BUG(v8:6101): This fails because of a hole deopt, need to investigate. - 'getters-on-elements': [SKIP], - - # BUG(v8:6113). - 'es6/array-iterator-turbo': [SKIP], + # BUG(v8:6306). + 'wasm/huge-memory': [SKIP], }], # ALWAYS ['novfp3 == True', { @@ -342,7 +333,7 @@ 'whitespaces': [PASS, TIMEOUT, SLOW], }], # 'arch == arm64' -['arch == arm64 and mode == debug and simulator_run == True', { +['arch == arm64 and mode == debug and simulator_run', { # Pass but take too long with the simulator in debug mode. 'array-sort': [PASS, TIMEOUT], @@ -354,7 +345,7 @@ 'unicodelctest-no-optimization': [PASS, TIMEOUT], # Issue 3219: 'getters-on-elements': [PASS, ['gc_stress == True', FAIL]], -}], # 'arch == arm64 and mode == debug and simulator_run == True' +}], # 'arch == arm64 and mode == debug and simulator_run' ############################################################################## ['asan == True', { @@ -369,6 +360,10 @@ # Exception thrown during bootstrapping on ASAN builds, see issue 4236. 'regress/regress-1132': [SKIP], + + # Flaky on ASAN builds: https://bugs.chromium.org/p/v8/issues/detail?id=6305 + 'regress/regress-430201': [SKIP], + 'regress/regress-430201b': [SKIP], }], # 'asan == True' ############################################################################## @@ -387,7 +382,7 @@ # Flaky with baseline? 'regress/regress-2185-2': [SKIP], - # Slow tests with --nocrankshaft. + # Slow tests with --noopt. 'compiler/osr-one': [PASS, SLOW], 'compiler/osr-two': [PASS, SLOW], 'wasm/grow-memory': [PASS, SLOW], @@ -551,6 +546,7 @@ # Setting the timezone and locale with environment variables unavailable 'icu-date-to-string': [SKIP], 'icu-date-lord-howe': [SKIP], + 'regress/regress-6288': [SKIP], }], # 'system == windows' ############################################################################## @@ -601,11 +597,11 @@ }], # 'predictable == True' ############################################################################## -['arch == ppc and simulator_run == True or arch == ppc64 and simulator_run == True', { +['arch == ppc and simulator_run or arch == ppc64 and simulator_run', { # take too long with the simulator. 'regress/regress-1132': [SKIP], -}], # 'arch == ppc and simulator_run == True' +}], # 'arch == ppc and simulator_run' ############################################################################## ['arch == ppc64', { @@ -646,6 +642,13 @@ }], # variant == nooptimization ############################################################################## +['variant == noturbofan and no_snap', { + # Too slow for old pipeline and nosnap. + 'regress/regress-2249': [SKIP], + 'harmony/futex': [SKIP], +}], # variant == noturbofan and no_snap + +############################################################################## ['variant == turbofan_opt', { 'es6/array-iterator-turbo': [SKIP], @@ -669,11 +672,6 @@ }], # 'gcov_coverage' ############################################################################## -['variant == asm_wasm', { - # Issue 6127: Currently {StashCode} breaks the source position table. - 'wasm/asm-wasm-expr': [SKIP], -}], # variant == asm_wasm - ['variant == wasm_traps', { # Skip stuff uninteresting for wasm traps 'bugs/*': [SKIP], @@ -692,13 +690,4 @@ 'whitespaces': [SKIP], }], # variant == wasm_traps -############################################################################## -# This test allocates a 2G block of memory and if there are multiple -# varients this leads kills by the OOM killer, crashes or messages -# indicating the OS cannot allocate memory, exclude for Node.js runs -# re-evalute when we move up to v8 5.1 -[ALWAYS, { -'regress/regress-crbug-514081': [PASS, NO_VARIANTS], -}], # ALWAYS - ] diff --git a/deps/v8/test/mjsunit/modules-turbo1.js b/deps/v8/test/mjsunit/modules-turbo1.js index ce688e1dad..c8877d1f06 100644 --- a/deps/v8/test/mjsunit/modules-turbo1.js +++ b/deps/v8/test/mjsunit/modules-turbo1.js @@ -3,7 +3,7 @@ // found in the LICENSE file. // MODULE -// Flags: --allow-natives-syntax --turbo --crankshaft --turbo-filter=* +// Flags: --allow-natives-syntax --turbo --opt --turbo-filter=* export let x = 0; function foo() { x++ }; diff --git a/deps/v8/test/mjsunit/never-optimize.js b/deps/v8/test/mjsunit/never-optimize.js index 2949f06268..5efaa47de3 100644 --- a/deps/v8/test/mjsunit/never-optimize.js +++ b/deps/v8/test/mjsunit/never-optimize.js @@ -25,7 +25,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// Flags: --allow-natives-syntax --crankshaft --no-always-opt +// Flags: --allow-natives-syntax --opt --no-always-opt function o1() { } diff --git a/deps/v8/test/mjsunit/object-keys.js b/deps/v8/test/mjsunit/object-keys.js new file mode 100644 index 0000000000..29eb85d6aa --- /dev/null +++ b/deps/v8/test/mjsunit/object-keys.js @@ -0,0 +1,34 @@ +// 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: --allow-natives-syntax + +// Ensure that mutation of the Object.keys result doesn't affect the +// enumeration cache for fast-mode objects. +(function() { + const a = {x:1, y:2}; + let k = Object.keys(a); + %HeapObjectVerify(k); + assertEquals(2, k.length); + assertEquals("x", k[0]); + assertEquals("y", k[1]); + k[0] = "y"; + k[1] = "x"; + k = Object.keys(a); + assertEquals(2, k.length); + assertEquals("x", k[0]); + assertEquals("y", k[1]); +})(); + +// Ensure that the copy-on-write keys are handled properly, even in +// the presence of Symbols. +(function() { + const s = Symbol(); + const a = {[s]: 1}; + let k = Object.keys(a); + %HeapObjectVerify(k); + assertEquals(0, k.length); + k.shift(); + assertEquals(0, k.length); +})(); diff --git a/deps/v8/test/mjsunit/object-literal.js b/deps/v8/test/mjsunit/object-literal.js index 8fdf68d42e..5717837e34 100644 --- a/deps/v8/test/mjsunit/object-literal.js +++ b/deps/v8/test/mjsunit/object-literal.js @@ -25,55 +25,81 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -var obj = { - a: 7, - b: { x: 12, y: 24 }, - c: 'Zebra' -} - -assertEquals(7, obj.a); -assertEquals(12, obj.b.x); -assertEquals(24, obj.b.y); -assertEquals('Zebra', obj.c); +// Flags: --allow-natives-syntax -var z = 24; +function testBasicPrototype() { + var obj = { + a: 7, + b: { x: 12, y: 24 }, + c: 'Zebra' + } -var obj2 = { - a: 7, - b: { x: 12, y: z }, - c: 'Zebra' -} + assertEquals(7, obj.a); + assertEquals(12, obj.b.x); + assertEquals(24, obj.b.y); + assertEquals('Zebra', obj.c); + assertEquals(Object.getPrototypeOf(obj), Object.prototype); + assertEquals(Object.getPrototypeOf(obj.b), Object.prototype); +}; +testBasicPrototype(); +testBasicPrototype(); -assertEquals(7, obj2.a); -assertEquals(12, obj2.b.x); -assertEquals(24, obj2.b.y); -assertEquals('Zebra', obj2.c); +function testDynamicValue() { + var z = 24; -var arr = []; -for (var i = 0; i < 2; i++) { - arr[i] = { + var obj2 = { a: 7, - b: { x: 12, y: 24 }, + b: { x: 12, y: z }, c: 'Zebra' } + + assertEquals(7, obj2.a); + assertEquals(12, obj2.b.x); + assertEquals(24, obj2.b.y); + assertEquals('Zebra', obj2.c); } +testDynamicValue(); +testDynamicValue(); + +(function testMultipleInstatiations() { + var arr = []; + for (var i = 0; i < 2; i++) { + arr[i] = { + a: 7, + b: { x: 12, y: 24 }, + c: 'Zebra' + } + } -arr[0].b.x = 2; -assertEquals(2, arr[0].b.x); -assertEquals(12, arr[1].b.x); + arr[0].b.x = 2; + assertEquals(2, arr[0].b.x); + assertEquals(12, arr[1].b.x); +})(); +function testSparseElements() { + let sa1 = { + '0': { x: 12, y: 24 }, + '1000000': { x: 1, y: 2 } + }; -function makeSparseArray() { - return { - '0': { x: 12, y: 24 }, - '1000000': { x: 0, y: 0 } - }; + assertEquals(['0', '1000000'], Object.keys(sa1)); + assertEquals(12, sa1[0].x); + assertEquals(24, sa1[0].y); + assertEquals(['x', 'y'], Object.keys(sa1[0])); + assertEquals(1, sa1[1000000].x); + assertEquals(2, sa1[1000000].y); + assertEquals(['x', 'y'], Object.keys(sa1[1000000])); + assertEquals(Object.prototype, Object.getPrototypeOf(sa1)); + assertEquals(Object.prototype, Object.getPrototypeOf(sa1[0])); + assertEquals(Object.prototype, Object.getPrototypeOf(sa1[1000000])); + return sa1; } -var sa1 = makeSparseArray(); -sa1[0].x = 0; -var sa2 = makeSparseArray(); -assertEquals(12, sa2[0].x); +let object = testSparseElements(); +// modify the object and rerun the test, ensuring the literal didn't change. +object[1] = "a"; +object[0].x = -12; +testSparseElements(); // Test that non-constant literals work. var n = new Object(); @@ -81,12 +107,19 @@ var n = new Object(); function makeNonConstantArray() { return [ [ n ] ]; } var a = makeNonConstantArray(); +var b = makeNonConstantArray(); +assertTrue(a[0][0] === n); +assertTrue(b[0][0] === n); +assertFalse(a[0] === b[0]); a[0][0].foo = "bar"; assertEquals("bar", n.foo); function makeNonConstantObject() { return { a: { b: n } }; } a = makeNonConstantObject(); +b = makeNonConstantObject(); +assertFalse(a.a === b.a); +assertTrue(a.a.b === b.a.b); a.a.b.bar = "foo"; assertEquals("foo", n.bar); @@ -94,15 +127,23 @@ assertEquals("foo", n.bar); function makeRegexpInArray() { return [ [ /a*/, {} ] ]; } a = makeRegexpInArray(); -var b = makeRegexpInArray(); +b = makeRegexpInArray(); assertFalse(a[0][0] === b[0][0]); assertFalse(a[0][1] === b[0][1]); +assertEquals(Array.prototype, Object.getPrototypeOf(a)); +assertEquals(Array.prototype, Object.getPrototypeOf(b)); +assertEquals(Array.prototype, Object.getPrototypeOf(a[0])); +assertEquals(Array.prototype, Object.getPrototypeOf(b[0])); +assertEquals(RegExp.prototype, Object.getPrototypeOf(a[0][0])); +assertEquals(RegExp.prototype, Object.getPrototypeOf(b[0][0])); function makeRegexpInObject() { return { a: { b: /b*/, c: {} } }; } a = makeRegexpInObject(); b = makeRegexpInObject(); assertFalse(a.a.b === b.a.b); assertFalse(a.a.c === b.a.c); +assertEquals(RegExp.prototype, Object.getPrototypeOf(a.a.b)); +assertEquals(RegExp.prototype, Object.getPrototypeOf(b.a.b)); // Test keywords are valid as property names in initializers and dot-access. @@ -191,8 +232,16 @@ for (var i = 0; i < keywords.length; i++) { testKeywordProperty(keywords[i]); } +function TestSimpleElements() { + var o = { 0:"zero", 1:"one", 2:"two" }; + assertEquals({0:"zero", 1:"one", 2:"two"}, o); + o[0] = 0; + assertEquals({0:0, 1:"one", 2:"two"}, o); +} +TestSimpleElements(); +TestSimpleElements(); -(function TestNumericNames() { +function TestNumericNames() { var o = { 1: 1, 2.: 2, @@ -211,55 +260,1224 @@ for (var i = 0; i < keywords.length; i++) { 1.30: 1.3 }; assertEquals(['1.2', '1.3'], Object.keys(o)); -})(); +} +TestNumericNames(); +TestNumericNames(); + +function TestNonNumberElementValues() { + var o = { + 1: true, + 2: false, + 3: undefined, + 4: "" + }; + assertEquals(['1', '2', '3', '4'], Object.keys(o)); + var o2 = { + 1: true, + 2: false, + 3: undefined, + 4: "", + a: 'a', + b: 'b' + }; + assertEquals(['1', '2', '3', '4', 'a', 'b'], Object.keys(o2)); + var o3 = { + __proto__:null, + 1: true, + 2: false, + 3: undefined, + 4: "" + }; + assertEquals(['1', '2', '3', '4'], Object.keys(o3)); + var o4 = { + __proto__:null, + 1: true, + 2: false, + 3: undefined, + 4: "", + a: 'a', + b: 'b' + }; + assertEquals(['1', '2', '3', '4', 'a', 'b'], Object.keys(o4)); +} +TestNonNumberElementValues(); +TestNonNumberElementValues(); +%OptimizeFunctionOnNextCall(TestNonNumberElementValues); +TestNonNumberElementValues(); -function TestNumericNamesGetter(expectedKeys, object) { - assertEquals(expectedKeys, Object.keys(object)); - expectedKeys.forEach(function(key) { - var descr = Object.getOwnPropertyDescriptor(object, key); - assertEquals('get ' + key, descr.get.name); +function numericGetters() { + function TestNumericNamesGetter(expectedKeys, object) { + assertEquals(expectedKeys, Object.keys(object)); + expectedKeys.forEach(function(key) { + var descr = Object.getOwnPropertyDescriptor(object, key); + assertEquals('get ' + key, descr.get.name); + }); + } + TestNumericNamesGetter(['1', '2', '3', '4', '5', '6', '7', '8', '9'], { + get 1() {}, + get 2.() {}, + get 3.0() {}, + get 4e0() {}, + get 5E0() {}, + get 6e-0() {}, + get 7E-0() {}, + get 0x8() {}, + get 0X9() {}, + }); + TestNumericNamesGetter(['1.2', '1.3'], { + get 1.2() {}, + get 1.30() {} }); } -TestNumericNamesGetter(['1', '2', '3', '4', '5', '6', '7', '8', '9'], { - get 1() {}, - get 2.() {}, - get 3.0() {}, - get 4e0() {}, - get 5E0() {}, - get 6e-0() {}, - get 7E-0() {}, - get 0x8() {}, - get 0X9() {}, -}); -TestNumericNamesGetter(['1.2', '1.3'], { - get 1.2() {}, - get 1.30() {} -}); - - -function TestNumericNamesSetter(expectedKeys, object) { - assertEquals(expectedKeys, Object.keys(object)); - expectedKeys.forEach(function(key) { - var descr = Object.getOwnPropertyDescriptor(object, key); - assertEquals('set ' + key, descr.set.name); +numericGetters(); +numericGetters(); + +function numericSetters() { + function TestNumericNamesSetter(expectedKeys, object) { + assertEquals(expectedKeys, Object.keys(object)); + expectedKeys.forEach(function(key) { + var descr = Object.getOwnPropertyDescriptor(object, key); + assertEquals('set ' + key, descr.set.name); + }); + } + TestNumericNamesSetter(['1', '2', '3', '4', '5', '6', '7', '8', '9'], { + set 1(_) {}, + set 2.(_) {}, + set 3.0(_) {}, + set 4e0(_) {}, + set 5E0(_) {}, + set 6e-0(_) {}, + set 7E-0(_) {}, + set 0x8(_) {}, + set 0X9(_) {}, }); + TestNumericNamesSetter(['1.2', '1.3'], { + set 1.2(_) {; }, + set 1.30(_) {; } + }); +}; + +numericSetters(); +numericSetters(); + +function TestProxyWithDefinitionInObjectLiteral() { + // Trap for set should not be used if the definition + // happens in the object literal. + var handler = { + set: function(target, name, value) { + } + }; + + const prop = 'a'; + + var p = new Proxy({}, handler); + p[prop] = 'my value'; + assertEquals(undefined, p[prop]); + + + var l = new Proxy({[prop]: 'my value'}, handler); + assertEquals('my value', l[prop]); +}; +TestProxyWithDefinitionInObjectLiteral(); +TestProxyWithDefinitionInObjectLiteral(); + +(function TestLiteralWithNullProto() { + // Assume dictionary usage for simple null prototype literal objects, + // this is equivalent to Object.create(null). Note that on the first call + // the literal boilerplate is initialized, and from then on we use a the + // fast clone stub. + function testDictModeNullProtoLiteral(fn) { + let obj = fn(); + assertFalse(%HasFastProperties(obj)); + assertEquals(Object.getPrototypeOf(obj), null); + let next = fn(); + assertFalse(obj === next); + obj = next; + assertFalse(%HasFastProperties(obj)); + assertEquals(Object.getPrototypeOf(obj), null); + next = fn(); + assertFalse(obj === next); + obj = next; + assertFalse(%HasFastProperties(obj)); + assertEquals(Object.getPrototypeOf(obj), null); + } + testDictModeNullProtoLiteral(() => ({__proto__:null})); + testDictModeNullProtoLiteral(() => ({__proto__:null, a:1, b:2})); + testDictModeNullProtoLiteral(() => ({__proto__: null, ["a"]: 1})); + testDictModeNullProtoLiteral(() => ({__proto__: null, a: Object})); + testDictModeNullProtoLiteral(() => ({a:1, b:2, __proto__:null})); + testDictModeNullProtoLiteral(() => ({["a"]: 1, __proto__: null})); + testDictModeNullProtoLiteral(() => ({a: Object, __proto__: null})); +})(); + +function testNestedNullProtoLiteral() { + let obj; + obj = { foo: { __proto__:Math, bar:"barValue"}}; + assertTrue(%HasFastProperties(obj)); + assertTrue(%HasFastProperties(obj.foo)); + assertEquals(Object.prototype, Object.getPrototypeOf(obj)); + assertEquals(Math, Object.getPrototypeOf(obj.foo)); + assertEquals(["foo"], Object.keys(obj)); + assertEquals(["bar"], Object.keys(obj.foo)); + assertEquals("barValue", obj.foo.bar); + obj.foo.bar = "barValue2"; + assertEquals("barValue2", obj.foo.bar); + + obj = { foo: { __proto__:null, bar:"barValue"}}; + assertTrue(%HasFastProperties(obj)); + assertFalse(%HasFastProperties(obj.foo)); + assertEquals(Object.prototype, Object.getPrototypeOf(obj)); + assertEquals(null, Object.getPrototypeOf(obj.foo)); + assertEquals(["foo"], Object.keys(obj)); + assertEquals(["bar"], Object.keys(obj.foo)); + assertEquals("barValue", obj.foo.bar); + obj.foo.bar = "barValue2"; + assertEquals("barValue2", obj.foo.bar); } -TestNumericNamesSetter(['1', '2', '3', '4', '5', '6', '7', '8', '9'], { - set 1(_) {}, - set 2.(_) {}, - set 3.0(_) {}, - set 4e0(_) {}, - set 5E0(_) {}, - set 6e-0(_) {}, - set 7E-0(_) {}, - set 0x8(_) {}, - set 0X9(_) {}, -}); -TestNumericNamesSetter(['1.2', '1.3'], { - set 1.2(_) {; }, - set 1.30(_) {; } -}); +testNestedNullProtoLiteral(); +testNestedNullProtoLiteral(); + + +function TestSlowLiteralOptimized() { + function f() { + return {__proto__:null, bar:"barValue"}; + } + let obj = f(); + assertFalse(%HasFastProperties(obj)); + assertEquals(Object.getPrototypeOf(obj), null); + assertEquals(["bar"], Object.keys(obj)); + assertEquals("barValue", obj.bar); + obj.bar = "barValue2"; + assertEquals("barValue2", obj.bar); + + %OptimizeFunctionOnNextCall(f); + obj = f(); + assertFalse(%HasFastProperties(obj)); + assertEquals(Object.getPrototypeOf(obj), null); + assertEquals(["bar"], Object.keys(obj)); + assertEquals("barValue", obj.bar); + obj.bar = "barValue2"; + assertEquals("barValue2", obj.bar); +}; +TestSlowLiteralOptimized(); +TestSlowLiteralOptimized(); + +(function TestLargeDictionaryLiteral() { + // Create potential large-space object literal. + function createObject() { + // This literal has least kMaxRegularHeapObjectSize / 64 number of + // properties, forcing the backing store to be in large object space. + return { __proto__:null, + p1:'',p2:'',p3:'',p4:'',p5:'',p6:'',p7:'',p8:'', + p9:'',pa:'',pb:'',pc:'',pd:'',pe:'',pf:'',p10:'', + p11:'',p12:'',p13:'',p14:'',p15:'',p16:'',p17:'',p18:'', + p19:'',p1a:'',p1b:'',p1c:'',p1d:'',p1e:'',p1f:'',p20:'', + p21:'',p22:'',p23:'',p24:'',p25:'',p26:'',p27:'',p28:'', + p29:'',p2a:'',p2b:'',p2c:'',p2d:'',p2e:'',p2f:'',p30:'', + p31:'',p32:'',p33:'',p34:'',p35:'',p36:'',p37:'',p38:'', + p39:'',p3a:'',p3b:'',p3c:'',p3d:'',p3e:'',p3f:'',p40:'', + p41:'',p42:'',p43:'',p44:'',p45:'',p46:'',p47:'',p48:'', + p49:'',p4a:'',p4b:'',p4c:'',p4d:'',p4e:'',p4f:'',p50:'', + p51:'',p52:'',p53:'',p54:'',p55:'',p56:'',p57:'',p58:'', + p59:'',p5a:'',p5b:'',p5c:'',p5d:'',p5e:'',p5f:'',p60:'', + p61:'',p62:'',p63:'',p64:'',p65:'',p66:'',p67:'',p68:'', + p69:'',p6a:'',p6b:'',p6c:'',p6d:'',p6e:'',p6f:'',p70:'', + p71:'',p72:'',p73:'',p74:'',p75:'',p76:'',p77:'',p78:'', + p79:'',p7a:'',p7b:'',p7c:'',p7d:'',p7e:'',p7f:'',p80:'', + p81:'',p82:'',p83:'',p84:'',p85:'',p86:'',p87:'',p88:'', + p89:'',p8a:'',p8b:'',p8c:'',p8d:'',p8e:'',p8f:'',p90:'', + p91:'',p92:'',p93:'',p94:'',p95:'',p96:'',p97:'',p98:'', + p99:'',p9a:'',p9b:'',p9c:'',p9d:'',p9e:'',p9f:'',pa0:'', + pa1:'',pa2:'',pa3:'',pa4:'',pa5:'',pa6:'',pa7:'',pa8:'', + pa9:'',paa:'',pab:'',pac:'',pad:'',pae:'',paf:'',pb0:'', + pb1:'',pb2:'',pb3:'',pb4:'',pb5:'',pb6:'',pb7:'',pb8:'', + pb9:'',pba:'',pbb:'',pbc:'',pbd:'',pbe:'',pbf:'',pc0:'', + pc1:'',pc2:'',pc3:'',pc4:'',pc5:'',pc6:'',pc7:'',pc8:'', + pc9:'',pca:'',pcb:'',pcc:'',pcd:'',pce:'',pcf:'',pd0:'', + pd1:'',pd2:'',pd3:'',pd4:'',pd5:'',pd6:'',pd7:'',pd8:'', + pd9:'',pda:'',pdb:'',pdc:'',pdd:'',pde:'',pdf:'',pe0:'', + pe1:'',pe2:'',pe3:'',pe4:'',pe5:'',pe6:'',pe7:'',pe8:'', + pe9:'',pea:'',peb:'',pec:'',ped:'',pee:'',pef:'',pf0:'', + pf1:'',pf2:'',pf3:'',pf4:'',pf5:'',pf6:'',pf7:'',pf8:'', + pf9:'',pfa:'',pfb:'',pfc:'',pfd:'',pfe:'',pff:'',p100:'', + p101:'',p102:'',p103:'',p104:'',p105:'',p106:'',p107:'',p108:'', + p109:'',p10a:'',p10b:'',p10c:'',p10d:'',p10e:'',p10f:'',p110:'', + p111:'',p112:'',p113:'',p114:'',p115:'',p116:'',p117:'',p118:'', + p119:'',p11a:'',p11b:'',p11c:'',p11d:'',p11e:'',p11f:'',p120:'', + p121:'',p122:'',p123:'',p124:'',p125:'',p126:'',p127:'',p128:'', + p129:'',p12a:'',p12b:'',p12c:'',p12d:'',p12e:'',p12f:'',p130:'', + p131:'',p132:'',p133:'',p134:'',p135:'',p136:'',p137:'',p138:'', + p139:'',p13a:'',p13b:'',p13c:'',p13d:'',p13e:'',p13f:'',p140:'', + p141:'',p142:'',p143:'',p144:'',p145:'',p146:'',p147:'',p148:'', + p149:'',p14a:'',p14b:'',p14c:'',p14d:'',p14e:'',p14f:'',p150:'', + p151:'',p152:'',p153:'',p154:'',p155:'',p156:'',p157:'',p158:'', + p159:'',p15a:'',p15b:'',p15c:'',p15d:'',p15e:'',p15f:'',p160:'', + p161:'',p162:'',p163:'',p164:'',p165:'',p166:'',p167:'',p168:'', + p169:'',p16a:'',p16b:'',p16c:'',p16d:'',p16e:'',p16f:'',p170:'', + p171:'',p172:'',p173:'',p174:'',p175:'',p176:'',p177:'',p178:'', + p179:'',p17a:'',p17b:'',p17c:'',p17d:'',p17e:'',p17f:'',p180:'', + p181:'',p182:'',p183:'',p184:'',p185:'',p186:'',p187:'',p188:'', + p189:'',p18a:'',p18b:'',p18c:'',p18d:'',p18e:'',p18f:'',p190:'', + p191:'',p192:'',p193:'',p194:'',p195:'',p196:'',p197:'',p198:'', + p199:'',p19a:'',p19b:'',p19c:'',p19d:'',p19e:'',p19f:'',p1a0:'', + p1a1:'',p1a2:'',p1a3:'',p1a4:'',p1a5:'',p1a6:'',p1a7:'',p1a8:'', + p1a9:'',p1aa:'',p1ab:'',p1ac:'',p1ad:'',p1ae:'',p1af:'',p1b0:'', + p1b1:'',p1b2:'',p1b3:'',p1b4:'',p1b5:'',p1b6:'',p1b7:'',p1b8:'', + p1b9:'',p1ba:'',p1bb:'',p1bc:'',p1bd:'',p1be:'',p1bf:'',p1c0:'', + p1c1:'',p1c2:'',p1c3:'',p1c4:'',p1c5:'',p1c6:'',p1c7:'',p1c8:'', + p1c9:'',p1ca:'',p1cb:'',p1cc:'',p1cd:'',p1ce:'',p1cf:'',p1d0:'', + p1d1:'',p1d2:'',p1d3:'',p1d4:'',p1d5:'',p1d6:'',p1d7:'',p1d8:'', + p1d9:'',p1da:'',p1db:'',p1dc:'',p1dd:'',p1de:'',p1df:'',p1e0:'', + p1e1:'',p1e2:'',p1e3:'',p1e4:'',p1e5:'',p1e6:'',p1e7:'',p1e8:'', + p1e9:'',p1ea:'',p1eb:'',p1ec:'',p1ed:'',p1ee:'',p1ef:'',p1f0:'', + p1f1:'',p1f2:'',p1f3:'',p1f4:'',p1f5:'',p1f6:'',p1f7:'',p1f8:'', + p1f9:'',p1fa:'',p1fb:'',p1fc:'',p1fd:'',p1fe:'',p1ff:'',p200:'', + p201:'',p202:'',p203:'',p204:'',p205:'',p206:'',p207:'',p208:'', + p209:'',p20a:'',p20b:'',p20c:'',p20d:'',p20e:'',p20f:'',p210:'', + p211:'',p212:'',p213:'',p214:'',p215:'',p216:'',p217:'',p218:'', + p219:'',p21a:'',p21b:'',p21c:'',p21d:'',p21e:'',p21f:'',p220:'', + p221:'',p222:'',p223:'',p224:'',p225:'',p226:'',p227:'',p228:'', + p229:'',p22a:'',p22b:'',p22c:'',p22d:'',p22e:'',p22f:'',p230:'', + p231:'',p232:'',p233:'',p234:'',p235:'',p236:'',p237:'',p238:'', + p239:'',p23a:'',p23b:'',p23c:'',p23d:'',p23e:'',p23f:'',p240:'', + p241:'',p242:'',p243:'',p244:'',p245:'',p246:'',p247:'',p248:'', + p249:'',p24a:'',p24b:'',p24c:'',p24d:'',p24e:'',p24f:'',p250:'', + p251:'',p252:'',p253:'',p254:'',p255:'',p256:'',p257:'',p258:'', + p259:'',p25a:'',p25b:'',p25c:'',p25d:'',p25e:'',p25f:'',p260:'', + p261:'',p262:'',p263:'',p264:'',p265:'',p266:'',p267:'',p268:'', + p269:'',p26a:'',p26b:'',p26c:'',p26d:'',p26e:'',p26f:'',p270:'', + p271:'',p272:'',p273:'',p274:'',p275:'',p276:'',p277:'',p278:'', + p279:'',p27a:'',p27b:'',p27c:'',p27d:'',p27e:'',p27f:'',p280:'', + p281:'',p282:'',p283:'',p284:'',p285:'',p286:'',p287:'',p288:'', + p289:'',p28a:'',p28b:'',p28c:'',p28d:'',p28e:'',p28f:'',p290:'', + p291:'',p292:'',p293:'',p294:'',p295:'',p296:'',p297:'',p298:'', + p299:'',p29a:'',p29b:'',p29c:'',p29d:'',p29e:'',p29f:'',p2a0:'', + p2a1:'',p2a2:'',p2a3:'',p2a4:'',p2a5:'',p2a6:'',p2a7:'',p2a8:'', + p2a9:'',p2aa:'',p2ab:'',p2ac:'',p2ad:'',p2ae:'',p2af:'',p2b0:'', + p2b1:'',p2b2:'',p2b3:'',p2b4:'',p2b5:'',p2b6:'',p2b7:'',p2b8:'', + p2b9:'',p2ba:'',p2bb:'',p2bc:'',p2bd:'',p2be:'',p2bf:'',p2c0:'', + p2c1:'',p2c2:'',p2c3:'',p2c4:'',p2c5:'',p2c6:'',p2c7:'',p2c8:'', + p2c9:'',p2ca:'',p2cb:'',p2cc:'',p2cd:'',p2ce:'',p2cf:'',p2d0:'', + p2d1:'',p2d2:'',p2d3:'',p2d4:'',p2d5:'',p2d6:'',p2d7:'',p2d8:'', + p2d9:'',p2da:'',p2db:'',p2dc:'',p2dd:'',p2de:'',p2df:'',p2e0:'', + p2e1:'',p2e2:'',p2e3:'',p2e4:'',p2e5:'',p2e6:'',p2e7:'',p2e8:'', + p2e9:'',p2ea:'',p2eb:'',p2ec:'',p2ed:'',p2ee:'',p2ef:'',p2f0:'', + p2f1:'',p2f2:'',p2f3:'',p2f4:'',p2f5:'',p2f6:'',p2f7:'',p2f8:'', + p2f9:'',p2fa:'',p2fb:'',p2fc:'',p2fd:'',p2fe:'',p2ff:'',p300:'', + p301:'',p302:'',p303:'',p304:'',p305:'',p306:'',p307:'',p308:'', + p309:'',p30a:'',p30b:'',p30c:'',p30d:'',p30e:'',p30f:'',p310:'', + p311:'',p312:'',p313:'',p314:'',p315:'',p316:'',p317:'',p318:'', + p319:'',p31a:'',p31b:'',p31c:'',p31d:'',p31e:'',p31f:'',p320:'', + p321:'',p322:'',p323:'',p324:'',p325:'',p326:'',p327:'',p328:'', + p329:'',p32a:'',p32b:'',p32c:'',p32d:'',p32e:'',p32f:'',p330:'', + p331:'',p332:'',p333:'',p334:'',p335:'',p336:'',p337:'',p338:'', + p339:'',p33a:'',p33b:'',p33c:'',p33d:'',p33e:'',p33f:'',p340:'', + p341:'',p342:'',p343:'',p344:'',p345:'',p346:'',p347:'',p348:'', + p349:'',p34a:'',p34b:'',p34c:'',p34d:'',p34e:'',p34f:'',p350:'', + p351:'',p352:'',p353:'',p354:'',p355:'',p356:'',p357:'',p358:'', + p359:'',p35a:'',p35b:'',p35c:'',p35d:'',p35e:'',p35f:'',p360:'', + p361:'',p362:'',p363:'',p364:'',p365:'',p366:'',p367:'',p368:'', + p369:'',p36a:'',p36b:'',p36c:'',p36d:'',p36e:'',p36f:'',p370:'', + p371:'',p372:'',p373:'',p374:'',p375:'',p376:'',p377:'',p378:'', + p379:'',p37a:'',p37b:'',p37c:'',p37d:'',p37e:'',p37f:'',p380:'', + p381:'',p382:'',p383:'',p384:'',p385:'',p386:'',p387:'',p388:'', + p389:'',p38a:'',p38b:'',p38c:'',p38d:'',p38e:'',p38f:'',p390:'', + p391:'',p392:'',p393:'',p394:'',p395:'',p396:'',p397:'',p398:'', + p399:'',p39a:'',p39b:'',p39c:'',p39d:'',p39e:'',p39f:'',p3a0:'', + p3a1:'',p3a2:'',p3a3:'',p3a4:'',p3a5:'',p3a6:'',p3a7:'',p3a8:'', + p3a9:'',p3aa:'',p3ab:'',p3ac:'',p3ad:'',p3ae:'',p3af:'',p3b0:'', + p3b1:'',p3b2:'',p3b3:'',p3b4:'',p3b5:'',p3b6:'',p3b7:'',p3b8:'', + p3b9:'',p3ba:'',p3bb:'',p3bc:'',p3bd:'',p3be:'',p3bf:'',p3c0:'', + p3c1:'',p3c2:'',p3c3:'',p3c4:'',p3c5:'',p3c6:'',p3c7:'',p3c8:'', + p3c9:'',p3ca:'',p3cb:'',p3cc:'',p3cd:'',p3ce:'',p3cf:'',p3d0:'', + p3d1:'',p3d2:'',p3d3:'',p3d4:'',p3d5:'',p3d6:'',p3d7:'',p3d8:'', + p3d9:'',p3da:'',p3db:'',p3dc:'',p3dd:'',p3de:'',p3df:'',p3e0:'', + p3e1:'',p3e2:'',p3e3:'',p3e4:'',p3e5:'',p3e6:'',p3e7:'',p3e8:'', + p3e9:'',p3ea:'',p3eb:'',p3ec:'',p3ed:'',p3ee:'',p3ef:'',p3f0:'', + p3f1:'',p3f2:'',p3f3:'',p3f4:'',p3f5:'',p3f6:'',p3f7:'',p3f8:'', + p3f9:'',p3fa:'',p3fb:'',p3fc:'',p3fd:'',p3fe:'',p3ff:'',p400:'', + p401:'',p402:'',p403:'',p404:'',p405:'',p406:'',p407:'',p408:'', + p409:'',p40a:'',p40b:'',p40c:'',p40d:'',p40e:'',p40f:'',p410:'', + p411:'',p412:'',p413:'',p414:'',p415:'',p416:'',p417:'',p418:'', + p419:'',p41a:'',p41b:'',p41c:'',p41d:'',p41e:'',p41f:'',p420:'', + p421:'',p422:'',p423:'',p424:'',p425:'',p426:'',p427:'',p428:'', + p429:'',p42a:'',p42b:'',p42c:'',p42d:'',p42e:'',p42f:'',p430:'', + p431:'',p432:'',p433:'',p434:'',p435:'',p436:'',p437:'',p438:'', + p439:'',p43a:'',p43b:'',p43c:'',p43d:'',p43e:'',p43f:'',p440:'', + p441:'',p442:'',p443:'',p444:'',p445:'',p446:'',p447:'',p448:'', + p449:'',p44a:'',p44b:'',p44c:'',p44d:'',p44e:'',p44f:'',p450:'', + p451:'',p452:'',p453:'',p454:'',p455:'',p456:'',p457:'',p458:'', + p459:'',p45a:'',p45b:'',p45c:'',p45d:'',p45e:'',p45f:'',p460:'', + p461:'',p462:'',p463:'',p464:'',p465:'',p466:'',p467:'',p468:'', + p469:'',p46a:'',p46b:'',p46c:'',p46d:'',p46e:'',p46f:'',p470:'', + p471:'',p472:'',p473:'',p474:'',p475:'',p476:'',p477:'',p478:'', + p479:'',p47a:'',p47b:'',p47c:'',p47d:'',p47e:'',p47f:'',p480:'', + p481:'',p482:'',p483:'',p484:'',p485:'',p486:'',p487:'',p488:'', + p489:'',p48a:'',p48b:'',p48c:'',p48d:'',p48e:'',p48f:'',p490:'', + p491:'',p492:'',p493:'',p494:'',p495:'',p496:'',p497:'',p498:'', + p499:'',p49a:'',p49b:'',p49c:'',p49d:'',p49e:'',p49f:'',p4a0:'', + p4a1:'',p4a2:'',p4a3:'',p4a4:'',p4a5:'',p4a6:'',p4a7:'',p4a8:'', + p4a9:'',p4aa:'',p4ab:'',p4ac:'',p4ad:'',p4ae:'',p4af:'',p4b0:'', + p4b1:'',p4b2:'',p4b3:'',p4b4:'',p4b5:'',p4b6:'',p4b7:'',p4b8:'', + p4b9:'',p4ba:'',p4bb:'',p4bc:'',p4bd:'',p4be:'',p4bf:'',p4c0:'', + p4c1:'',p4c2:'',p4c3:'',p4c4:'',p4c5:'',p4c6:'',p4c7:'',p4c8:'', + p4c9:'',p4ca:'',p4cb:'',p4cc:'',p4cd:'',p4ce:'',p4cf:'',p4d0:'', + p4d1:'',p4d2:'',p4d3:'',p4d4:'',p4d5:'',p4d6:'',p4d7:'',p4d8:'', + p4d9:'',p4da:'',p4db:'',p4dc:'',p4dd:'',p4de:'',p4df:'',p4e0:'', + p4e1:'',p4e2:'',p4e3:'',p4e4:'',p4e5:'',p4e6:'',p4e7:'',p4e8:'', + p4e9:'',p4ea:'',p4eb:'',p4ec:'',p4ed:'',p4ee:'',p4ef:'',p4f0:'', + p4f1:'',p4f2:'',p4f3:'',p4f4:'',p4f5:'',p4f6:'',p4f7:'',p4f8:'', + p4f9:'',p4fa:'',p4fb:'',p4fc:'',p4fd:'',p4fe:'',p4ff:'',p500:'', + p501:'',p502:'',p503:'',p504:'',p505:'',p506:'',p507:'',p508:'', + p509:'',p50a:'',p50b:'',p50c:'',p50d:'',p50e:'',p50f:'',p510:'', + p511:'',p512:'',p513:'',p514:'',p515:'',p516:'',p517:'',p518:'', + p519:'',p51a:'',p51b:'',p51c:'',p51d:'',p51e:'',p51f:'',p520:'', + p521:'',p522:'',p523:'',p524:'',p525:'',p526:'',p527:'',p528:'', + p529:'',p52a:'',p52b:'',p52c:'',p52d:'',p52e:'',p52f:'',p530:'', + p531:'',p532:'',p533:'',p534:'',p535:'',p536:'',p537:'',p538:'', + p539:'',p53a:'',p53b:'',p53c:'',p53d:'',p53e:'',p53f:'',p540:'', + p541:'',p542:'',p543:'',p544:'',p545:'',p546:'',p547:'',p548:'', + p549:'',p54a:'',p54b:'',p54c:'',p54d:'',p54e:'',p54f:'',p550:'', + p551:'',p552:'',p553:'',p554:'',p555:'',p556:'',p557:'',p558:'', + p559:'',p55a:'',p55b:'',p55c:'',p55d:'',p55e:'',p55f:'',p560:'', + p561:'',p562:'',p563:'',p564:'',p565:'',p566:'',p567:'',p568:'', + p569:'',p56a:'',p56b:'',p56c:'',p56d:'',p56e:'',p56f:'',p570:'', + p571:'',p572:'',p573:'',p574:'',p575:'',p576:'',p577:'',p578:'', + p579:'',p57a:'',p57b:'',p57c:'',p57d:'',p57e:'',p57f:'',p580:'', + p581:'',p582:'',p583:'',p584:'',p585:'',p586:'',p587:'',p588:'', + p589:'',p58a:'',p58b:'',p58c:'',p58d:'',p58e:'',p58f:'',p590:'', + p591:'',p592:'',p593:'',p594:'',p595:'',p596:'',p597:'',p598:'', + p599:'',p59a:'',p59b:'',p59c:'',p59d:'',p59e:'',p59f:'',p5a0:'', + p5a1:'',p5a2:'',p5a3:'',p5a4:'',p5a5:'',p5a6:'',p5a7:'',p5a8:'', + p5a9:'',p5aa:'',p5ab:'',p5ac:'',p5ad:'',p5ae:'',p5af:'',p5b0:'', + p5b1:'',p5b2:'',p5b3:'',p5b4:'',p5b5:'',p5b6:'',p5b7:'',p5b8:'', + p5b9:'',p5ba:'',p5bb:'',p5bc:'',p5bd:'',p5be:'',p5bf:'',p5c0:'', + p5c1:'',p5c2:'',p5c3:'',p5c4:'',p5c5:'',p5c6:'',p5c7:'',p5c8:'', + p5c9:'',p5ca:'',p5cb:'',p5cc:'',p5cd:'',p5ce:'',p5cf:'',p5d0:'', + p5d1:'',p5d2:'',p5d3:'',p5d4:'',p5d5:'',p5d6:'',p5d7:'',p5d8:'', + p5d9:'',p5da:'',p5db:'',p5dc:'',p5dd:'',p5de:'',p5df:'',p5e0:'', + p5e1:'',p5e2:'',p5e3:'',p5e4:'',p5e5:'',p5e6:'',p5e7:'',p5e8:'', + p5e9:'',p5ea:'',p5eb:'',p5ec:'',p5ed:'',p5ee:'',p5ef:'',p5f0:'', + p5f1:'',p5f2:'',p5f3:'',p5f4:'',p5f5:'',p5f6:'',p5f7:'',p5f8:'', + p5f9:'',p5fa:'',p5fb:'',p5fc:'',p5fd:'',p5fe:'',p5ff:'',p600:'', + p601:'',p602:'',p603:'',p604:'',p605:'',p606:'',p607:'',p608:'', + p609:'',p60a:'',p60b:'',p60c:'',p60d:'',p60e:'',p60f:'',p610:'', + p611:'',p612:'',p613:'',p614:'',p615:'',p616:'',p617:'',p618:'', + p619:'',p61a:'',p61b:'',p61c:'',p61d:'',p61e:'',p61f:'',p620:'', + p621:'',p622:'',p623:'',p624:'',p625:'',p626:'',p627:'',p628:'', + p629:'',p62a:'',p62b:'',p62c:'',p62d:'',p62e:'',p62f:'',p630:'', + p631:'',p632:'',p633:'',p634:'',p635:'',p636:'',p637:'',p638:'', + p639:'',p63a:'',p63b:'',p63c:'',p63d:'',p63e:'',p63f:'',p640:'', + p641:'',p642:'',p643:'',p644:'',p645:'',p646:'',p647:'',p648:'', + p649:'',p64a:'',p64b:'',p64c:'',p64d:'',p64e:'',p64f:'',p650:'', + p651:'',p652:'',p653:'',p654:'',p655:'',p656:'',p657:'',p658:'', + p659:'',p65a:'',p65b:'',p65c:'',p65d:'',p65e:'',p65f:'',p660:'', + p661:'',p662:'',p663:'',p664:'',p665:'',p666:'',p667:'',p668:'', + p669:'',p66a:'',p66b:'',p66c:'',p66d:'',p66e:'',p66f:'',p670:'', + p671:'',p672:'',p673:'',p674:'',p675:'',p676:'',p677:'',p678:'', + p679:'',p67a:'',p67b:'',p67c:'',p67d:'',p67e:'',p67f:'',p680:'', + p681:'',p682:'',p683:'',p684:'',p685:'',p686:'',p687:'',p688:'', + p689:'',p68a:'',p68b:'',p68c:'',p68d:'',p68e:'',p68f:'',p690:'', + p691:'',p692:'',p693:'',p694:'',p695:'',p696:'',p697:'',p698:'', + p699:'',p69a:'',p69b:'',p69c:'',p69d:'',p69e:'',p69f:'',p6a0:'', + p6a1:'',p6a2:'',p6a3:'',p6a4:'',p6a5:'',p6a6:'',p6a7:'',p6a8:'', + p6a9:'',p6aa:'',p6ab:'',p6ac:'',p6ad:'',p6ae:'',p6af:'',p6b0:'', + p6b1:'',p6b2:'',p6b3:'',p6b4:'',p6b5:'',p6b6:'',p6b7:'',p6b8:'', + p6b9:'',p6ba:'',p6bb:'',p6bc:'',p6bd:'',p6be:'',p6bf:'',p6c0:'', + p6c1:'',p6c2:'',p6c3:'',p6c4:'',p6c5:'',p6c6:'',p6c7:'',p6c8:'', + p6c9:'',p6ca:'',p6cb:'',p6cc:'',p6cd:'',p6ce:'',p6cf:'',p6d0:'', + p6d1:'',p6d2:'',p6d3:'',p6d4:'',p6d5:'',p6d6:'',p6d7:'',p6d8:'', + p6d9:'',p6da:'',p6db:'',p6dc:'',p6dd:'',p6de:'',p6df:'',p6e0:'', + p6e1:'',p6e2:'',p6e3:'',p6e4:'',p6e5:'',p6e6:'',p6e7:'',p6e8:'', + p6e9:'',p6ea:'',p6eb:'',p6ec:'',p6ed:'',p6ee:'',p6ef:'',p6f0:'', + p6f1:'',p6f2:'',p6f3:'',p6f4:'',p6f5:'',p6f6:'',p6f7:'',p6f8:'', + p6f9:'',p6fa:'',p6fb:'',p6fc:'',p6fd:'',p6fe:'',p6ff:'',p700:'', + p701:'',p702:'',p703:'',p704:'',p705:'',p706:'',p707:'',p708:'', + p709:'',p70a:'',p70b:'',p70c:'',p70d:'',p70e:'',p70f:'',p710:'', + p711:'',p712:'',p713:'',p714:'',p715:'',p716:'',p717:'',p718:'', + p719:'',p71a:'',p71b:'',p71c:'',p71d:'',p71e:'',p71f:'',p720:'', + p721:'',p722:'',p723:'',p724:'',p725:'',p726:'',p727:'',p728:'', + p729:'',p72a:'',p72b:'',p72c:'',p72d:'',p72e:'',p72f:'',p730:'', + p731:'',p732:'',p733:'',p734:'',p735:'',p736:'',p737:'',p738:'', + p739:'',p73a:'',p73b:'',p73c:'',p73d:'',p73e:'',p73f:'',p740:'', + p741:'',p742:'',p743:'',p744:'',p745:'',p746:'',p747:'',p748:'', + p749:'',p74a:'',p74b:'',p74c:'',p74d:'',p74e:'',p74f:'',p750:'', + p751:'',p752:'',p753:'',p754:'',p755:'',p756:'',p757:'',p758:'', + p759:'',p75a:'',p75b:'',p75c:'',p75d:'',p75e:'',p75f:'',p760:'', + p761:'',p762:'',p763:'',p764:'',p765:'',p766:'',p767:'',p768:'', + p769:'',p76a:'',p76b:'',p76c:'',p76d:'',p76e:'',p76f:'',p770:'', + p771:'',p772:'',p773:'',p774:'',p775:'',p776:'',p777:'',p778:'', + p779:'',p77a:'',p77b:'',p77c:'',p77d:'',p77e:'',p77f:'',p780:'', + p781:'',p782:'',p783:'',p784:'',p785:'',p786:'',p787:'',p788:'', + p789:'',p78a:'',p78b:'',p78c:'',p78d:'',p78e:'',p78f:'',p790:'', + p791:'',p792:'',p793:'',p794:'',p795:'',p796:'',p797:'',p798:'', + p799:'',p79a:'',p79b:'',p79c:'',p79d:'',p79e:'',p79f:'',p7a0:'', + p7a1:'',p7a2:'',p7a3:'',p7a4:'',p7a5:'',p7a6:'',p7a7:'',p7a8:'', + p7a9:'',p7aa:'',p7ab:'',p7ac:'',p7ad:'',p7ae:'',p7af:'',p7b0:'', + p7b1:'',p7b2:'',p7b3:'',p7b4:'',p7b5:'',p7b6:'',p7b7:'',p7b8:'', + p7b9:'',p7ba:'',p7bb:'',p7bc:'',p7bd:'',p7be:'',p7bf:'',p7c0:'', + p7c1:'',p7c2:'',p7c3:'',p7c4:'',p7c5:'',p7c6:'',p7c7:'',p7c8:'', + p7c9:'',p7ca:'',p7cb:'',p7cc:'',p7cd:'',p7ce:'',p7cf:'',p7d0:'', + p7d1:'',p7d2:'',p7d3:'',p7d4:'',p7d5:'',p7d6:'',p7d7:'',p7d8:'', + p7d9:'',p7da:'',p7db:'',p7dc:'',p7dd:'',p7de:'',p7df:'',p7e0:'', + p7e1:'',p7e2:'',p7e3:'',p7e4:'',p7e5:'',p7e6:'',p7e7:'',p7e8:'', + p7e9:'',p7ea:'',p7eb:'',p7ec:'',p7ed:'',p7ee:'',p7ef:'',p7f0:'', + p7f1:'',p7f2:'',p7f3:'',p7f4:'',p7f5:'',p7f6:'',p7f7:'',p7f8:'', + p7f9:'',p7fa:'',p7fb:'',p7fc:'',p7fd:'',p7fe:'',p7ff:'',p800:'', + p801:'',p802:'',p803:'',p804:'',p805:'',p806:'',p807:'',p808:'', + p809:'',p80a:'',p80b:'',p80c:'',p80d:'',p80e:'',p80f:'',p810:'', + p811:'',p812:'',p813:'',p814:'',p815:'',p816:'',p817:'',p818:'', + p819:'',p81a:'',p81b:'',p81c:'',p81d:'',p81e:'',p81f:'',p820:'', + p821:'',p822:'',p823:'',p824:'',p825:'',p826:'',p827:'',p828:'', + p829:'',p82a:'',p82b:'',p82c:'',p82d:'',p82e:'',p82f:'',p830:'', + p831:'',p832:'',p833:'',p834:'',p835:'',p836:'',p837:'',p838:'', + p839:'',p83a:'',p83b:'',p83c:'',p83d:'',p83e:'',p83f:'',p840:'', + p841:'',p842:'',p843:'',p844:'',p845:'',p846:'',p847:'',p848:'', + p849:'',p84a:'',p84b:'',p84c:'',p84d:'',p84e:'',p84f:'',p850:'', + p851:'',p852:'',p853:'',p854:'',p855:'',p856:'',p857:'',p858:'', + p859:'',p85a:'',p85b:'',p85c:'',p85d:'',p85e:'',p85f:'',p860:'', + p861:'',p862:'',p863:'',p864:'',p865:'',p866:'',p867:'',p868:'', + p869:'',p86a:'',p86b:'',p86c:'',p86d:'',p86e:'',p86f:'',p870:'', + p871:'',p872:'',p873:'',p874:'',p875:'',p876:'',p877:'',p878:'', + p879:'',p87a:'',p87b:'',p87c:'',p87d:'',p87e:'',p87f:'',p880:'', + p881:'',p882:'',p883:'',p884:'',p885:'',p886:'',p887:'',p888:'', + p889:'',p88a:'',p88b:'',p88c:'',p88d:'',p88e:'',p88f:'',p890:'', + p891:'',p892:'',p893:'',p894:'',p895:'',p896:'',p897:'',p898:'', + p899:'',p89a:'',p89b:'',p89c:'',p89d:'',p89e:'',p89f:'',p8a0:'', + p8a1:'',p8a2:'',p8a3:'',p8a4:'',p8a5:'',p8a6:'',p8a7:'',p8a8:'', + p8a9:'',p8aa:'',p8ab:'',p8ac:'',p8ad:'',p8ae:'',p8af:'',p8b0:'', + p8b1:'',p8b2:'',p8b3:'',p8b4:'',p8b5:'',p8b6:'',p8b7:'',p8b8:'', + p8b9:'',p8ba:'',p8bb:'',p8bc:'',p8bd:'',p8be:'',p8bf:'',p8c0:'', + p8c1:'',p8c2:'',p8c3:'',p8c4:'',p8c5:'',p8c6:'',p8c7:'',p8c8:'', + p8c9:'',p8ca:'',p8cb:'',p8cc:'',p8cd:'',p8ce:'',p8cf:'',p8d0:'', + p8d1:'',p8d2:'',p8d3:'',p8d4:'',p8d5:'',p8d6:'',p8d7:'',p8d8:'', + p8d9:'',p8da:'',p8db:'',p8dc:'',p8dd:'',p8de:'',p8df:'',p8e0:'', + p8e1:'',p8e2:'',p8e3:'',p8e4:'',p8e5:'',p8e6:'',p8e7:'',p8e8:'', + p8e9:'',p8ea:'',p8eb:'',p8ec:'',p8ed:'',p8ee:'',p8ef:'',p8f0:'', + p8f1:'',p8f2:'',p8f3:'',p8f4:'',p8f5:'',p8f6:'',p8f7:'',p8f8:'', + p8f9:'',p8fa:'',p8fb:'',p8fc:'',p8fd:'',p8fe:'',p8ff:'',p900:'', + p901:'',p902:'',p903:'',p904:'',p905:'',p906:'',p907:'',p908:'', + p909:'',p90a:'',p90b:'',p90c:'',p90d:'',p90e:'',p90f:'',p910:'', + p911:'',p912:'',p913:'',p914:'',p915:'',p916:'',p917:'',p918:'', + p919:'',p91a:'',p91b:'',p91c:'',p91d:'',p91e:'',p91f:'',p920:'', + p921:'',p922:'',p923:'',p924:'',p925:'',p926:'',p927:'',p928:'', + p929:'',p92a:'',p92b:'',p92c:'',p92d:'',p92e:'',p92f:'',p930:'', + p931:'',p932:'',p933:'',p934:'',p935:'',p936:'',p937:'',p938:'', + p939:'',p93a:'',p93b:'',p93c:'',p93d:'',p93e:'',p93f:'',p940:'', + p941:'',p942:'',p943:'',p944:'',p945:'',p946:'',p947:'',p948:'', + p949:'',p94a:'',p94b:'',p94c:'',p94d:'',p94e:'',p94f:'',p950:'', + p951:'',p952:'',p953:'',p954:'',p955:'',p956:'',p957:'',p958:'', + p959:'',p95a:'',p95b:'',p95c:'',p95d:'',p95e:'',p95f:'',p960:'', + p961:'',p962:'',p963:'',p964:'',p965:'',p966:'',p967:'',p968:'', + p969:'',p96a:'',p96b:'',p96c:'',p96d:'',p96e:'',p96f:'',p970:'', + p971:'',p972:'',p973:'',p974:'',p975:'',p976:'',p977:'',p978:'', + p979:'',p97a:'',p97b:'',p97c:'',p97d:'',p97e:'',p97f:'',p980:'', + p981:'',p982:'',p983:'',p984:'',p985:'',p986:'',p987:'',p988:'', + p989:'',p98a:'',p98b:'',p98c:'',p98d:'',p98e:'',p98f:'',p990:'', + p991:'',p992:'',p993:'',p994:'',p995:'',p996:'',p997:'',p998:'', + p999:'',p99a:'',p99b:'',p99c:'',p99d:'',p99e:'',p99f:'',p9a0:'', + p9a1:'',p9a2:'',p9a3:'',p9a4:'',p9a5:'',p9a6:'',p9a7:'',p9a8:'', + p9a9:'',p9aa:'',p9ab:'',p9ac:'',p9ad:'',p9ae:'',p9af:'',p9b0:'', + p9b1:'',p9b2:'',p9b3:'',p9b4:'',p9b5:'',p9b6:'',p9b7:'',p9b8:'', + p9b9:'',p9ba:'',p9bb:'',p9bc:'',p9bd:'',p9be:'',p9bf:'',p9c0:'', + p9c1:'',p9c2:'',p9c3:'',p9c4:'',p9c5:'',p9c6:'',p9c7:'',p9c8:'', + p9c9:'',p9ca:'',p9cb:'',p9cc:'',p9cd:'',p9ce:'',p9cf:'',p9d0:'', + p9d1:'',p9d2:'',p9d3:'',p9d4:'',p9d5:'',p9d6:'',p9d7:'',p9d8:'', + p9d9:'',p9da:'',p9db:'',p9dc:'',p9dd:'',p9de:'',p9df:'',p9e0:'', + p9e1:'',p9e2:'',p9e3:'',p9e4:'',p9e5:'',p9e6:'',p9e7:'',p9e8:'', + p9e9:'',p9ea:'',p9eb:'',p9ec:'',p9ed:'',p9ee:'',p9ef:'',p9f0:'', + p9f1:'',p9f2:'',p9f3:'',p9f4:'',p9f5:'',p9f6:'',p9f7:'',p9f8:'', + p9f9:'',p9fa:'',p9fb:'',p9fc:'',p9fd:'',p9fe:'',p9ff:'',pa00:'', + pa01:'',pa02:'',pa03:'',pa04:'',pa05:'',pa06:'',pa07:'',pa08:'', + pa09:'',pa0a:'',pa0b:'',pa0c:'',pa0d:'',pa0e:'',pa0f:'',pa10:'', + pa11:'',pa12:'',pa13:'',pa14:'',pa15:'',pa16:'',pa17:'',pa18:'', + pa19:'',pa1a:'',pa1b:'',pa1c:'',pa1d:'',pa1e:'',pa1f:'',pa20:'', + pa21:'',pa22:'',pa23:'',pa24:'',pa25:'',pa26:'',pa27:'',pa28:'', + pa29:'',pa2a:'',pa2b:'',pa2c:'',pa2d:'',pa2e:'',pa2f:'',pa30:'', + pa31:'',pa32:'',pa33:'',pa34:'',pa35:'',pa36:'',pa37:'',pa38:'', + pa39:'',pa3a:'',pa3b:'',pa3c:'',pa3d:'',pa3e:'',pa3f:'',pa40:'', + pa41:'',pa42:'',pa43:'',pa44:'',pa45:'',pa46:'',pa47:'',pa48:'', + pa49:'',pa4a:'',pa4b:'',pa4c:'',pa4d:'',pa4e:'',pa4f:'',pa50:'', + pa51:'',pa52:'',pa53:'',pa54:'',pa55:'',pa56:'',pa57:'',pa58:'', + pa59:'',pa5a:'',pa5b:'',pa5c:'',pa5d:'',pa5e:'',pa5f:'',pa60:'', + pa61:'',pa62:'',pa63:'',pa64:'',pa65:'',pa66:'',pa67:'',pa68:'', + pa69:'',pa6a:'',pa6b:'',pa6c:'',pa6d:'',pa6e:'',pa6f:'',pa70:'', + pa71:'',pa72:'',pa73:'',pa74:'',pa75:'',pa76:'',pa77:'',pa78:'', + pa79:'',pa7a:'',pa7b:'',pa7c:'',pa7d:'',pa7e:'',pa7f:'',pa80:'', + pa81:'',pa82:'',pa83:'',pa84:'',pa85:'',pa86:'',pa87:'',pa88:'', + pa89:'',pa8a:'',pa8b:'',pa8c:'',pa8d:'',pa8e:'',pa8f:'',pa90:'', + pa91:'',pa92:'',pa93:'',pa94:'',pa95:'',pa96:'',pa97:'',pa98:'', + pa99:'',pa9a:'',pa9b:'',pa9c:'',pa9d:'',pa9e:'',pa9f:'',paa0:'', + paa1:'',paa2:'',paa3:'',paa4:'',paa5:'',paa6:'',paa7:'',paa8:'', + paa9:'',paaa:'',paab:'',paac:'',paad:'',paae:'',paaf:'',pab0:'', + pab1:'',pab2:'',pab3:'',pab4:'',pab5:'',pab6:'',pab7:'',pab8:'', + pab9:'',paba:'',pabb:'',pabc:'',pabd:'',pabe:'',pabf:'',pac0:'', + pac1:'',pac2:'',pac3:'',pac4:'',pac5:'',pac6:'',pac7:'',pac8:'', + pac9:'',paca:'',pacb:'',pacc:'',pacd:'',pace:'',pacf:'',pad0:'', + pad1:'',pad2:'',pad3:'',pad4:'',pad5:'',pad6:'',pad7:'',pad8:'', + pad9:'',pada:'',padb:'',padc:'',padd:'',pade:'',padf:'',pae0:'', + pae1:'',pae2:'',pae3:'',pae4:'',pae5:'',pae6:'',pae7:'',pae8:'', + pae9:'',paea:'',paeb:'',paec:'',paed:'',paee:'',paef:'',paf0:'', + paf1:'',paf2:'',paf3:'',paf4:'',paf5:'',paf6:'',paf7:'',paf8:'', + paf9:'',pafa:'',pafb:'',pafc:'',pafd:'',pafe:'',paff:'',pb00:'', + pb01:'',pb02:'',pb03:'',pb04:'',pb05:'',pb06:'',pb07:'',pb08:'', + pb09:'',pb0a:'',pb0b:'',pb0c:'',pb0d:'',pb0e:'',pb0f:'',pb10:'', + pb11:'',pb12:'',pb13:'',pb14:'',pb15:'',pb16:'',pb17:'',pb18:'', + pb19:'',pb1a:'',pb1b:'',pb1c:'',pb1d:'',pb1e:'',pb1f:'',pb20:'', + pb21:'',pb22:'',pb23:'',pb24:'',pb25:'',pb26:'',pb27:'',pb28:'', + pb29:'',pb2a:'',pb2b:'',pb2c:'',pb2d:'',pb2e:'',pb2f:'',pb30:'', + pb31:'',pb32:'',pb33:'',pb34:'',pb35:'',pb36:'',pb37:'',pb38:'', + pb39:'',pb3a:'',pb3b:'',pb3c:'',pb3d:'',pb3e:'',pb3f:'',pb40:'', + pb41:'',pb42:'',pb43:'',pb44:'',pb45:'',pb46:'',pb47:'',pb48:'', + pb49:'',pb4a:'',pb4b:'',pb4c:'',pb4d:'',pb4e:'',pb4f:'',pb50:'', + pb51:'',pb52:'',pb53:'',pb54:'',pb55:'',pb56:'',pb57:'',pb58:'', + pb59:'',pb5a:'',pb5b:'',pb5c:'',pb5d:'',pb5e:'',pb5f:'',pb60:'', + pb61:'',pb62:'',pb63:'',pb64:'',pb65:'',pb66:'',pb67:'',pb68:'', + pb69:'',pb6a:'',pb6b:'',pb6c:'',pb6d:'',pb6e:'',pb6f:'',pb70:'', + pb71:'',pb72:'',pb73:'',pb74:'',pb75:'',pb76:'',pb77:'',pb78:'', + pb79:'',pb7a:'',pb7b:'',pb7c:'',pb7d:'',pb7e:'',pb7f:'',pb80:'', + pb81:'',pb82:'',pb83:'',pb84:'',pb85:'',pb86:'',pb87:'',pb88:'', + pb89:'',pb8a:'',pb8b:'',pb8c:'',pb8d:'',pb8e:'',pb8f:'',pb90:'', + pb91:'',pb92:'',pb93:'',pb94:'',pb95:'',pb96:'',pb97:'',pb98:'', + pb99:'',pb9a:'',pb9b:'',pb9c:'',pb9d:'',pb9e:'',pb9f:'',pba0:'', + pba1:'',pba2:'',pba3:'',pba4:'',pba5:'',pba6:'',pba7:'',pba8:'', + pba9:'',pbaa:'',pbab:'',pbac:'',pbad:'',pbae:'',pbaf:'',pbb0:'', + pbb1:'',pbb2:'',pbb3:'',pbb4:'',pbb5:'',pbb6:'',pbb7:'',pbb8:'', + pbb9:'',pbba:'',pbbb:'',pbbc:'',pbbd:'',pbbe:'',pbbf:'',pbc0:'', + pbc1:'',pbc2:'',pbc3:'',pbc4:'',pbc5:'',pbc6:'',pbc7:'',pbc8:'', + pbc9:'',pbca:'',pbcb:'',pbcc:'',pbcd:'',pbce:'',pbcf:'',pbd0:'', + pbd1:'',pbd2:'',pbd3:'',pbd4:'',pbd5:'',pbd6:'',pbd7:'',pbd8:'', + pbd9:'',pbda:'',pbdb:'',pbdc:'',pbdd:'',pbde:'',pbdf:'',pbe0:'', + pbe1:'',pbe2:'',pbe3:'',pbe4:'',pbe5:'',pbe6:'',pbe7:'',pbe8:'', + pbe9:'',pbea:'',pbeb:'',pbec:'',pbed:'',pbee:'',pbef:'',pbf0:'', + pbf1:'',pbf2:'',pbf3:'',pbf4:'',pbf5:'',pbf6:'',pbf7:'',pbf8:'', + pbf9:'',pbfa:'',pbfb:'',pbfc:'',pbfd:'',pbfe:'',pbff:'',pc00:'', + pc01:'',pc02:'',pc03:'',pc04:'',pc05:'',pc06:'',pc07:'',pc08:'', + pc09:'',pc0a:'',pc0b:'',pc0c:'',pc0d:'',pc0e:'',pc0f:'',pc10:'', + pc11:'',pc12:'',pc13:'',pc14:'',pc15:'',pc16:'',pc17:'',pc18:'', + pc19:'',pc1a:'',pc1b:'',pc1c:'',pc1d:'',pc1e:'',pc1f:'',pc20:'', + pc21:'',pc22:'',pc23:'',pc24:'',pc25:'',pc26:'',pc27:'',pc28:'', + pc29:'',pc2a:'',pc2b:'',pc2c:'',pc2d:'',pc2e:'',pc2f:'',pc30:'', + pc31:'',pc32:'',pc33:'',pc34:'',pc35:'',pc36:'',pc37:'',pc38:'', + pc39:'',pc3a:'',pc3b:'',pc3c:'',pc3d:'',pc3e:'',pc3f:'',pc40:'', + pc41:'',pc42:'',pc43:'',pc44:'',pc45:'',pc46:'',pc47:'',pc48:'', + pc49:'',pc4a:'',pc4b:'',pc4c:'',pc4d:'',pc4e:'',pc4f:'',pc50:'', + pc51:'',pc52:'',pc53:'',pc54:'',pc55:'',pc56:'',pc57:'',pc58:'', + pc59:'',pc5a:'',pc5b:'',pc5c:'',pc5d:'',pc5e:'',pc5f:'',pc60:'', + pc61:'',pc62:'',pc63:'',pc64:'',pc65:'',pc66:'',pc67:'',pc68:'', + pc69:'',pc6a:'',pc6b:'',pc6c:'',pc6d:'',pc6e:'',pc6f:'',pc70:'', + pc71:'',pc72:'',pc73:'',pc74:'',pc75:'',pc76:'',pc77:'',pc78:'', + pc79:'',pc7a:'',pc7b:'',pc7c:'',pc7d:'',pc7e:'',pc7f:'',pc80:'', + pc81:'',pc82:'',pc83:'',pc84:'',pc85:'',pc86:'',pc87:'',pc88:'', + pc89:'',pc8a:'',pc8b:'',pc8c:'',pc8d:'',pc8e:'',pc8f:'',pc90:'', + pc91:'',pc92:'',pc93:'',pc94:'',pc95:'',pc96:'',pc97:'',pc98:'', + pc99:'',pc9a:'',pc9b:'',pc9c:'',pc9d:'',pc9e:'',pc9f:'',pca0:'', + pca1:'',pca2:'',pca3:'',pca4:'',pca5:'',pca6:'',pca7:'',pca8:'', + pca9:'',pcaa:'',pcab:'',pcac:'',pcad:'',pcae:'',pcaf:'',pcb0:'', + pcb1:'',pcb2:'',pcb3:'',pcb4:'',pcb5:'',pcb6:'',pcb7:'',pcb8:'', + pcb9:'',pcba:'',pcbb:'',pcbc:'',pcbd:'',pcbe:'',pcbf:'',pcc0:'', + pcc1:'',pcc2:'',pcc3:'',pcc4:'',pcc5:'',pcc6:'',pcc7:'',pcc8:'', + pcc9:'',pcca:'',pccb:'',pccc:'',pccd:'',pcce:'',pccf:'',pcd0:'', + pcd1:'',pcd2:'',pcd3:'',pcd4:'',pcd5:'',pcd6:'',pcd7:'',pcd8:'', + pcd9:'',pcda:'',pcdb:'',pcdc:'',pcdd:'',pcde:'',pcdf:'',pce0:'', + pce1:'',pce2:'',pce3:'',pce4:'',pce5:'',pce6:'',pce7:'',pce8:'', + pce9:'',pcea:'',pceb:'',pcec:'',pced:'',pcee:'',pcef:'',pcf0:'', + pcf1:'',pcf2:'',pcf3:'',pcf4:'',pcf5:'',pcf6:'',pcf7:'',pcf8:'', + pcf9:'',pcfa:'',pcfb:'',pcfc:'',pcfd:'',pcfe:'',pcff:'',pd00:'', + pd01:'',pd02:'',pd03:'',pd04:'',pd05:'',pd06:'',pd07:'',pd08:'', + pd09:'',pd0a:'',pd0b:'',pd0c:'',pd0d:'',pd0e:'',pd0f:'',pd10:'', + pd11:'',pd12:'',pd13:'',pd14:'',pd15:'',pd16:'',pd17:'',pd18:'', + pd19:'',pd1a:'',pd1b:'',pd1c:'',pd1d:'',pd1e:'',pd1f:'',pd20:'', + pd21:'',pd22:'',pd23:'',pd24:'',pd25:'',pd26:'',pd27:'',pd28:'', + pd29:'',pd2a:'',pd2b:'',pd2c:'',pd2d:'',pd2e:'',pd2f:'',pd30:'', + pd31:'',pd32:'',pd33:'',pd34:'',pd35:'',pd36:'',pd37:'',pd38:'', + pd39:'',pd3a:'',pd3b:'',pd3c:'',pd3d:'',pd3e:'',pd3f:'',pd40:'', + pd41:'',pd42:'',pd43:'',pd44:'',pd45:'',pd46:'',pd47:'',pd48:'', + pd49:'',pd4a:'',pd4b:'',pd4c:'',pd4d:'',pd4e:'',pd4f:'',pd50:'', + pd51:'',pd52:'',pd53:'',pd54:'',pd55:'',pd56:'',pd57:'',pd58:'', + pd59:'',pd5a:'',pd5b:'',pd5c:'',pd5d:'',pd5e:'',pd5f:'',pd60:'', + pd61:'',pd62:'',pd63:'',pd64:'',pd65:'',pd66:'',pd67:'',pd68:'', + pd69:'',pd6a:'',pd6b:'',pd6c:'',pd6d:'',pd6e:'',pd6f:'',pd70:'', + pd71:'',pd72:'',pd73:'',pd74:'',pd75:'',pd76:'',pd77:'',pd78:'', + pd79:'',pd7a:'',pd7b:'',pd7c:'',pd7d:'',pd7e:'',pd7f:'',pd80:'', + pd81:'',pd82:'',pd83:'',pd84:'',pd85:'',pd86:'',pd87:'',pd88:'', + pd89:'',pd8a:'',pd8b:'',pd8c:'',pd8d:'',pd8e:'',pd8f:'',pd90:'', + pd91:'',pd92:'',pd93:'',pd94:'',pd95:'',pd96:'',pd97:'',pd98:'', + pd99:'',pd9a:'',pd9b:'',pd9c:'',pd9d:'',pd9e:'',pd9f:'',pda0:'', + pda1:'',pda2:'',pda3:'',pda4:'',pda5:'',pda6:'',pda7:'',pda8:'', + pda9:'',pdaa:'',pdab:'',pdac:'',pdad:'',pdae:'',pdaf:'',pdb0:'', + pdb1:'',pdb2:'',pdb3:'',pdb4:'',pdb5:'',pdb6:'',pdb7:'',pdb8:'', + pdb9:'',pdba:'',pdbb:'',pdbc:'',pdbd:'',pdbe:'',pdbf:'',pdc0:'', + pdc1:'',pdc2:'',pdc3:'',pdc4:'',pdc5:'',pdc6:'',pdc7:'',pdc8:'', + pdc9:'',pdca:'',pdcb:'',pdcc:'',pdcd:'',pdce:'',pdcf:'',pdd0:'', + pdd1:'',pdd2:'',pdd3:'',pdd4:'',pdd5:'',pdd6:'',pdd7:'',pdd8:'', + pdd9:'',pdda:'',pddb:'',pddc:'',pddd:'',pdde:'',pddf:'',pde0:'', + pde1:'',pde2:'',pde3:'',pde4:'',pde5:'',pde6:'',pde7:'',pde8:'', + pde9:'',pdea:'',pdeb:'',pdec:'',pded:'',pdee:'',pdef:'',pdf0:'', + pdf1:'',pdf2:'',pdf3:'',pdf4:'',pdf5:'',pdf6:'',pdf7:'',pdf8:'', + pdf9:'',pdfa:'',pdfb:'',pdfc:'',pdfd:'',pdfe:'',pdff:'',pe00:'', + pe01:'',pe02:'',pe03:'',pe04:'',pe05:'',pe06:'',pe07:'',pe08:'', + pe09:'',pe0a:'',pe0b:'',pe0c:'',pe0d:'',pe0e:'',pe0f:'',pe10:'', + pe11:'',pe12:'',pe13:'',pe14:'',pe15:'',pe16:'',pe17:'',pe18:'', + pe19:'',pe1a:'',pe1b:'',pe1c:'',pe1d:'',pe1e:'',pe1f:'',pe20:'', + pe21:'',pe22:'',pe23:'',pe24:'',pe25:'',pe26:'',pe27:'',pe28:'', + pe29:'',pe2a:'',pe2b:'',pe2c:'',pe2d:'',pe2e:'',pe2f:'',pe30:'', + pe31:'',pe32:'',pe33:'',pe34:'',pe35:'',pe36:'',pe37:'',pe38:'', + pe39:'',pe3a:'',pe3b:'',pe3c:'',pe3d:'',pe3e:'',pe3f:'',pe40:'', + pe41:'',pe42:'',pe43:'',pe44:'',pe45:'',pe46:'',pe47:'',pe48:'', + pe49:'',pe4a:'',pe4b:'',pe4c:'',pe4d:'',pe4e:'',pe4f:'',pe50:'', + pe51:'',pe52:'',pe53:'',pe54:'',pe55:'',pe56:'',pe57:'',pe58:'', + pe59:'',pe5a:'',pe5b:'',pe5c:'',pe5d:'',pe5e:'',pe5f:'',pe60:'', + pe61:'',pe62:'',pe63:'',pe64:'',pe65:'',pe66:'',pe67:'',pe68:'', + pe69:'',pe6a:'',pe6b:'',pe6c:'',pe6d:'',pe6e:'',pe6f:'',pe70:'', + pe71:'',pe72:'',pe73:'',pe74:'',pe75:'',pe76:'',pe77:'',pe78:'', + pe79:'',pe7a:'',pe7b:'',pe7c:'',pe7d:'',pe7e:'',pe7f:'',pe80:'', + pe81:'',pe82:'',pe83:'',pe84:'',pe85:'',pe86:'',pe87:'',pe88:'', + pe89:'',pe8a:'',pe8b:'',pe8c:'',pe8d:'',pe8e:'',pe8f:'',pe90:'', + pe91:'',pe92:'',pe93:'',pe94:'',pe95:'',pe96:'',pe97:'',pe98:'', + pe99:'',pe9a:'',pe9b:'',pe9c:'',pe9d:'',pe9e:'',pe9f:'',pea0:'', + pea1:'',pea2:'',pea3:'',pea4:'',pea5:'',pea6:'',pea7:'',pea8:'', + pea9:'',peaa:'',peab:'',peac:'',pead:'',peae:'',peaf:'',peb0:'', + peb1:'',peb2:'',peb3:'',peb4:'',peb5:'',peb6:'',peb7:'',peb8:'', + peb9:'',peba:'',pebb:'',pebc:'',pebd:'',pebe:'',pebf:'',pec0:'', + pec1:'',pec2:'',pec3:'',pec4:'',pec5:'',pec6:'',pec7:'',pec8:'', + pec9:'',peca:'',pecb:'',pecc:'',pecd:'',pece:'',pecf:'',ped0:'', + ped1:'',ped2:'',ped3:'',ped4:'',ped5:'',ped6:'',ped7:'',ped8:'', + ped9:'',peda:'',pedb:'',pedc:'',pedd:'',pede:'',pedf:'',pee0:'', + pee1:'',pee2:'',pee3:'',pee4:'',pee5:'',pee6:'',pee7:'',pee8:'', + pee9:'',peea:'',peeb:'',peec:'',peed:'',peee:'',peef:'',pef0:'', + pef1:'',pef2:'',pef3:'',pef4:'',pef5:'',pef6:'',pef7:'',pef8:'', + pef9:'',pefa:'',pefb:'',pefc:'',pefd:'',pefe:'',peff:'',pf00:'', + pf01:'',pf02:'',pf03:'',pf04:'',pf05:'',pf06:'',pf07:'',pf08:'', + pf09:'',pf0a:'',pf0b:'',pf0c:'',pf0d:'',pf0e:'',pf0f:'',pf10:'', + pf11:'',pf12:'',pf13:'',pf14:'',pf15:'',pf16:'',pf17:'',pf18:'', + pf19:'',pf1a:'',pf1b:'',pf1c:'',pf1d:'',pf1e:'',pf1f:'',pf20:'', + pf21:'',pf22:'',pf23:'',pf24:'',pf25:'',pf26:'',pf27:'',pf28:'', + pf29:'',pf2a:'',pf2b:'',pf2c:'',pf2d:'',pf2e:'',pf2f:'',pf30:'', + pf31:'',pf32:'',pf33:'',pf34:'',pf35:'',pf36:'',pf37:'',pf38:'', + pf39:'',pf3a:'',pf3b:'',pf3c:'',pf3d:'',pf3e:'',pf3f:'',pf40:'', + pf41:'',pf42:'',pf43:'',pf44:'',pf45:'',pf46:'',pf47:'',pf48:'', + pf49:'',pf4a:'',pf4b:'',pf4c:'',pf4d:'',pf4e:'',pf4f:'',pf50:'', + pf51:'',pf52:'',pf53:'',pf54:'',pf55:'',pf56:'',pf57:'',pf58:'', + pf59:'',pf5a:'',pf5b:'',pf5c:'',pf5d:'',pf5e:'',pf5f:'',pf60:'', + pf61:'',pf62:'',pf63:'',pf64:'',pf65:'',pf66:'',pf67:'',pf68:'', + pf69:'',pf6a:'',pf6b:'',pf6c:'',pf6d:'',pf6e:'',pf6f:'',pf70:'', + pf71:'',pf72:'',pf73:'',pf74:'',pf75:'',pf76:'',pf77:'',pf78:'', + pf79:'',pf7a:'',pf7b:'',pf7c:'',pf7d:'',pf7e:'',pf7f:'',pf80:'', + pf81:'',pf82:'',pf83:'',pf84:'',pf85:'',pf86:'',pf87:'',pf88:'', + pf89:'',pf8a:'',pf8b:'',pf8c:'',pf8d:'',pf8e:'',pf8f:'',pf90:'', + pf91:'',pf92:'',pf93:'',pf94:'',pf95:'',pf96:'',pf97:'',pf98:'', + pf99:'',pf9a:'',pf9b:'',pf9c:'',pf9d:'',pf9e:'',pf9f:'',pfa0:'', + pfa1:'',pfa2:'',pfa3:'',pfa4:'',pfa5:'',pfa6:'',pfa7:'',pfa8:'', + pfa9:'',pfaa:'',pfab:'',pfac:'',pfad:'',pfae:'',pfaf:'',pfb0:'', + pfb1:'',pfb2:'',pfb3:'',pfb4:'',pfb5:'',pfb6:'',pfb7:'',pfb8:'', + pfb9:'',pfba:'',pfbb:'',pfbc:'',pfbd:'',pfbe:'',pfbf:'',pfc0:'', + pfc1:'',pfc2:'',pfc3:'',pfc4:'',pfc5:'',pfc6:'',pfc7:'',pfc8:'', + pfc9:'',pfca:'',pfcb:'',pfcc:'',pfcd:'',pfce:'',pfcf:'',pfd0:'', + pfd1:'',pfd2:'',pfd3:'',pfd4:'',pfd5:'',pfd6:'',pfd7:'',pfd8:'', + pfd9:'',pfda:'',pfdb:'',pfdc:'',pfdd:'',pfde:'',pfdf:'',pfe0:'', + pfe1:'',pfe2:'',pfe3:'',pfe4:'',pfe5:'',pfe6:'',pfe7:'',pfe8:'', + pfe9:'',pfea:'',pfeb:'',pfec:'',pfed:'',pfee:'',pfef:'',pff0:'', + pff1:'',pff2:'',pff3:'',pff4:'',pff5:'',pff6:'',pff7:'',pff8:'', + pff9:'',pffa:'',pffb:'',pffc:'',pffd:'',pffe:'',pfff:'',p1000:'', + p1001:'',p1002:'',p1003:'',p1004:'',p1005:'',p1006:'',p1007:'',p1008:'', + p1009:'',p100a:'',p100b:'',p100c:'',p100d:'',p100e:'',p100f:'',p1010:'', + p1011:'',p1012:'',p1013:'',p1014:'',p1015:'',p1016:'',p1017:'',p1018:'', + p1019:'',p101a:'',p101b:'',p101c:'',p101d:'',p101e:'',p101f:'',p1020:'', + p1021:'',p1022:'',p1023:'',p1024:'',p1025:'',p1026:'',p1027:'',p1028:'', + p1029:'',p102a:'',p102b:'',p102c:'',p102d:'',p102e:'',p102f:'',p1030:'', + p1031:'',p1032:'',p1033:'',p1034:'',p1035:'',p1036:'',p1037:'',p1038:'', + p1039:'',p103a:'',p103b:'',p103c:'',p103d:'',p103e:'',p103f:'',p1040:'', + p1041:'',p1042:'',p1043:'',p1044:'',p1045:'',p1046:'',p1047:'',p1048:'', + p1049:'',p104a:'',p104b:'',p104c:'',p104d:'',p104e:'',p104f:'',p1050:'', + p1051:'',p1052:'',p1053:'',p1054:'',p1055:'',p1056:'',p1057:'',p1058:'', + p1059:'',p105a:'',p105b:'',p105c:'',p105d:'',p105e:'',p105f:'',p1060:'', + p1061:'',p1062:'',p1063:'',p1064:'',p1065:'',p1066:'',p1067:'',p1068:'', + p1069:'',p106a:'',p106b:'',p106c:'',p106d:'',p106e:'',p106f:'',p1070:'', + p1071:'',p1072:'',p1073:'',p1074:'',p1075:'',p1076:'',p1077:'',p1078:'', + p1079:'',p107a:'',p107b:'',p107c:'',p107d:'',p107e:'',p107f:'',p1080:'', + p1081:'',p1082:'',p1083:'',p1084:'',p1085:'',p1086:'',p1087:'',p1088:'', + p1089:'',p108a:'',p108b:'',p108c:'',p108d:'',p108e:'',p108f:'',p1090:'', + p1091:'',p1092:'',p1093:'',p1094:'',p1095:'',p1096:'',p1097:'',p1098:'', + p1099:'',p109a:'',p109b:'',p109c:'',p109d:'',p109e:'',p109f:'',p10a0:'', + p10a1:'',p10a2:'',p10a3:'',p10a4:'',p10a5:'',p10a6:'',p10a7:'',p10a8:'', + p10a9:'',p10aa:'',p10ab:'',p10ac:'',p10ad:'',p10ae:'',p10af:'',p10b0:'', + p10b1:'',p10b2:'',p10b3:'',p10b4:'',p10b5:'',p10b6:'',p10b7:'',p10b8:'', + p10b9:'',p10ba:'',p10bb:'',p10bc:'',p10bd:'',p10be:'',p10bf:'',p10c0:'', + p10c1:'',p10c2:'',p10c3:'',p10c4:'',p10c5:'',p10c6:'',p10c7:'',p10c8:'', + p10c9:'',p10ca:'',p10cb:'',p10cc:'',p10cd:'',p10ce:'',p10cf:'',p10d0:'', + p10d1:'',p10d2:'',p10d3:'',p10d4:'',p10d5:'',p10d6:'',p10d7:'',p10d8:'', + p10d9:'',p10da:'',p10db:'',p10dc:'',p10dd:'',p10de:'',p10df:'',p10e0:'', + p10e1:'',p10e2:'',p10e3:'',p10e4:'',p10e5:'',p10e6:'',p10e7:'',p10e8:'', + p10e9:'',p10ea:'',p10eb:'',p10ec:'',p10ed:'',p10ee:'',p10ef:'',p10f0:'', + p10f1:'',p10f2:'',p10f3:'',p10f4:'',p10f5:'',p10f6:'',p10f7:'',p10f8:'', + p10f9:'',p10fa:'',p10fb:'',p10fc:'',p10fd:'',p10fe:'',p10ff:'',p1100:'', + p1101:'',p1102:'',p1103:'',p1104:'',p1105:'',p1106:'',p1107:'',p1108:'', + p1109:'',p110a:'',p110b:'',p110c:'',p110d:'',p110e:'',p110f:'',p1110:'', + p1111:'',p1112:'',p1113:'',p1114:'',p1115:'',p1116:'',p1117:'',p1118:'', + p1119:'',p111a:'',p111b:'',p111c:'',p111d:'',p111e:'',p111f:'',p1120:'', + p1121:'',p1122:'',p1123:'',p1124:'',p1125:'',p1126:'',p1127:'',p1128:'', + p1129:'',p112a:'',p112b:'',p112c:'',p112d:'',p112e:'',p112f:'',p1130:'', + p1131:'',p1132:'',p1133:'',p1134:'',p1135:'',p1136:'',p1137:'',p1138:'', + p1139:'',p113a:'',p113b:'',p113c:'',p113d:'',p113e:'',p113f:'',p1140:'', + p1141:'',p1142:'',p1143:'',p1144:'',p1145:'',p1146:'',p1147:'',p1148:'', + p1149:'',p114a:'',p114b:'',p114c:'',p114d:'',p114e:'',p114f:'',p1150:'', + p1151:'',p1152:'',p1153:'',p1154:'',p1155:'',p1156:'',p1157:'',p1158:'', + p1159:'',p115a:'',p115b:'',p115c:'',p115d:'',p115e:'',p115f:'',p1160:'', + p1161:'',p1162:'',p1163:'',p1164:'',p1165:'',p1166:'',p1167:'',p1168:'', + p1169:'',p116a:'',p116b:'',p116c:'',p116d:'',p116e:'',p116f:'',p1170:'', + p1171:'',p1172:'',p1173:'',p1174:'',p1175:'',p1176:'',p1177:'',p1178:'', + p1179:'',p117a:'',p117b:'',p117c:'',p117d:'',p117e:'',p117f:'',p1180:'', + p1181:'',p1182:'',p1183:'',p1184:'',p1185:'',p1186:'',p1187:'',p1188:'', + p1189:'',p118a:'',p118b:'',p118c:'',p118d:'',p118e:'',p118f:'',p1190:'', + p1191:'',p1192:'',p1193:'',p1194:'',p1195:'',p1196:'',p1197:'',p1198:'', + p1199:'',p119a:'',p119b:'',p119c:'',p119d:'',p119e:'',p119f:'',p11a0:'', + p11a1:'',p11a2:'',p11a3:'',p11a4:'',p11a5:'',p11a6:'',p11a7:'',p11a8:'', + p11a9:'',p11aa:'',p11ab:'',p11ac:'',p11ad:'',p11ae:'',p11af:'',p11b0:'', + p11b1:'',p11b2:'',p11b3:'',p11b4:'',p11b5:'',p11b6:'',p11b7:'',p11b8:'', + p11b9:'',p11ba:'',p11bb:'',p11bc:'',p11bd:'',p11be:'',p11bf:'',p11c0:'', + p11c1:'',p11c2:'',p11c3:'',p11c4:'',p11c5:'',p11c6:'',p11c7:'',p11c8:'', + p11c9:'',p11ca:'',p11cb:'',p11cc:'',p11cd:'',p11ce:'',p11cf:'',p11d0:'', + p11d1:'',p11d2:'',p11d3:'',p11d4:'',p11d5:'',p11d6:'',p11d7:'',p11d8:'', + p11d9:'',p11da:'',p11db:'',p11dc:'',p11dd:'',p11de:'',p11df:'',p11e0:'', + p11e1:'',p11e2:'',p11e3:'',p11e4:'',p11e5:'',p11e6:'',p11e7:'',p11e8:'', + p11e9:'',p11ea:'',p11eb:'',p11ec:'',p11ed:'',p11ee:'',p11ef:'',p11f0:'', + p11f1:'',p11f2:'',p11f3:'',p11f4:'',p11f5:'',p11f6:'',p11f7:'',p11f8:'', + p11f9:'',p11fa:'',p11fb:'',p11fc:'',p11fd:'',p11fe:'',p11ff:'',p1200:'', + p1201:'',p1202:'',p1203:'',p1204:'',p1205:'',p1206:'',p1207:'',p1208:'', + p1209:'',p120a:'',p120b:'',p120c:'',p120d:'',p120e:'',p120f:'',p1210:'', + p1211:'',p1212:'',p1213:'',p1214:'',p1215:'',p1216:'',p1217:'',p1218:'', + p1219:'',p121a:'',p121b:'',p121c:'',p121d:'',p121e:'',p121f:'',p1220:'', + p1221:'',p1222:'',p1223:'',p1224:'',p1225:'',p1226:'',p1227:'',p1228:'', + p1229:'',p122a:'',p122b:'',p122c:'',p122d:'',p122e:'',p122f:'',p1230:'', + p1231:'',p1232:'',p1233:'',p1234:'',p1235:'',p1236:'',p1237:'',p1238:'', + p1239:'',p123a:'',p123b:'',p123c:'',p123d:'',p123e:'',p123f:'',p1240:'', + p1241:'',p1242:'',p1243:'',p1244:'',p1245:'',p1246:'',p1247:'',p1248:'', + p1249:'',p124a:'',p124b:'',p124c:'',p124d:'',p124e:'',p124f:'',p1250:'', + p1251:'',p1252:'',p1253:'',p1254:'',p1255:'',p1256:'',p1257:'',p1258:'', + p1259:'',p125a:'',p125b:'',p125c:'',p125d:'',p125e:'',p125f:'',p1260:'', + p1261:'',p1262:'',p1263:'',p1264:'',p1265:'',p1266:'',p1267:'',p1268:'', + p1269:'',p126a:'',p126b:'',p126c:'',p126d:'',p126e:'',p126f:'',p1270:'', + p1271:'',p1272:'',p1273:'',p1274:'',p1275:'',p1276:'',p1277:'',p1278:'', + p1279:'',p127a:'',p127b:'',p127c:'',p127d:'',p127e:'',p127f:'',p1280:'', + p1281:'',p1282:'',p1283:'',p1284:'',p1285:'',p1286:'',p1287:'',p1288:'', + p1289:'',p128a:'',p128b:'',p128c:'',p128d:'',p128e:'',p128f:'',p1290:'', + p1291:'',p1292:'',p1293:'',p1294:'',p1295:'',p1296:'',p1297:'',p1298:'', + p1299:'',p129a:'',p129b:'',p129c:'',p129d:'',p129e:'',p129f:'',p12a0:'', + p12a1:'',p12a2:'',p12a3:'',p12a4:'',p12a5:'',p12a6:'',p12a7:'',p12a8:'', + p12a9:'',p12aa:'',p12ab:'',p12ac:'',p12ad:'',p12ae:'',p12af:'',p12b0:'', + p12b1:'',p12b2:'',p12b3:'',p12b4:'',p12b5:'',p12b6:'',p12b7:'',p12b8:'', + p12b9:'',p12ba:'',p12bb:'',p12bc:'',p12bd:'',p12be:'',p12bf:'',p12c0:'', + p12c1:'',p12c2:'',p12c3:'',p12c4:'',p12c5:'',p12c6:'',p12c7:'',p12c8:'', + p12c9:'',p12ca:'',p12cb:'',p12cc:'',p12cd:'',p12ce:'',p12cf:'',p12d0:'', + p12d1:'',p12d2:'',p12d3:'',p12d4:'',p12d5:'',p12d6:'',p12d7:'',p12d8:'', + p12d9:'',p12da:'',p12db:'',p12dc:'',p12dd:'',p12de:'',p12df:'',p12e0:'', + p12e1:'',p12e2:'',p12e3:'',p12e4:'',p12e5:'',p12e6:'',p12e7:'',p12e8:'', + p12e9:'',p12ea:'',p12eb:'',p12ec:'',p12ed:'',p12ee:'',p12ef:'',p12f0:'', + p12f1:'',p12f2:'',p12f3:'',p12f4:'',p12f5:'',p12f6:'',p12f7:'',p12f8:'', + p12f9:'',p12fa:'',p12fb:'',p12fc:'',p12fd:'',p12fe:'',p12ff:'',p1300:'', + p1301:'',p1302:'',p1303:'',p1304:'',p1305:'',p1306:'',p1307:'',p1308:'', + p1309:'',p130a:'',p130b:'',p130c:'',p130d:'',p130e:'',p130f:'',p1310:'', + p1311:'',p1312:'',p1313:'',p1314:'',p1315:'',p1316:'',p1317:'',p1318:'', + p1319:'',p131a:'',p131b:'',p131c:'',p131d:'',p131e:'',p131f:'',p1320:'', + p1321:'',p1322:'',p1323:'',p1324:'',p1325:'',p1326:'',p1327:'',p1328:'', + p1329:'',p132a:'',p132b:'',p132c:'',p132d:'',p132e:'',p132f:'',p1330:'', + p1331:'',p1332:'',p1333:'',p1334:'',p1335:'',p1336:'',p1337:'',p1338:'', + p1339:'',p133a:'',p133b:'',p133c:'',p133d:'',p133e:'',p133f:'',p1340:'', + p1341:'',p1342:'',p1343:'',p1344:'',p1345:'',p1346:'',p1347:'',p1348:'', + p1349:'',p134a:'',p134b:'',p134c:'',p134d:'',p134e:'',p134f:'',p1350:'', + p1351:'',p1352:'',p1353:'',p1354:'',p1355:'',p1356:'',p1357:'',p1358:'', + p1359:'',p135a:'',p135b:'',p135c:'',p135d:'',p135e:'',p135f:'',p1360:'', + p1361:'',p1362:'',p1363:'',p1364:'',p1365:'',p1366:'',p1367:'',p1368:'', + p1369:'',p136a:'',p136b:'',p136c:'',p136d:'',p136e:'',p136f:'',p1370:'', + p1371:'',p1372:'',p1373:'',p1374:'',p1375:'',p1376:'',p1377:'',p1378:'', + p1379:'',p137a:'',p137b:'',p137c:'',p137d:'',p137e:'',p137f:'',p1380:'', + p1381:'',p1382:'',p1383:'',p1384:'',p1385:'',p1386:'',p1387:'',p1388:'', + p1389:'',p138a:'',p138b:'',p138c:'',p138d:'',p138e:'',p138f:'',p1390:'', + p1391:'',p1392:'',p1393:'',p1394:'',p1395:'',p1396:'',p1397:'',p1398:'', + p1399:'',p139a:'',p139b:'',p139c:'',p139d:'',p139e:'',p139f:'',p13a0:'', + p13a1:'',p13a2:'',p13a3:'',p13a4:'',p13a5:'',p13a6:'',p13a7:'',p13a8:'', + p13a9:'',p13aa:'',p13ab:'',p13ac:'',p13ad:'',p13ae:'',p13af:'',p13b0:'', + p13b1:'',p13b2:'',p13b3:'',p13b4:'',p13b5:'',p13b6:'',p13b7:'',p13b8:'', + p13b9:'',p13ba:'',p13bb:'',p13bc:'',p13bd:'',p13be:'',p13bf:'',p13c0:'', + p13c1:'',p13c2:'',p13c3:'',p13c4:'',p13c5:'',p13c6:'',p13c7:'',p13c8:'', + p13c9:'',p13ca:'',p13cb:'',p13cc:'',p13cd:'',p13ce:'',p13cf:'',p13d0:'', + p13d1:'',p13d2:'',p13d3:'',p13d4:'',p13d5:'',p13d6:'',p13d7:'',p13d8:'', + p13d9:'',p13da:'',p13db:'',p13dc:'',p13dd:'',p13de:'',p13df:'',p13e0:'', + p13e1:'',p13e2:'',p13e3:'',p13e4:'',p13e5:'',p13e6:'',p13e7:'',p13e8:'', + p13e9:'',p13ea:'',p13eb:'',p13ec:'',p13ed:'',p13ee:'',p13ef:'',p13f0:'', + p13f1:'',p13f2:'',p13f3:'',p13f4:'',p13f5:'',p13f6:'',p13f7:'',p13f8:'', + p13f9:'',p13fa:'',p13fb:'',p13fc:'',p13fd:'',p13fe:'',p13ff:'',p1400:'', + p1401:'',p1402:'',p1403:'',p1404:'',p1405:'',p1406:'',p1407:'',p1408:'', + p1409:'',p140a:'',p140b:'',p140c:'',p140d:'',p140e:'',p140f:'',p1410:'', + p1411:'',p1412:'',p1413:'',p1414:'',p1415:'',p1416:'',p1417:'',p1418:'', + p1419:'',p141a:'',p141b:'',p141c:'',p141d:'',p141e:'',p141f:'',p1420:'', + p1421:'',p1422:'',p1423:'',p1424:'',p1425:'',p1426:'',p1427:'',p1428:'', + p1429:'',p142a:'',p142b:'',p142c:'',p142d:'',p142e:'',p142f:'',p1430:'', + p1431:'',p1432:'',p1433:'',p1434:'',p1435:'',p1436:'',p1437:'',p1438:'', + p1439:'',p143a:'',p143b:'',p143c:'',p143d:'',p143e:'',p143f:'',p1440:'', + p1441:'',p1442:'',p1443:'',p1444:'',p1445:'',p1446:'',p1447:'',p1448:'', + p1449:'',p144a:'',p144b:'',p144c:'',p144d:'',p144e:'',p144f:'',p1450:'', + p1451:'',p1452:'',p1453:'',p1454:'',p1455:'',p1456:'',p1457:'',p1458:'', + p1459:'',p145a:'',p145b:'',p145c:'',p145d:'',p145e:'',p145f:'',p1460:'', + p1461:'',p1462:'',p1463:'',p1464:'',p1465:'',p1466:'',p1467:'',p1468:'', + p1469:'',p146a:'',p146b:'',p146c:'',p146d:'',p146e:'',p146f:'',p1470:'', + p1471:'',p1472:'',p1473:'',p1474:'',p1475:'',p1476:'',p1477:'',p1478:'', + p1479:'',p147a:'',p147b:'',p147c:'',p147d:'',p147e:'',p147f:'',p1480:'', + p1481:'',p1482:'',p1483:'',p1484:'',p1485:'',p1486:'',p1487:'',p1488:'', + p1489:'',p148a:'',p148b:'',p148c:'',p148d:'',p148e:'',p148f:'',p1490:'', + p1491:'',p1492:'',p1493:'',p1494:'',p1495:'',p1496:'',p1497:'',p1498:'', + p1499:'',p149a:'',p149b:'',p149c:'',p149d:'',p149e:'',p149f:'',p14a0:'', + p14a1:'',p14a2:'',p14a3:'',p14a4:'',p14a5:'',p14a6:'',p14a7:'',p14a8:'', + p14a9:'',p14aa:'',p14ab:'',p14ac:'',p14ad:'',p14ae:'',p14af:'',p14b0:'', + p14b1:'',p14b2:'',p14b3:'',p14b4:'',p14b5:'',p14b6:'',p14b7:'',p14b8:'', + p14b9:'',p14ba:'',p14bb:'',p14bc:'',p14bd:'',p14be:'',p14bf:'',p14c0:'', + p14c1:'',p14c2:'',p14c3:'',p14c4:'',p14c5:'',p14c6:'',p14c7:'',p14c8:'', + p14c9:'',p14ca:'',p14cb:'',p14cc:'',p14cd:'',p14ce:'',p14cf:'',p14d0:'', + p14d1:'',p14d2:'',p14d3:'',p14d4:'',p14d5:'',p14d6:'',p14d7:'',p14d8:'', + p14d9:'',p14da:'',p14db:'',p14dc:'',p14dd:'',p14de:'',p14df:'',p14e0:'', + p14e1:'',p14e2:'',p14e3:'',p14e4:'',p14e5:'',p14e6:'',p14e7:'',p14e8:'', + p14e9:'',p14ea:'',p14eb:'',p14ec:'',p14ed:'',p14ee:'',p14ef:'',p14f0:'', + p14f1:'',p14f2:'',p14f3:'',p14f4:'',p14f5:'',p14f6:'',p14f7:'',p14f8:'', + p14f9:'',p14fa:'',p14fb:'',p14fc:'',p14fd:'',p14fe:'',p14ff:'',p1500:'', + p1501:'',p1502:'',p1503:'',p1504:'',p1505:'',p1506:'',p1507:'',p1508:'', + p1509:'',p150a:'',p150b:'',p150c:'',p150d:'',p150e:'',p150f:'',p1510:'', + p1511:'',p1512:'',p1513:'',p1514:'',p1515:'',p1516:'',p1517:'',p1518:'', + p1519:'',p151a:'',p151b:'',p151c:'',p151d:'',p151e:'',p151f:'',p1520:'', + p1521:'',p1522:'',p1523:'',p1524:'',p1525:'',p1526:'',p1527:'',p1528:'', + p1529:'',p152a:'',p152b:'',p152c:'',p152d:'',p152e:'',p152f:'',p1530:'', + p1531:'',p1532:'',p1533:'',p1534:'',p1535:'',p1536:'',p1537:'',p1538:'', + p1539:'',p153a:'',p153b:'',p153c:'',p153d:'',p153e:'',p153f:'',p1540:'', + p1541:'',p1542:'',p1543:'',p1544:'',p1545:'',p1546:'',p1547:'',p1548:'', + p1549:'',p154a:'',p154b:'',p154c:'',p154d:'',p154e:'',p154f:'',p1550:'', + p1551:'',p1552:'',p1553:'',p1554:'',p1555:'',p1556:'',p1557:'',p1558:'', + p1559:'',p155a:'',p155b:'',p155c:'',p155d:'',p155e:'',p155f:'',p1560:'', + p1561:'',p1562:'',p1563:'',p1564:'',p1565:'',p1566:'',p1567:'',p1568:'', + p1569:'',p156a:'',p156b:'',p156c:'',p156d:'',p156e:'',p156f:'',p1570:'', + p1571:'',p1572:'',p1573:'',p1574:'',p1575:'',p1576:'',p1577:'',p1578:'', + p1579:'',p157a:'',p157b:'',p157c:'',p157d:'',p157e:'',p157f:'',p1580:'', + p1581:'',p1582:'',p1583:'',p1584:'',p1585:'',p1586:'',p1587:'',p1588:'', + p1589:'',p158a:'',p158b:'',p158c:'',p158d:'',p158e:'',p158f:'',p1590:'', + p1591:'',p1592:'',p1593:'',p1594:'',p1595:'',p1596:'',p1597:'',p1598:'', + p1599:'',p159a:'',p159b:'',p159c:'',p159d:'',p159e:'',p159f:'',p15a0:'', + p15a1:'',p15a2:'',p15a3:'',p15a4:'',p15a5:'',p15a6:'',p15a7:'',p15a8:'', + p15a9:'',p15aa:'',p15ab:'',p15ac:'',p15ad:'',p15ae:'',p15af:'',p15b0:'', + p15b1:'',p15b2:'',p15b3:'',p15b4:'',p15b5:'',p15b6:'',p15b7:'',p15b8:'', + p15b9:'',p15ba:'',p15bb:'',p15bc:'',p15bd:'',p15be:'',p15bf:'',p15c0:'', + p15c1:'',p15c2:'',p15c3:'',p15c4:'',p15c5:'',p15c6:'',p15c7:'',p15c8:'', + p15c9:'',p15ca:'',p15cb:'',p15cc:'',p15cd:'',p15ce:'',p15cf:'',p15d0:'', + p15d1:'',p15d2:'',p15d3:'',p15d4:'',p15d5:'',p15d6:'',p15d7:'',p15d8:'', + p15d9:'',p15da:'',p15db:'',p15dc:'',p15dd:'',p15de:'',p15df:'',p15e0:'', + p15e1:'',p15e2:'',p15e3:'',p15e4:'',p15e5:'',p15e6:'',p15e7:'',p15e8:'', + p15e9:'',p15ea:'',p15eb:'',p15ec:'',p15ed:'',p15ee:'',p15ef:'',p15f0:'', + p15f1:'',p15f2:'',p15f3:'',p15f4:'',p15f5:'',p15f6:'',p15f7:'',p15f8:'', + p15f9:'',p15fa:'',p15fb:'',p15fc:'',p15fd:'',p15fe:'',p15ff:'',p1600:'', + p1601:'',p1602:'',p1603:'',p1604:'',p1605:'',p1606:'',p1607:'',p1608:'', + p1609:'',p160a:'',p160b:'',p160c:'',p160d:'',p160e:'',p160f:'',p1610:'', + p1611:'',p1612:'',p1613:'',p1614:'',p1615:'',p1616:'',p1617:'',p1618:'', + p1619:'',p161a:'',p161b:'',p161c:'',p161d:'',p161e:'',p161f:'',p1620:'', + p1621:'',p1622:'',p1623:'',p1624:'',p1625:'',p1626:'',p1627:'',p1628:'', + p1629:'',p162a:'',p162b:'',p162c:'',p162d:'',p162e:'',p162f:'',p1630:'', + p1631:'',p1632:'',p1633:'',p1634:'',p1635:'',p1636:'',p1637:'',p1638:'', + p1639:'',p163a:'',p163b:'',p163c:'',p163d:'',p163e:'',p163f:'',p1640:'', + p1641:'',p1642:'',p1643:'',p1644:'',p1645:'',p1646:'',p1647:'',p1648:'', + p1649:'',p164a:'',p164b:'',p164c:'',p164d:'',p164e:'',p164f:'',p1650:'', + p1651:'',p1652:'',p1653:'',p1654:'',p1655:'',p1656:'',p1657:'',p1658:'', + p1659:'',p165a:'',p165b:'',p165c:'',p165d:'',p165e:'',p165f:'',p1660:'', + p1661:'',p1662:'',p1663:'',p1664:'',p1665:'',p1666:'',p1667:'',p1668:'', + p1669:'',p166a:'',p166b:'',p166c:'',p166d:'',p166e:'',p166f:'',p1670:'', + p1671:'',p1672:'',p1673:'',p1674:'',p1675:'',p1676:'',p1677:'',p1678:'', + p1679:'',p167a:'',p167b:'',p167c:'',p167d:'',p167e:'',p167f:'',p1680:'', + p1681:'',p1682:'',p1683:'',p1684:'',p1685:'',p1686:'',p1687:'',p1688:'', + p1689:'',p168a:'',p168b:'',p168c:'',p168d:'',p168e:'',p168f:'',p1690:'', + p1691:'',p1692:'',p1693:'',p1694:'',p1695:'',p1696:'',p1697:'',p1698:'', + p1699:'',p169a:'',p169b:'',p169c:'',p169d:'',p169e:'',p169f:'',p16a0:'', + p16a1:'',p16a2:'',p16a3:'',p16a4:'',p16a5:'',p16a6:'',p16a7:'',p16a8:'', + p16a9:'',p16aa:'',p16ab:'',p16ac:'',p16ad:'',p16ae:'',p16af:'',p16b0:'', + p16b1:'',p16b2:'',p16b3:'',p16b4:'',p16b5:'',p16b6:'',p16b7:'',p16b8:'', + p16b9:'',p16ba:'',p16bb:'',p16bc:'',p16bd:'',p16be:'',p16bf:'',p16c0:'', + p16c1:'',p16c2:'',p16c3:'',p16c4:'',p16c5:'',p16c6:'',p16c7:'',p16c8:'', + p16c9:'',p16ca:'',p16cb:'',p16cc:'',p16cd:'',p16ce:'',p16cf:'',p16d0:'', + p16d1:'',p16d2:'',p16d3:'',p16d4:'',p16d5:'',p16d6:'',p16d7:'',p16d8:'', + p16d9:'',p16da:'',p16db:'',p16dc:'',p16dd:'',p16de:'',p16df:'',p16e0:'', + p16e1:'',p16e2:'',p16e3:'',p16e4:'',p16e5:'',p16e6:'',p16e7:'',p16e8:'', + p16e9:'',p16ea:'',p16eb:'',p16ec:'',p16ed:'',p16ee:'',p16ef:'',p16f0:'', + p16f1:'',p16f2:'',p16f3:'',p16f4:'',p16f5:'',p16f6:'',p16f7:'',p16f8:'', + p16f9:'',p16fa:'',p16fb:'',p16fc:'',p16fd:'',p16fe:'',p16ff:'',p1700:'', + p1701:'',p1702:'',p1703:'',p1704:'',p1705:'',p1706:'',p1707:'',p1708:'', + p1709:'',p170a:'',p170b:'',p170c:'',p170d:'',p170e:'',p170f:'',p1710:'', + p1711:'',p1712:'',p1713:'',p1714:'',p1715:'',p1716:'',p1717:'',p1718:'', + p1719:'',p171a:'',p171b:'',p171c:'',p171d:'',p171e:'',p171f:'',p1720:'', + p1721:'',p1722:'',p1723:'',p1724:'',p1725:'',p1726:'',p1727:'',p1728:'', + p1729:'',p172a:'',p172b:'',p172c:'',p172d:'',p172e:'',p172f:'',p1730:'', + p1731:'',p1732:'',p1733:'',p1734:'',p1735:'',p1736:'',p1737:'',p1738:'', + p1739:'',p173a:'',p173b:'',p173c:'',p173d:'',p173e:'',p173f:'',p1740:'', + p1741:'',p1742:'',p1743:'',p1744:'',p1745:'',p1746:'',p1747:'',p1748:'', + p1749:'',p174a:'',p174b:'',p174c:'',p174d:'',p174e:'',p174f:'',p1750:'', + p1751:'',p1752:'',p1753:'',p1754:'',p1755:'',p1756:'',p1757:'',p1758:'', + p1759:'',p175a:'',p175b:'',p175c:'',p175d:'',p175e:'',p175f:'',p1760:'', + p1761:'',p1762:'',p1763:'',p1764:'',p1765:'',p1766:'',p1767:'',p1768:'', + p1769:'',p176a:'',p176b:'',p176c:'',p176d:'',p176e:'',p176f:'',p1770:'', + p1771:'',p1772:'',p1773:'',p1774:'',p1775:'',p1776:'',p1777:'',p1778:'', + p1779:'',p177a:'',p177b:'',p177c:'',p177d:'',p177e:'',p177f:'',p1780:'', + p1781:'',p1782:'',p1783:'',p1784:'',p1785:'',p1786:'',p1787:'',p1788:'', + p1789:'',p178a:'',p178b:'',p178c:'',p178d:'',p178e:'',p178f:'',p1790:'', + p1791:'',p1792:'',p1793:'',p1794:'',p1795:'',p1796:'',p1797:'',p1798:'', + p1799:'',p179a:'',p179b:'',p179c:'',p179d:'',p179e:'',p179f:'',p17a0:'', + p17a1:'',p17a2:'',p17a3:'',p17a4:'',p17a5:'',p17a6:'',p17a7:'',p17a8:'', + p17a9:'',p17aa:'',p17ab:'',p17ac:'',p17ad:'',p17ae:'',p17af:'',p17b0:'', + p17b1:'',p17b2:'',p17b3:'',p17b4:'',p17b5:'',p17b6:'',p17b7:'',p17b8:'', + p17b9:'',p17ba:'',p17bb:'',p17bc:'',p17bd:'',p17be:'',p17bf:'',p17c0:'', + p17c1:'',p17c2:'',p17c3:'',p17c4:'',p17c5:'',p17c6:'',p17c7:'',p17c8:'', + p17c9:'',p17ca:'',p17cb:'',p17cc:'',p17cd:'',p17ce:'',p17cf:'',p17d0:'', + p17d1:'',p17d2:'',p17d3:'',p17d4:'',p17d5:'',p17d6:'',p17d7:'',p17d8:'', + p17d9:'',p17da:'',p17db:'',p17dc:'',p17dd:'',p17de:'',p17df:'',p17e0:'', + p17e1:'',p17e2:'',p17e3:'',p17e4:'',p17e5:'',p17e6:'',p17e7:'',p17e8:'', + p17e9:'',p17ea:'',p17eb:'',p17ec:'',p17ed:'',p17ee:'',p17ef:'',p17f0:'', + p17f1:'',p17f2:'',p17f3:'',p17f4:'',p17f5:'',p17f6:'',p17f7:'',p17f8:'', + p17f9:'',p17fa:'',p17fb:'',p17fc:'',p17fd:'',p17fe:'',p17ff:'',p1800:'', + p1801:'',p1802:'',p1803:'',p1804:'',p1805:'',p1806:'',p1807:'',p1808:'', + p1809:'',p180a:'',p180b:'',p180c:'',p180d:'',p180e:'',p180f:'',p1810:'', + p1811:'',p1812:'',p1813:'',p1814:'',p1815:'',p1816:'',p1817:'',p1818:'', + p1819:'',p181a:'',p181b:'',p181c:'',p181d:'',p181e:'',p181f:'',p1820:'', + p1821:'',p1822:'',p1823:'',p1824:'',p1825:'',p1826:'',p1827:'',p1828:'', + p1829:'',p182a:'',p182b:'',p182c:'',p182d:'',p182e:'',p182f:'',p1830:'', + p1831:'',p1832:'',p1833:'',p1834:'',p1835:'',p1836:'',p1837:'',p1838:'', + p1839:'',p183a:'',p183b:'',p183c:'',p183d:'',p183e:'',p183f:'',p1840:'', + p1841:'',p1842:'',p1843:'',p1844:'',p1845:'',p1846:'',p1847:'',p1848:'', + p1849:'',p184a:'',p184b:'',p184c:'',p184d:'',p184e:'',p184f:'',p1850:'', + p1851:'',p1852:'',p1853:'',p1854:'',p1855:'',p1856:'',p1857:'',p1858:'', + p1859:'',p185a:'',p185b:'',p185c:'',p185d:'',p185e:'',p185f:'',p1860:'', + p1861:'',p1862:'',p1863:'',p1864:'',p1865:'',p1866:'',p1867:'',p1868:'', + p1869:'',p186a:'',p186b:'',p186c:'',p186d:'',p186e:'',p186f:'',p1870:'', + p1871:'',p1872:'',p1873:'',p1874:'',p1875:'',p1876:'',p1877:'',p1878:'', + p1879:'',p187a:'',p187b:'',p187c:'',p187d:'',p187e:'',p187f:'',p1880:'', + p1881:'',p1882:'',p1883:'',p1884:'',p1885:'',p1886:'',p1887:'',p1888:'', + p1889:'',p188a:'',p188b:'',p188c:'',p188d:'',p188e:'',p188f:'',p1890:'', + p1891:'',p1892:'',p1893:'',p1894:'',p1895:'',p1896:'',p1897:'',p1898:'', + p1899:'',p189a:'',p189b:'',p189c:'',p189d:'',p189e:'',p189f:'',p18a0:'', + p18a1:'',p18a2:'',p18a3:'',p18a4:'',p18a5:'',p18a6:'',p18a7:'',p18a8:'', + p18a9:'',p18aa:'',p18ab:'',p18ac:'',p18ad:'',p18ae:'',p18af:'',p18b0:'', + p18b1:'',p18b2:'',p18b3:'',p18b4:'',p18b5:'',p18b6:'',p18b7:'',p18b8:'', + p18b9:'',p18ba:'',p18bb:'',p18bc:'',p18bd:'',p18be:'',p18bf:'',p18c0:'', + p18c1:'',p18c2:'',p18c3:'',p18c4:'',p18c5:'',p18c6:'',p18c7:'',p18c8:'', + p18c9:'',p18ca:'',p18cb:'',p18cc:'',p18cd:'',p18ce:'',p18cf:'',p18d0:'', + p18d1:'',p18d2:'',p18d3:'',p18d4:'',p18d5:'',p18d6:'',p18d7:'',p18d8:'', + p18d9:'',p18da:'',p18db:'',p18dc:'',p18dd:'',p18de:'',p18df:'',p18e0:'', + p18e1:'',p18e2:'',p18e3:'',p18e4:'',p18e5:'',p18e6:'',p18e7:'',p18e8:'', + p18e9:'',p18ea:'',p18eb:'',p18ec:'',p18ed:'',p18ee:'',p18ef:'',p18f0:'', + p18f1:'',p18f2:'',p18f3:'',p18f4:'',p18f5:'',p18f6:'',p18f7:'',p18f8:'', + p18f9:'',p18fa:'',p18fb:'',p18fc:'',p18fd:'',p18fe:'',p18ff:'',p1900:'', + p1901:'',p1902:'',p1903:'',p1904:'',p1905:'',p1906:'',p1907:'',p1908:'', + p1909:'',p190a:'',p190b:'',p190c:'',p190d:'',p190e:'',p190f:'',p1910:'', + p1911:'',p1912:'',p1913:'',p1914:'',p1915:'',p1916:'',p1917:'',p1918:'', + p1919:'',p191a:'',p191b:'',p191c:'',p191d:'',p191e:'',p191f:'',p1920:'', + p1921:'',p1922:'',p1923:'',p1924:'',p1925:'',p1926:'',p1927:'',p1928:'', + p1929:'',p192a:'',p192b:'',p192c:'',p192d:'',p192e:'',p192f:'',p1930:'', + p1931:'',p1932:'',p1933:'',p1934:'',p1935:'',p1936:'',p1937:'',p1938:'', + p1939:'',p193a:'',p193b:'',p193c:'',p193d:'',p193e:'',p193f:'',p1940:'', + p1941:'',p1942:'',p1943:'',p1944:'',p1945:'',p1946:'',p1947:'',p1948:'', + p1949:'',p194a:'',p194b:'',p194c:'',p194d:'',p194e:'',p194f:'',p1950:'', + p1951:'',p1952:'',p1953:'',p1954:'',p1955:'',p1956:'',p1957:'',p1958:'', + p1959:'',p195a:'',p195b:'',p195c:'',p195d:'',p195e:'',p195f:'',p1960:'', + p1961:'',p1962:'',p1963:'',p1964:'',p1965:'',p1966:'',p1967:'',p1968:'', + p1969:'',p196a:'',p196b:'',p196c:'',p196d:'',p196e:'',p196f:'',p1970:'', + p1971:'',p1972:'',p1973:'',p1974:'',p1975:'',p1976:'',p1977:'',p1978:'', + p1979:'',p197a:'',p197b:'',p197c:'',p197d:'',p197e:'',p197f:'',p1980:'', + p1981:'',p1982:'',p1983:'',p1984:'',p1985:'',p1986:'',p1987:'',p1988:'', + p1989:'',p198a:'',p198b:'',p198c:'',p198d:'',p198e:'',p198f:'',p1990:'', + p1991:'',p1992:'',p1993:'',p1994:'',p1995:'',p1996:'',p1997:'',p1998:'', + p1999:'',p199a:'',p199b:'',p199c:'',p199d:'',p199e:'',p199f:'',p19a0:'', + p19a1:'',p19a2:'',p19a3:'',p19a4:'',p19a5:'',p19a6:'',p19a7:'',p19a8:'', + p19a9:'',p19aa:'',p19ab:'',p19ac:'',p19ad:'',p19ae:'',p19af:'',p19b0:'', + p19b1:'',p19b2:'',p19b3:'',p19b4:'',p19b5:'',p19b6:'',p19b7:'',p19b8:'', + p19b9:'',p19ba:'',p19bb:'',p19bc:'',p19bd:'',p19be:'',p19bf:'',p19c0:'', + p19c1:'',p19c2:'',p19c3:'',p19c4:'',p19c5:'',p19c6:'',p19c7:'',p19c8:'', + p19c9:'',p19ca:'',p19cb:'',p19cc:'',p19cd:'',p19ce:'',p19cf:'',p19d0:'', + p19d1:'',p19d2:'',p19d3:'',p19d4:'',p19d5:'',p19d6:'',p19d7:'',p19d8:'', + p19d9:'',p19da:'',p19db:'',p19dc:'',p19dd:'',p19de:'',p19df:'',p19e0:'', + p19e1:'',p19e2:'',p19e3:'',p19e4:'',p19e5:'',p19e6:'',p19e7:'',p19e8:'', + p19e9:'',p19ea:'',p19eb:'',p19ec:'',p19ed:'',p19ee:'',p19ef:'',p19f0:'', + p19f1:'',p19f2:'',p19f3:'',p19f4:'',p19f5:'',p19f6:'',p19f7:'',p19f8:'', + p19f9:'',p19fa:'',p19fb:'',p19fc:'',p19fd:'',p19fe:'',p19ff:'',p1a00:'', + p1a01:'',p1a02:'',p1a03:'',p1a04:'',p1a05:'',p1a06:'',p1a07:'',p1a08:'', + p1a09:'',p1a0a:'',p1a0b:'',p1a0c:'',p1a0d:'',p1a0e:'',p1a0f:'',p1a10:'', + p1a11:'',p1a12:'',p1a13:'',p1a14:'',p1a15:'',p1a16:'',p1a17:'',p1a18:'', + p1a19:'',p1a1a:'',p1a1b:'',p1a1c:'',p1a1d:'',p1a1e:'',p1a1f:'',p1a20:'', + p1a21:'',p1a22:'',p1a23:'',p1a24:'',p1a25:'',p1a26:'',p1a27:'',p1a28:'', + p1a29:'',p1a2a:'',p1a2b:'',p1a2c:'',p1a2d:'',p1a2e:'',p1a2f:'',p1a30:'', + p1a31:'',p1a32:'',p1a33:'',p1a34:'',p1a35:'',p1a36:'',p1a37:'',p1a38:'', + p1a39:'',p1a3a:'',p1a3b:'',p1a3c:'',p1a3d:'',p1a3e:'',p1a3f:'',p1a40:'', + p1a41:'',p1a42:'',p1a43:'',p1a44:'',p1a45:'',p1a46:'',p1a47:'',p1a48:'', + p1a49:'',p1a4a:'',p1a4b:'',p1a4c:'',p1a4d:'',p1a4e:'',p1a4f:'',p1a50:'', + p1a51:'',p1a52:'',p1a53:'',p1a54:'',p1a55:'',p1a56:'',p1a57:'',p1a58:'', + p1a59:'',p1a5a:'',p1a5b:'',p1a5c:'',p1a5d:'',p1a5e:'',p1a5f:'',p1a60:'', + p1a61:'',p1a62:'',p1a63:'',p1a64:'',p1a65:'',p1a66:'',p1a67:'',p1a68:'', + p1a69:'',p1a6a:'',p1a6b:'',p1a6c:'',p1a6d:'',p1a6e:'',p1a6f:'',p1a70:'', + p1a71:'',p1a72:'',p1a73:'',p1a74:'',p1a75:'',p1a76:'',p1a77:'',p1a78:'', + p1a79:'',p1a7a:'',p1a7b:'',p1a7c:'',p1a7d:'',p1a7e:'',p1a7f:'',p1a80:'', + p1a81:'',p1a82:'',p1a83:'',p1a84:'',p1a85:'',p1a86:'',p1a87:'',p1a88:'', + p1a89:'',p1a8a:'',p1a8b:'',p1a8c:'',p1a8d:'',p1a8e:'',p1a8f:'',p1a90:'', + p1a91:'',p1a92:'',p1a93:'',p1a94:'',p1a95:'',p1a96:'',p1a97:'',p1a98:'', + p1a99:'',p1a9a:'',p1a9b:'',p1a9c:'',p1a9d:'',p1a9e:'',p1a9f:'',p1aa0:'', + p1aa1:'',p1aa2:'',p1aa3:'',p1aa4:'',p1aa5:'',p1aa6:'',p1aa7:'',p1aa8:'', + p1aa9:'',p1aaa:'',p1aab:'',p1aac:'',p1aad:'',p1aae:'',p1aaf:'',p1ab0:'', + p1ab1:'',p1ab2:'',p1ab3:'',p1ab4:'',p1ab5:'',p1ab6:'',p1ab7:'',p1ab8:'', + p1ab9:'',p1aba:'',p1abb:'',p1abc:'',p1abd:'',p1abe:'',p1abf:'',p1ac0:'', + p1ac1:'',p1ac2:'',p1ac3:'',p1ac4:'',p1ac5:'',p1ac6:'',p1ac7:'',p1ac8:'', + p1ac9:'',p1aca:'',p1acb:'',p1acc:'',p1acd:'',p1ace:'',p1acf:'',p1ad0:'', + p1ad1:'',p1ad2:'',p1ad3:'',p1ad4:'',p1ad5:'',p1ad6:'',p1ad7:'',p1ad8:'', + p1ad9:'',p1ada:'',p1adb:'',p1adc:'',p1add:'',p1ade:'',p1adf:'',p1ae0:'', + p1ae1:'',p1ae2:'',p1ae3:'',p1ae4:'',p1ae5:'',p1ae6:'',p1ae7:'',p1ae8:'', + p1ae9:'',p1aea:'',p1aeb:'',p1aec:'',p1aed:'',p1aee:'',p1aef:'',p1af0:'', + p1af1:'',p1af2:'',p1af3:'',p1af4:'',p1af5:'',p1af6:'',p1af7:'',p1af8:'', + p1af9:'',p1afa:'',p1afb:'',p1afc:'',p1afd:'',p1afe:'',p1aff:'',p1b00:'', + p1b01:'',p1b02:'',p1b03:'',p1b04:'',p1b05:'',p1b06:'',p1b07:'',p1b08:'', + p1b09:'',p1b0a:'',p1b0b:'',p1b0c:'',p1b0d:'',p1b0e:'',p1b0f:'',p1b10:'', + p1b11:'',p1b12:'',p1b13:'',p1b14:'',p1b15:'',p1b16:'',p1b17:'',p1b18:'', + p1b19:'',p1b1a:'',p1b1b:'',p1b1c:'',p1b1d:'',p1b1e:'',p1b1f:'',p1b20:'', + p1b21:'',p1b22:'',p1b23:'',p1b24:'',p1b25:'',p1b26:'',p1b27:'',p1b28:'', + p1b29:'',p1b2a:'',p1b2b:'',p1b2c:'',p1b2d:'',p1b2e:'',p1b2f:'',p1b30:'', + p1b31:'',p1b32:'',p1b33:'',p1b34:'',p1b35:'',p1b36:'',p1b37:'',p1b38:'', + p1b39:'',p1b3a:'',p1b3b:'',p1b3c:'',p1b3d:'',p1b3e:'',p1b3f:'',p1b40:'', + p1b41:'',p1b42:'',p1b43:'',p1b44:'',p1b45:'',p1b46:'',p1b47:'',p1b48:'', + p1b49:'',p1b4a:'',p1b4b:'',p1b4c:'',p1b4d:'',p1b4e:'',p1b4f:'',p1b50:'', + p1b51:'',p1b52:'',p1b53:'',p1b54:'',p1b55:'',p1b56:'',p1b57:'',p1b58:'', + p1b59:'',p1b5a:'',p1b5b:'',p1b5c:'',p1b5d:'',p1b5e:'',p1b5f:'',p1b60:'', + p1b61:'',p1b62:'',p1b63:'',p1b64:'',p1b65:'',p1b66:'',p1b67:'',p1b68:'', + p1b69:'',p1b6a:'',p1b6b:'',p1b6c:'',p1b6d:'',p1b6e:'',p1b6f:'',p1b70:'', + p1b71:'',p1b72:'',p1b73:'',p1b74:'',p1b75:'',p1b76:'',p1b77:'',p1b78:'', + p1b79:'',p1b7a:'',p1b7b:'',p1b7c:'',p1b7d:'',p1b7e:'',p1b7f:'',p1b80:'', + p1b81:'',p1b82:'',p1b83:'',p1b84:'',p1b85:'',p1b86:'',p1b87:'',p1b88:'', + p1b89:'',p1b8a:'',p1b8b:'',p1b8c:'',p1b8d:'',p1b8e:'',p1b8f:'',p1b90:'', + p1b91:'',p1b92:'',p1b93:'',p1b94:'',p1b95:'',p1b96:'',p1b97:'',p1b98:'', + p1b99:'',p1b9a:'',p1b9b:'',p1b9c:'',p1b9d:'',p1b9e:'',p1b9f:'',p1ba0:'', + p1ba1:'',p1ba2:'',p1ba3:'',p1ba4:'',p1ba5:'',p1ba6:'',p1ba7:'',p1ba8:'', + p1ba9:'',p1baa:'',p1bab:'',p1bac:'',p1bad:'',p1bae:'',p1baf:'',p1bb0:'', + p1bb1:'',p1bb2:'',p1bb3:'',p1bb4:'',p1bb5:'',p1bb6:'',p1bb7:'',p1bb8:'', + p1bb9:'',p1bba:'',p1bbb:'',p1bbc:'',p1bbd:'',p1bbe:'',p1bbf:'',p1bc0:'', + p1bc1:'',p1bc2:'',p1bc3:'',p1bc4:'',p1bc5:'',p1bc6:'',p1bc7:'',p1bc8:'', + p1bc9:'',p1bca:'',p1bcb:'',p1bcc:'',p1bcd:'',p1bce:'',p1bcf:'',p1bd0:'', + p1bd1:'',p1bd2:'',p1bd3:'',p1bd4:'',p1bd5:'',p1bd6:'',p1bd7:'',p1bd8:'', + p1bd9:'',p1bda:'',p1bdb:'',p1bdc:'',p1bdd:'',p1bde:'',p1bdf:'',p1be0:'', + p1be1:'',p1be2:'',p1be3:'',p1be4:'',p1be5:'',p1be6:'',p1be7:'',p1be8:'', + p1be9:'',p1bea:'',p1beb:'',p1bec:'',p1bed:'',p1bee:'',p1bef:'',p1bf0:'', + p1bf1:'',p1bf2:'',p1bf3:'',p1bf4:'',p1bf5:'',p1bf6:'',p1bf7:'',p1bf8:'', + p1bf9:'',p1bfa:'',p1bfb:'',p1bfc:'',p1bfd:'',p1bfe:'',p1bff:'',p1c00:'', + p1c01:'',p1c02:'',p1c03:'',p1c04:'',p1c05:'',p1c06:'',p1c07:'',p1c08:'', + p1c09:'',p1c0a:'',p1c0b:'',p1c0c:'',p1c0d:'',p1c0e:'',p1c0f:'',p1c10:'', + p1c11:'',p1c12:'',p1c13:'',p1c14:'',p1c15:'',p1c16:'',p1c17:'',p1c18:'', + p1c19:'',p1c1a:'',p1c1b:'',p1c1c:'',p1c1d:'',p1c1e:'',p1c1f:'',p1c20:'', + p1c21:'',p1c22:'',p1c23:'',p1c24:'',p1c25:'',p1c26:'',p1c27:'',p1c28:'', + p1c29:'',p1c2a:'',p1c2b:'',p1c2c:'',p1c2d:'',p1c2e:'',p1c2f:'',p1c30:'', + p1c31:'',p1c32:'',p1c33:'',p1c34:'',p1c35:'',p1c36:'',p1c37:'',p1c38:'', + p1c39:'',p1c3a:'',p1c3b:'',p1c3c:'',p1c3d:'',p1c3e:'',p1c3f:'',p1c40:'', + p1c41:'',p1c42:'',p1c43:'',p1c44:'',p1c45:'',p1c46:'',p1c47:'',p1c48:'', + p1c49:'',p1c4a:'',p1c4b:'',p1c4c:'',p1c4d:'',p1c4e:'',p1c4f:'',p1c50:'', + p1c51:'',p1c52:'',p1c53:'',p1c54:'',p1c55:'',p1c56:'',p1c57:'',p1c58:'', + p1c59:'',p1c5a:'',p1c5b:'',p1c5c:'',p1c5d:'',p1c5e:'',p1c5f:'',p1c60:'', + p1c61:'',p1c62:'',p1c63:'',p1c64:'',p1c65:'',p1c66:'',p1c67:'',p1c68:'', + p1c69:'',p1c6a:'',p1c6b:'',p1c6c:'',p1c6d:'',p1c6e:'',p1c6f:'',p1c70:'', + p1c71:'',p1c72:'',p1c73:'',p1c74:'',p1c75:'',p1c76:'',p1c77:'',p1c78:'', + p1c79:'',p1c7a:'',p1c7b:'',p1c7c:'',p1c7d:'',p1c7e:'',p1c7f:'',p1c80:'', + p1c81:'',p1c82:'',p1c83:'',p1c84:'',p1c85:'',p1c86:'',p1c87:'',p1c88:'', + p1c89:'',p1c8a:'',p1c8b:'',p1c8c:'',p1c8d:'',p1c8e:'',p1c8f:'',p1c90:'', + p1c91:'',p1c92:'',p1c93:'',p1c94:'',p1c95:'',p1c96:'',p1c97:'',p1c98:'', + p1c99:'',p1c9a:'',p1c9b:'',p1c9c:'',p1c9d:'',p1c9e:'',p1c9f:'',p1ca0:'', + p1ca1:'',p1ca2:'',p1ca3:'',p1ca4:'',p1ca5:'',p1ca6:'',p1ca7:'',p1ca8:'', + p1ca9:'',p1caa:'',p1cab:'',p1cac:'',p1cad:'',p1cae:'',p1caf:'',p1cb0:'', + p1cb1:'',p1cb2:'',p1cb3:'',p1cb4:'',p1cb5:'',p1cb6:'',p1cb7:'',p1cb8:'', + p1cb9:'',p1cba:'',p1cbb:'',p1cbc:'',p1cbd:'',p1cbe:'',p1cbf:'',p1cc0:'', + p1cc1:'',p1cc2:'',p1cc3:'',p1cc4:'',p1cc5:'',p1cc6:'',p1cc7:'',p1cc8:'', + p1cc9:'',p1cca:'',p1ccb:'',p1ccc:'',p1ccd:'',p1cce:'',p1ccf:'',p1cd0:'', + p1cd1:'',p1cd2:'',p1cd3:'',p1cd4:'',p1cd5:'',p1cd6:'',p1cd7:'',p1cd8:'', + p1cd9:'',p1cda:'',p1cdb:'',p1cdc:'',p1cdd:'',p1cde:'',p1cdf:'',p1ce0:'', + p1ce1:'',p1ce2:'',p1ce3:'',p1ce4:'',p1ce5:'',p1ce6:'',p1ce7:'',p1ce8:'', + p1ce9:'',p1cea:'',p1ceb:'',p1cec:'',p1ced:'',p1cee:'',p1cef:'',p1cf0:'', + p1cf1:'',p1cf2:'',p1cf3:'',p1cf4:'',p1cf5:'',p1cf6:'',p1cf7:'',p1cf8:'', + p1cf9:'',p1cfa:'',p1cfb:'',p1cfc:'',p1cfd:'',p1cfe:'',p1cff:'',p1d00:'', + p1d01:'',p1d02:'',p1d03:'',p1d04:'',p1d05:'',p1d06:'',p1d07:'',p1d08:'', + p1d09:'',p1d0a:'',p1d0b:'',p1d0c:'',p1d0d:'',p1d0e:'',p1d0f:'',p1d10:'', + p1d11:'',p1d12:'',p1d13:'',p1d14:'',p1d15:'',p1d16:'',p1d17:'',p1d18:'', + p1d19:'',p1d1a:'',p1d1b:'',p1d1c:'',p1d1d:'',p1d1e:'',p1d1f:'',p1d20:'', + p1d21:'',p1d22:'',p1d23:'',p1d24:'',p1d25:'',p1d26:'',p1d27:'',p1d28:'', + p1d29:'',p1d2a:'',p1d2b:'',p1d2c:'',p1d2d:'',p1d2e:'',p1d2f:'',p1d30:'', + p1d31:'',p1d32:'',p1d33:'',p1d34:'',p1d35:'',p1d36:'',p1d37:'',p1d38:'', + p1d39:'',p1d3a:'',p1d3b:'',p1d3c:'',p1d3d:'',p1d3e:'',p1d3f:'',p1d40:'', + p1d41:'',p1d42:'',p1d43:'',p1d44:'',p1d45:'',p1d46:'',p1d47:'',p1d48:'', + p1d49:'',p1d4a:'',p1d4b:'',p1d4c:'',p1d4d:'',p1d4e:'',p1d4f:'',p1d50:'', + p1d51:'',p1d52:'',p1d53:'',p1d54:'',p1d55:'',p1d56:'',p1d57:'',p1d58:'', + p1d59:'',p1d5a:'',p1d5b:'',p1d5c:'',p1d5d:'',p1d5e:'',p1d5f:'',p1d60:'', + p1d61:'',p1d62:'',p1d63:'',p1d64:'',p1d65:'',p1d66:'',p1d67:'',p1d68:'', + p1d69:'',p1d6a:'',p1d6b:'',p1d6c:'',p1d6d:'',p1d6e:'',p1d6f:'',p1d70:'', + p1d71:'',p1d72:'',p1d73:'',p1d74:'',p1d75:'',p1d76:'',p1d77:'',p1d78:'', + p1d79:'',p1d7a:'',p1d7b:'',p1d7c:'',p1d7d:'',p1d7e:'',p1d7f:'',p1d80:'', + p1d81:'',p1d82:'',p1d83:'',p1d84:'',p1d85:'',p1d86:'',p1d87:'',p1d88:'', + p1d89:'',p1d8a:'',p1d8b:'',p1d8c:'',p1d8d:'',p1d8e:'',p1d8f:'',p1d90:'', + p1d91:'',p1d92:'',p1d93:'',p1d94:'',p1d95:'',p1d96:'',p1d97:'',p1d98:'', + p1d99:'',p1d9a:'',p1d9b:'',p1d9c:'',p1d9d:'',p1d9e:'',p1d9f:'',p1da0:'', + p1da1:'',p1da2:'',p1da3:'',p1da4:'',p1da5:'',p1da6:'',p1da7:'',p1da8:'', + p1da9:'',p1daa:'',p1dab:'',p1dac:'',p1dad:'',p1dae:'',p1daf:'',p1db0:'', + p1db1:'',p1db2:'',p1db3:'',p1db4:'',p1db5:'',p1db6:'',p1db7:'',p1db8:'', + p1db9:'',p1dba:'',p1dbb:'',p1dbc:'',p1dbd:'',p1dbe:'',p1dbf:'',p1dc0:'', + p1dc1:'',p1dc2:'',p1dc3:'',p1dc4:'',p1dc5:'',p1dc6:'',p1dc7:'',p1dc8:'', + p1dc9:'',p1dca:'',p1dcb:'',p1dcc:'',p1dcd:'',p1dce:'',p1dcf:'',p1dd0:'', + p1dd1:'',p1dd2:'',p1dd3:'',p1dd4:'',p1dd5:'',p1dd6:'',p1dd7:'',p1dd8:'', + p1dd9:'',p1dda:'',p1ddb:'',p1ddc:'',p1ddd:'',p1dde:'',p1ddf:'',p1de0:'', + p1de1:'',p1de2:'',p1de3:'',p1de4:'',p1de5:'',p1de6:'',p1de7:'',p1de8:'', + p1de9:'',p1dea:'',p1deb:'',p1dec:'',p1ded:'',p1dee:'',p1def:'',p1df0:'', + p1df1:'',p1df2:'',p1df3:'',p1df4:'',p1df5:'',p1df6:'',p1df7:'',p1df8:'', + p1df9:'',p1dfa:'',p1dfb:'',p1dfc:'',p1dfd:'',p1dfe:'',p1dff:'',p1e00:'', + p1e01:'',p1e02:'',p1e03:'',p1e04:'',p1e05:'',p1e06:'',p1e07:'',p1e08:'', + p1e09:'',p1e0a:'',p1e0b:'',p1e0c:'',p1e0d:'',p1e0e:'',p1e0f:'',p1e10:'', + p1e11:'',p1e12:'',p1e13:'',p1e14:'',p1e15:'',p1e16:'',p1e17:'',p1e18:'', + p1e19:'',p1e1a:'',p1e1b:'',p1e1c:'',p1e1d:'',p1e1e:'',p1e1f:'',p1e20:'', + p1e21:'',p1e22:'',p1e23:'',p1e24:'',p1e25:'',p1e26:'',p1e27:'',p1e28:'', + p1e29:'',p1e2a:'',p1e2b:'',p1e2c:'',p1e2d:'',p1e2e:'',p1e2f:'',p1e30:'', + p1e31:'',p1e32:'',p1e33:'',p1e34:'',p1e35:'',p1e36:'',p1e37:'',p1e38:'', + p1e39:'',p1e3a:'',p1e3b:'',p1e3c:'',p1e3d:'',p1e3e:'',p1e3f:'',p1e40:'', + p1e41:'',p1e42:'',p1e43:'',p1e44:'',p1e45:'',p1e46:'',p1e47:'',p1e48:'', + p1e49:'',p1e4a:'',p1e4b:'',p1e4c:'',p1e4d:'',p1e4e:'',p1e4f:'',p1e50:'', + p1e51:'',p1e52:'',p1e53:'',p1e54:'',p1e55:'',p1e56:'',p1e57:'',p1e58:'', + p1e59:'',p1e5a:'',p1e5b:'',p1e5c:'',p1e5d:'',p1e5e:'',p1e5f:'',p1e60:'', + p1e61:'',p1e62:'',p1e63:'',p1e64:'',p1e65:'',p1e66:'',p1e67:'',p1e68:'', + p1e69:'',p1e6a:'',p1e6b:'',p1e6c:'',p1e6d:'',p1e6e:'',p1e6f:'',p1e70:'', + p1e71:'',p1e72:'',p1e73:'',p1e74:'',p1e75:'',p1e76:'',p1e77:'',p1e78:'', + p1e79:'',p1e7a:'',p1e7b:'',p1e7c:'',p1e7d:'',p1e7e:'',p1e7f:'',p1e80:'', + p1e81:'',p1e82:'',p1e83:'',p1e84:'',p1e85:'',p1e86:'',p1e87:'',p1e88:'', + p1e89:'',p1e8a:'',p1e8b:'',p1e8c:'',p1e8d:'',p1e8e:'',p1e8f:'',p1e90:'', + p1e91:'',p1e92:'',p1e93:'',p1e94:'',p1e95:'',p1e96:'',p1e97:'',p1e98:'', + p1e99:'',p1e9a:'',p1e9b:'',p1e9c:'',p1e9d:'',p1e9e:'',p1e9f:'',p1ea0:'', + p1ea1:'',p1ea2:'',p1ea3:'',p1ea4:'',p1ea5:'',p1ea6:'',p1ea7:'',p1ea8:'', + p1ea9:'',p1eaa:'',p1eab:'',p1eac:'',p1ead:'',p1eae:'',p1eaf:'',p1eb0:'', + p1eb1:'',p1eb2:'',p1eb3:'',p1eb4:'',p1eb5:'',p1eb6:'',p1eb7:'',p1eb8:'', + p1eb9:'',p1eba:'',p1ebb:'',p1ebc:'',p1ebd:'',p1ebe:'',p1ebf:'',p1ec0:'', + p1ec1:'',p1ec2:'',p1ec3:'',p1ec4:'',p1ec5:'',p1ec6:'',p1ec7:'',p1ec8:'', + p1ec9:'',p1eca:'',p1ecb:'',p1ecc:'',p1ecd:'',p1ece:'',p1ecf:'',p1ed0:'', + p1ed1:'',p1ed2:'',p1ed3:'',p1ed4:'',p1ed5:'',p1ed6:'',p1ed7:'',p1ed8:'', + p1ed9:'',p1eda:'',p1edb:'',p1edc:'',p1edd:'',p1ede:'',p1edf:'',p1ee0:'', + p1ee1:'',p1ee2:'',p1ee3:'',p1ee4:'',p1ee5:'',p1ee6:'',p1ee7:'',p1ee8:'', + p1ee9:'',p1eea:'',p1eeb:'',p1eec:'',p1eed:'',p1eee:'',p1eef:'',p1ef0:'', + p1ef1:'',p1ef2:'',p1ef3:'',p1ef4:'',p1ef5:'',p1ef6:'',p1ef7:'',p1ef8:'', + p1ef9:'',p1efa:'',p1efb:'',p1efc:'',p1efd:'',p1efe:'',p1eff:'',p1f00:'' + } + } + let object = createObject(); + assertFalse(%HasFastProperties(object )); + assertEquals(Object.getPrototypeOf(object ), null); + let keys = Object.keys(object); + // modify original object + object['new_property'] = {}; + object[1] = 12; + + let object2 = createObject(); + assertFalse(object === object2 ); + assertFalse(%HasFastProperties(object2 )); + assertEquals(Object.getPrototypeOf(object2), null); + assertEquals(keys, Object.keys(object2)); +})(); + (function TestPrototypeInObjectLiteral() { // The prototype chain should not be used if the definition @@ -282,22 +1500,3 @@ TestNumericNamesSetter(['1.2', '1.3'], { delete Object.prototype.c; })(); - -(function TestProxyWithDefinitionInObjectLiteral() { - // Trap for set should not be used if the definition - // happens in the object literal. - var handler = { - set: function(target, name, value) { - } - }; - - const prop = 'a'; - - var p = new Proxy({}, handler); - p[prop] = 'my value'; - assertEquals(undefined, p[prop]); - - - var l = new Proxy({[prop]: 'my value'}, handler); - assertEquals('my value', l[prop]); -})(); diff --git a/deps/v8/test/mjsunit/object-seal.js b/deps/v8/test/mjsunit/object-seal.js index a901b1f480..f685b41927 100644 --- a/deps/v8/test/mjsunit/object-seal.js +++ b/deps/v8/test/mjsunit/object-seal.js @@ -28,7 +28,7 @@ // Tests the Object.seal and Object.isSealed methods - ES 19.1.2.17 and // ES 19.1.2.13 -// Flags: --allow-natives-syntax --crankshaft --noalways-opt +// Flags: --allow-natives-syntax --opt --noalways-opt // Test that we return obj if non-object is passed as argument var non_objects = new Array(undefined, null, 1, -1, 0, 42.43, Symbol("test")); diff --git a/deps/v8/test/mjsunit/osr-elements-kind.js b/deps/v8/test/mjsunit/osr-elements-kind.js index aee7017134..3f27bf2295 100644 --- a/deps/v8/test/mjsunit/osr-elements-kind.js +++ b/deps/v8/test/mjsunit/osr-elements-kind.js @@ -116,7 +116,7 @@ function construct_doubles() { return a; } -// Test transition chain SMI->DOUBLE->FAST (crankshafted function will +// Test transition chain SMI->DOUBLE->FAST (optimized function will // transition to FAST directly). function convert_mixed(array, value, kind) { array[1] = value; diff --git a/deps/v8/test/mjsunit/parse-tasks.js b/deps/v8/test/mjsunit/parse-tasks.js new file mode 100644 index 0000000000..11b48ebe0e --- /dev/null +++ b/deps/v8/test/mjsunit/parse-tasks.js @@ -0,0 +1,55 @@ +// 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: --compiler-dispatcher --use-parse-tasks --use-external-strings + +(function(a) { + assertEquals(a, "IIFE"); +})("IIFE"); + +(function(a, ...rest) { + assertEquals(a, 1); + assertEquals(rest.length, 2); + assertEquals(rest[0], 2); + assertEquals(rest[1], 3); +})(1,2,3); + +var outer_var = 42; + +function lazy_outer() { + return 42; +} + +var eager_outer = (function() { return 42; }); + +(function() { + assertEquals(outer_var, 42); + assertEquals(lazy_outer(), 42); + assertEquals(eager_outer(), 42); +})(); + +var gen = (function*() { + yield 1; + yield 2; +})(); + +assertEquals(gen.next().value, 1); +assertEquals(gen.next().value, 2); + +var result = (function recursive(a=0) { + if (a == 1) { + return 42; + } + return recursive(1); +})(); + +assertEquals(result, 42); + +var a = 42; +var b; +var c = (a, b = (function z(){ return a+1; })()); +assertEquals(b, 43); +assertEquals(c, 43); +var c = (a, b = (function z(){ return a+1; })()) => { return b; }; +assertEquals(c(314), 315); diff --git a/deps/v8/test/mjsunit/polymorph-arrays.js b/deps/v8/test/mjsunit/polymorph-arrays.js index 6a05c9f013..7d3221a20c 100644 --- a/deps/v8/test/mjsunit/polymorph-arrays.js +++ b/deps/v8/test/mjsunit/polymorph-arrays.js @@ -83,7 +83,7 @@ function testPolymorphicLoads() { load = make_polymorphic_load_function(); assertEquals(undefined, load(sparse_object_array, new Object())); - // Try with crankshaft. + // Try with optimizing compiler. load = make_polymorphic_load_function(); %OptimizeFunctionOnNextCall(load); assertEquals(1, load(object_array, 1)); diff --git a/deps/v8/test/mjsunit/proto-elements-add-during-foreach.js b/deps/v8/test/mjsunit/proto-elements-add-during-foreach.js index a99e8070d0..8ee4ebc37c 100644 --- a/deps/v8/test/mjsunit/proto-elements-add-during-foreach.js +++ b/deps/v8/test/mjsunit/proto-elements-add-during-foreach.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: --enable-fast-array-builtins - var a = [0,1,2,,,,7]; var proto = {} a.__proto__ = proto; diff --git a/deps/v8/test/mjsunit/regexp.js b/deps/v8/test/mjsunit/regexp.js index 6fb5660c08..dd4832b567 100644 --- a/deps/v8/test/mjsunit/regexp.js +++ b/deps/v8/test/mjsunit/regexp.js @@ -803,3 +803,8 @@ assertTrue(/^[\444]*$/.test("\u{24}4")); assertTrue(/^[\d-X]*$/.test("234-X-432")); // CharacterRangeOrUnion. assertTrue(/^[\d-X-Z]*$/.test("234-XZ-432")); assertFalse(/^[\d-X-Z]*$/.test("234-XYZ-432")); + +// Lone leading surrogates. Just here to exercise specific parsing code-paths. + +assertFalse(/\uDB88|\uDBEC|aa/.test("")); +assertFalse(/\uDB88|\uDBEC|aa/u.test("")); diff --git a/deps/v8/test/mjsunit/regress/regress-105.js b/deps/v8/test/mjsunit/regress/regress-105.js index 8b8030ffec..877cb82317 100644 --- a/deps/v8/test/mjsunit/regress/regress-105.js +++ b/deps/v8/test/mjsunit/regress/regress-105.js @@ -26,12 +26,12 @@ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. var custom_valueOf = function() { - assertEquals(Number, custom_valueOf.caller); + assertEquals(null, custom_valueOf.caller); return 2; } var custom_toString = function() { - assertEquals(String, custom_toString.caller); + assertEquals(null, custom_toString.caller); return "I used to be an adventurer like you"; } diff --git a/deps/v8/test/mjsunit/regress/regress-1119.js b/deps/v8/test/mjsunit/regress/regress-1119.js index 24ab49aa95..1163ca042e 100644 --- a/deps/v8/test/mjsunit/regress/regress-1119.js +++ b/deps/v8/test/mjsunit/regress/regress-1119.js @@ -28,8 +28,6 @@ // Test runtime declaration of properties with var which are intercepted // by JS accessors. -// Flags: --es52-globals - this.__defineSetter__("x", function() { hasBeenInvoked = true; }); this.__defineSetter__("y", function() { throw 'exception'; }); diff --git a/deps/v8/test/mjsunit/regress/regress-115452.js b/deps/v8/test/mjsunit/regress/regress-115452.js index d95bba893c..f745e1bad3 100644 --- a/deps/v8/test/mjsunit/regress/regress-115452.js +++ b/deps/v8/test/mjsunit/regress/regress-115452.js @@ -27,8 +27,6 @@ // Test that a function declaration cannot overwrite a read-only property. -// Flags: --es52-globals - function foobl() {} assertTrue(typeof this.foobl == "function"); assertTrue(Object.getOwnPropertyDescriptor(this, "foobl").writable); diff --git a/deps/v8/test/mjsunit/regress/regress-1240.js b/deps/v8/test/mjsunit/regress/regress-1240.js index 1a0bf2edb6..57d72b0a5a 100644 --- a/deps/v8/test/mjsunit/regress/regress-1240.js +++ b/deps/v8/test/mjsunit/regress/regress-1240.js @@ -33,7 +33,9 @@ var a = {}; Object.defineProperty(a, 'b', { get: function () { return 42; }, configurable: false }); // Do not allow us to redefine b on a. -a.__defineGetter__('b', function _b(){ return 'foo'; }); +try { + a.__defineGetter__('b', function _b(){ return 'foo'; }); +} catch (e) {} assertEquals(42, a.b); var desc = Object.getOwnPropertyDescriptor(a, 'b'); assertFalse(desc.configurable); diff --git a/deps/v8/test/mjsunit/regress/regress-1493017.js b/deps/v8/test/mjsunit/regress/regress-1493017.js index 99a1dad2e0..b46397c8a0 100644 --- a/deps/v8/test/mjsunit/regress/regress-1493017.js +++ b/deps/v8/test/mjsunit/regress/regress-1493017.js @@ -28,7 +28,7 @@ // Test collection of abandoned maps. Tests that deleted map // transitions do not show up as properties in for in. -// Flags: --expose-gc --collect-maps +// Flags: --expose-gc function C() {} diff --git a/deps/v8/test/mjsunit/regress/regress-2132.js b/deps/v8/test/mjsunit/regress/regress-2132.js index 51938c8027..c2f6c297b4 100644 --- a/deps/v8/test/mjsunit/regress/regress-2132.js +++ b/deps/v8/test/mjsunit/regress/regress-2132.js @@ -25,7 +25,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// Flags: --allow-natives-syntax --crankshaft --no-always-opt +// Flags: --allow-natives-syntax --opt --no-always-opt function mul(x, y) { return (x * y) | 0; diff --git a/deps/v8/test/mjsunit/regress/regress-2250.js b/deps/v8/test/mjsunit/regress/regress-2250.js index 013771971e..e2ce546628 100644 --- a/deps/v8/test/mjsunit/regress/regress-2250.js +++ b/deps/v8/test/mjsunit/regress/regress-2250.js @@ -25,7 +25,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// Flags: --allow-natives-syntax --crankshaft +// Flags: --allow-natives-syntax --opt // The original problem from the bug: In the example below SMI check for b // generated for inlining of equals invocation (marked with (*)) will be hoisted diff --git a/deps/v8/test/mjsunit/regress/regress-2315.js b/deps/v8/test/mjsunit/regress/regress-2315.js index 41211c42e9..9e40d0d3e3 100644 --- a/deps/v8/test/mjsunit/regress/regress-2315.js +++ b/deps/v8/test/mjsunit/regress/regress-2315.js @@ -25,7 +25,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// Flags: --allow-natives-syntax --crankshaft +// Flags: --allow-natives-syntax --opt var foo = (function() { return eval("(function bar() { return 1; })"); diff --git a/deps/v8/test/mjsunit/regress/regress-2339.js b/deps/v8/test/mjsunit/regress/regress-2339.js index 9db2f9c2bf..d7d2bb398a 100644 --- a/deps/v8/test/mjsunit/regress/regress-2339.js +++ b/deps/v8/test/mjsunit/regress/regress-2339.js @@ -25,7 +25,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// Flags: --allow-natives-syntax --expose-gc --crankshaft +// Flags: --allow-natives-syntax --expose-gc --opt function simple() { return simple_two_args(0, undefined); diff --git a/deps/v8/test/mjsunit/regress/regress-2451.js b/deps/v8/test/mjsunit/regress/regress-2451.js index 1a486be8b1..08efda2325 100644 --- a/deps/v8/test/mjsunit/regress/regress-2451.js +++ b/deps/v8/test/mjsunit/regress/regress-2451.js @@ -25,7 +25,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// Flags: --allow-natives-syntax --crankshaft +// Flags: --allow-natives-syntax --opt function f() { assertEquals(-1.0, Math.round(-1.5)); diff --git a/deps/v8/test/mjsunit/regress/regress-252797.js b/deps/v8/test/mjsunit/regress/regress-252797.js index c3bb139965..08b22176af 100644 --- a/deps/v8/test/mjsunit/regress/regress-252797.js +++ b/deps/v8/test/mjsunit/regress/regress-252797.js @@ -25,7 +25,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// Flags: --allow-natives-syntax --crankshaft +// Flags: --allow-natives-syntax --opt // The type feedback oracle had a bug when retrieving the map from an IC // starting with a negative lookup. @@ -45,6 +45,7 @@ assertFalse(%HasFastProperties(holder)); // Create a receiver into dictionary mode. var receiver = Object.create(holder, { killMe: {value: 0, configurable: true}, + keepMe: {value: 0, configurable: true} }); delete receiver.killMe; assertFalse(%HasFastProperties(receiver)); diff --git a/deps/v8/test/mjsunit/regress/regress-2618.js b/deps/v8/test/mjsunit/regress/regress-2618.js index be3168c1cd..10ed81f0be 100644 --- a/deps/v8/test/mjsunit/regress/regress-2618.js +++ b/deps/v8/test/mjsunit/regress/regress-2618.js @@ -25,7 +25,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// Flags: --use-osr --allow-natives-syntax --ignition-osr --crankshaft +// Flags: --use-osr --allow-natives-syntax --ignition-osr --opt function f() { do { diff --git a/deps/v8/test/mjsunit/regress/regress-3176.js b/deps/v8/test/mjsunit/regress/regress-3176.js index 370065d777..dbfe8218fd 100644 --- a/deps/v8/test/mjsunit/regress/regress-3176.js +++ b/deps/v8/test/mjsunit/regress/regress-3176.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 --crankshaft +// Flags: --allow-natives-syntax --opt function foo(a) { var sum = 0; diff --git a/deps/v8/test/mjsunit/regress/regress-330046.js b/deps/v8/test/mjsunit/regress/regress-330046.js index eb0d3f38a2..24557b4cc6 100644 --- a/deps/v8/test/mjsunit/regress/regress-330046.js +++ b/deps/v8/test/mjsunit/regress/regress-330046.js @@ -25,7 +25,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// Flags: --use-osr --allow-natives-syntax --crankshaft +// Flags: --use-osr --allow-natives-syntax --opt var o1 = {a : 10}; var o2 = { }; diff --git a/deps/v8/test/mjsunit/regress/regress-3408144.js b/deps/v8/test/mjsunit/regress/regress-3408144.js index 6e292d635a..8bd7b20eb9 100644 --- a/deps/v8/test/mjsunit/regress/regress-3408144.js +++ b/deps/v8/test/mjsunit/regress/regress-3408144.js @@ -28,8 +28,6 @@ // Test incorrect code generation for alternations on ARM. -// Flags: --nofull-compiler - function foo() { return (0 > ("10"||10) - 1); } diff --git a/deps/v8/test/mjsunit/regress/regress-347914.js b/deps/v8/test/mjsunit/regress/regress-347914.js index ec693ee92c..0137397cf2 100644 --- a/deps/v8/test/mjsunit/regress/regress-347914.js +++ b/deps/v8/test/mjsunit/regress/regress-347914.js @@ -3,7 +3,7 @@ // found in the LICENSE file. // Flags: --allow-natives-syntax --debug-code --gc-interval=201 --verify-heap --max-inlined-source-size=999999 --max-inlined-nodes=999999 --max-inlined-nodes-cumulative=999999 -// Flags: --crankshaft --no-always-opt +// Flags: --opt --no-always-opt // Begin stripped down and modified version of mjsunit.js for easy minimization in CF. function MjsUnitAssertionError(message) {} diff --git a/deps/v8/test/mjsunit/regress/regress-353004.js b/deps/v8/test/mjsunit/regress/regress-353004.js index 7e1fb7e939..233a0f11d1 100644 --- a/deps/v8/test/mjsunit/regress/regress-353004.js +++ b/deps/v8/test/mjsunit/regress/regress-353004.js @@ -59,18 +59,18 @@ assertThrows(function() { var buffer9 = new ArrayBuffer(1024); var array9 = new Uint8Array(buffer9); -var array10 = array9.subarray({valueOf : function() { +assertThrows(() => + array9.subarray({valueOf : function() { %ArrayBufferNeuter(buffer9); return 0; - }}, 1024); + }}, 1024), TypeError); assertEquals(0, array9.length); -assertEquals(0, array10.length); var buffer11 = new ArrayBuffer(1024); var array11 = new Uint8Array(buffer11); -var array12 = array11.subarray(0, {valueOf : function() { - %ArrayBufferNeuter(buffer11); - return 1024; - }}); +assertThrows(() => + array11.subarray(0, {valueOf : function() { + %ArrayBufferNeuter(buffer11); + return 1024; + }}), TypeError); assertEquals(0, array11.length); -assertEquals(0, array12.length); diff --git a/deps/v8/test/mjsunit/regress/regress-3650-3.js b/deps/v8/test/mjsunit/regress/regress-3650-3.js index f842428262..6195b12441 100644 --- a/deps/v8/test/mjsunit/regress/regress-3650-3.js +++ b/deps/v8/test/mjsunit/regress/regress-3650-3.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 --crankshaft +// Flags: --allow-natives-syntax --opt function foo(a) { for (var d in a) { diff --git a/deps/v8/test/mjsunit/regress/regress-3709.js b/deps/v8/test/mjsunit/regress/regress-3709.js index 0f6f7b71d4..ecb906a908 100644 --- a/deps/v8/test/mjsunit/regress/regress-3709.js +++ b/deps/v8/test/mjsunit/regress/regress-3709.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 --crankshaft --no-always-opt +// Flags: --allow-natives-syntax --opt --no-always-opt function getobj() { return { bar : function() { return 0}}; diff --git a/deps/v8/test/mjsunit/regress/regress-385565.js b/deps/v8/test/mjsunit/regress/regress-385565.js index 0244cdf75c..541e461d96 100644 --- a/deps/v8/test/mjsunit/regress/regress-385565.js +++ b/deps/v8/test/mjsunit/regress/regress-385565.js @@ -25,7 +25,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// Flags: --allow-natives-syntax --crankshaft --no-always-opt +// Flags: --allow-natives-syntax --opt --no-always-opt var calls = 0; diff --git a/deps/v8/test/mjsunit/regress/regress-410912.js b/deps/v8/test/mjsunit/regress/regress-410912.js index 5691161521..9a2e46d7bf 100644 --- a/deps/v8/test/mjsunit/regress/regress-410912.js +++ b/deps/v8/test/mjsunit/regress/regress-410912.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 --expose-gc --crankshaft --no-always-opt +// Flags: --allow-natives-syntax --expose-gc --opt --no-always-opt var assertDoesNotThrow; var assertInstanceof; diff --git a/deps/v8/test/mjsunit/regress/regress-4380.js b/deps/v8/test/mjsunit/regress/regress-4380.js index f51241ac7d..06a64790ef 100644 --- a/deps/v8/test/mjsunit/regress/regress-4380.js +++ b/deps/v8/test/mjsunit/regress/regress-4380.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 --crankshaft +// Flags: --allow-natives-syntax --opt function bar(a) { var x = a[0]; diff --git a/deps/v8/test/mjsunit/regress/regress-4665.js b/deps/v8/test/mjsunit/regress/regress-4665.js index a75d68f105..9aed4ed0ce 100644 --- a/deps/v8/test/mjsunit/regress/regress-4665.js +++ b/deps/v8/test/mjsunit/regress/regress-4665.js @@ -11,12 +11,14 @@ FirstBuffer.__proto__ = Uint8Array var buf = new Uint8Array(10) buf.__proto__ = FirstBuffer.prototype -var buf2 = buf.subarray(2) -assertEquals(8, buf2.length); +assertThrows(() => buf.subarray(2), TypeError); // Second test case +let seen_args = []; + function SecondBuffer (arg) { + seen_args.push(arg); var arr = new Uint8Array(arg) arr.__proto__ = SecondBuffer.prototype return arr @@ -25,7 +27,9 @@ SecondBuffer.prototype.__proto__ = Uint8Array.prototype SecondBuffer.__proto__ = Uint8Array var buf3 = new SecondBuffer(10) +assertEquals([10], seen_args); var buf4 = buf3.subarray(2) -assertEquals(8, buf4.length); +assertEquals(10, buf4.length); +assertEquals([10, buf3.buffer], seen_args); diff --git a/deps/v8/test/mjsunit/regress/regress-475705.js b/deps/v8/test/mjsunit/regress/regress-475705.js index ff96e041b1..ec8416aed4 100644 --- a/deps/v8/test/mjsunit/regress/regress-475705.js +++ b/deps/v8/test/mjsunit/regress/regress-475705.js @@ -5,7 +5,7 @@ // Crankshaft changes the stack usage and messes up the binary search for the // stack depth that causes a stack overflow. The issue only arises without // regexp optimization, which can happen on pages that create a lot of regexps. -// Flags: --nocrankshaft --noregexp-optimization +// Flags: --noopt --noregexp-optimization // Should not crash with a stack overflow in the regexp compiler, even when the // JS has used most of the stack. diff --git a/deps/v8/test/mjsunit/regress/regress-4825.js b/deps/v8/test/mjsunit/regress/regress-4825.js index 5ad096f3ed..fafd3db73b 100644 --- a/deps/v8/test/mjsunit/regress/regress-4825.js +++ b/deps/v8/test/mjsunit/regress/regress-4825.js @@ -2,6 +2,8 @@ // 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 enumerate(o) { var keys = []; for (var key in o) keys.push(key); @@ -10,11 +12,13 @@ function enumerate(o) { (function testSlowSloppyArgumentsElements() { function slowSloppyArguments(a, b, c) { + %HeapObjectVerify(arguments); arguments[10000] = "last"; arguments[4000] = "first"; arguments[6000] = "second"; arguments[5999] = "x"; arguments[3999] = "y"; + %HeapObjectVerify(arguments); return arguments; } assertEquals(["0", "1", "2", "3999", "4000", "5999", "6000", "10000"], @@ -29,10 +33,12 @@ function enumerate(o) { Object.defineProperty(arguments, 10000, { enumerable: false, configurable: false, value: "NOPE" }); + %HeapObjectVerify(arguments); arguments[4000] = "first"; arguments[6000] = "second"; arguments[5999] = "x"; arguments[3999] = "y"; + %HeapObjectVerify(arguments); return arguments; } @@ -43,11 +49,13 @@ function enumerate(o) { enumerate(slowSloppyArguments(1,2,3))); })(); + (function testFastSloppyArgumentsElements() { function fastSloppyArguments(a, b, c) { arguments[5] = 1; arguments[7] = 0; arguments[3] = 2; + %HeapObjectVerify(arguments); return arguments; } assertEquals(["0", "1", "2", "3", "5", "7"], @@ -58,7 +66,11 @@ function enumerate(o) { function fastSloppyArguments2(a, b, c) { delete arguments[0]; + %DebugPrint(arguments); + %HeapObjectVerify(arguments); arguments[0] = "test"; + %DebugPrint(arguments); + %HeapObjectVerify(arguments); return arguments; } @@ -71,8 +83,10 @@ function enumerate(o) { Object.defineProperty(arguments, 5, { enumerable: false, configurable: false, value: "NOPE" }); + %HeapObjectVerify(arguments); arguments[7] = 0; arguments[3] = 2; + %HeapObjectVerify(arguments); return arguments; } assertEquals( @@ -83,10 +97,12 @@ function enumerate(o) { function fastSloppyArguments2(a, b, c) { delete arguments[0]; + %HeapObjectVerify(arguments); Object.defineProperty(arguments, 1, { enumerable: false, configurable: false, value: "NOPE" }); arguments[0] = "test"; + %HeapObjectVerify(arguments); return arguments; } diff --git a/deps/v8/test/mjsunit/regress/regress-5404.js b/deps/v8/test/mjsunit/regress/regress-5404.js index b776a73bd0..72c5d30fe3 100644 --- a/deps/v8/test/mjsunit/regress/regress-5404.js +++ b/deps/v8/test/mjsunit/regress/regress-5404.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 --crankshaft +// Flags: --allow-natives-syntax --opt function foo(a, b) { return a + "0123456789012"; diff --git a/deps/v8/test/mjsunit/regress/regress-5790.js b/deps/v8/test/mjsunit/regress/regress-5790.js index 8709cd4aa3..eb405237e1 100644 --- a/deps/v8/test/mjsunit/regress/regress-5790.js +++ b/deps/v8/test/mjsunit/regress/regress-5790.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 --crankshaft +// Flags: --allow-natives-syntax --opt function foo(a) { "use strict"; diff --git a/deps/v8/test/mjsunit/regress/regress-5802.js b/deps/v8/test/mjsunit/regress/regress-5802.js index 799d89cada..57c8198c0c 100644 --- a/deps/v8/test/mjsunit/regress/regress-5802.js +++ b/deps/v8/test/mjsunit/regress/regress-5802.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 --crankshaft +// Flags: --allow-natives-syntax --opt (function() { function eq(a, b) { return a == b; } diff --git a/deps/v8/test/mjsunit/regress/regress-5902.js b/deps/v8/test/mjsunit/regress/regress-5902.js index 69dde4387a..034b6a7951 100644 --- a/deps/v8/test/mjsunit/regress/regress-5902.js +++ b/deps/v8/test/mjsunit/regress/regress-5902.js @@ -58,5 +58,6 @@ assertEquals( 'Error.prototype', 'EvalError.prototype', 'RangeError.prototype', 'ReferenceError.prototype', 'SyntaxError.prototype', 'TypeError.prototype', 'URIError.prototype', + 'Map', 'Map.prototype.constructor', 'Set', 'Set.prototype.constructor' ], log); diff --git a/deps/v8/test/mjsunit/regress/regress-618608.js b/deps/v8/test/mjsunit/regress/regress-618608.js index 742cc6e32e..33c5fbf188 100644 --- a/deps/v8/test/mjsunit/regress/regress-618608.js +++ b/deps/v8/test/mjsunit/regress/regress-618608.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: --validate-asm --allow-natives-syntax --crankshaft --no-always-opt +// Flags: --validate-asm --allow-natives-syntax --opt --no-always-opt // /v8/test/mjsunit/regress/regress-crbug-431602.js // /v8/test/mjsunit/lazy-load.js diff --git a/deps/v8/test/mjsunit/regress/regress-6248.js b/deps/v8/test/mjsunit/regress/regress-6248.js new file mode 100644 index 0000000000..0631892549 --- /dev/null +++ b/deps/v8/test/mjsunit/regress/regress-6248.js @@ -0,0 +1,24 @@ +// 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: --allow-natives-syntax + +var sentinelObject = {}; +var evaluatedArg = false; +class C extends Object { + constructor() { + try { + super(evaluatedArg = true); + } catch (e) { + assertInstanceof(e, TypeError); + return sentinelObject; + } + } +} +Object.setPrototypeOf(C, parseInt); +assertSame(sentinelObject, new C()); +assertSame(sentinelObject, new C()); +%OptimizeFunctionOnNextCall(C) +assertSame(sentinelObject, new C()); +assertFalse(evaluatedArg); diff --git a/deps/v8/test/mjsunit/regress/regress-6280.js b/deps/v8/test/mjsunit/regress/regress-6280.js new file mode 100644 index 0000000000..e5ccf265f4 --- /dev/null +++ b/deps/v8/test/mjsunit/regress/regress-6280.js @@ -0,0 +1,22 @@ +// 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. + +function Module(stdlib, imports, buffer) { + "use asm"; + var x = new stdlib.Int8Array(buffer); + function f() { + return x[0] | 0; + } + return { f:f }; +} + +var b = new ArrayBuffer(1024); +var m1 = Module({ Int8Array:Int8Array }, {}, b); +assertEquals(0, m1.f()); + +var was_called = 0; +function observer() { was_called++; return [23]; } +var m2 = Module({ Int8Array:observer }, {}, b); +assertEquals(1, was_called); +assertEquals(23, m2.f()); diff --git a/deps/v8/test/mjsunit/regress/regress-6288.js b/deps/v8/test/mjsunit/regress/regress-6288.js new file mode 100644 index 0000000000..eb8e735920 --- /dev/null +++ b/deps/v8/test/mjsunit/regress/regress-6288.js @@ -0,0 +1,13 @@ +// 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. + +// Environment Variables: LC_ALL=pt-BR.UTF8 + +// The data files packaged with d8 currently have Brazillian Portugese +// DateTimeFormat but not Collation + +if (this.Intl) { + assertEquals('und', Intl.Collator().resolvedOptions().locale); + assertEquals('pt-BR', Intl.DateTimeFormat().resolvedOptions().locale); +} diff --git a/deps/v8/test/mjsunit/regress/regress-6298.js b/deps/v8/test/mjsunit/regress/regress-6298.js new file mode 100644 index 0000000000..c3f4de3c2d --- /dev/null +++ b/deps/v8/test/mjsunit/regress/regress-6298.js @@ -0,0 +1,16 @@ +// 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: --allow-natives-syntax + +function Module(stdlib, imports, buffer) { + "use asm"; + function f() { + return (281474976710655 * 1048575) | 0; + } + return { f:f }; +} +var m = Module(this); +assertEquals(-1048576, m.f()); +assertFalse(%IsAsmWasmCode(Module)); diff --git a/deps/v8/test/mjsunit/regress/regress-6337.js b/deps/v8/test/mjsunit/regress/regress-6337.js new file mode 100644 index 0000000000..e80804ee5b --- /dev/null +++ b/deps/v8/test/mjsunit/regress/regress-6337.js @@ -0,0 +1,5 @@ +// 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. + +assertThrows(function() { eval(`class C { ...[] }`); } ) diff --git a/deps/v8/test/mjsunit/regress/regress-641091.js b/deps/v8/test/mjsunit/regress/regress-641091.js new file mode 100644 index 0000000000..33a98ef52c --- /dev/null +++ b/deps/v8/test/mjsunit/regress/regress-641091.js @@ -0,0 +1,15 @@ +// 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. + +assertEquals(["🍤", "🍤"], + '🍤🍦🍋ππ🍋🍦🍤'.match(/🍤/ug)); + +assertEquals(["🍤", "🍦", "🍦", "🍤"], + '🍤🍦🍋ππ🍋🍦🍤'.match(/🍤|🍦/ug)); + +assertEquals(["🍤", "🍦", "🍋", "🍋", "🍦", "🍤"], + '🍤🍦🍋ππ🍋🍦🍤'.match(/🍤|🍦|🍋/ug)); + +assertEquals(["🍤", "🍦", "🍋", "π", "π", "🍋", "🍦", "🍤"], + '🍤🍦🍋ππ🍋🍦🍤'.match(/🍤|🍦|π|🍋/ug)); diff --git a/deps/v8/test/mjsunit/regress/regress-645680.js b/deps/v8/test/mjsunit/regress/regress-645680.js index b244d9c047..de216f07fc 100644 --- a/deps/v8/test/mjsunit/regress/regress-645680.js +++ b/deps/v8/test/mjsunit/regress/regress-645680.js @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Flags: --expose-gc -// +// Flags: --expose-gc --allow-natives-syntax + function getRandomProperty(v, rand) { var properties = Object.getOwnPropertyNames(v); if ("constructor" && v.constructor.hasOwnProperty()) {; } @@ -11,10 +11,12 @@ function getRandomProperty(v, rand) { return properties[rand % properties.length]; } -var __v_18 = (function( b) { return arguments; })("foo", NaN, "bar"); -__v_18.__p_293850326 = "foo"; -__v_18.__defineGetter__(getRandomProperty( 990787501), function() { +var args = (function( b) { return arguments; })("foo", NaN, "bar"); +args.__p_293850326 = "foo"; +%HeapObjectVerify(args); +args.__defineGetter__(getRandomProperty( 990787501), function() { gc(); - return __v_18.__p_293850326; + return args.__p_293850326; }); -Array.prototype.indexOf.call(__v_18) +%HeapObjectVerify(args); +Array.prototype.indexOf.call(args) diff --git a/deps/v8/test/mjsunit/regress/regress-707066.js b/deps/v8/test/mjsunit/regress/regress-707066.js new file mode 100644 index 0000000000..b33b585ebd --- /dev/null +++ b/deps/v8/test/mjsunit/regress/regress-707066.js @@ -0,0 +1,25 @@ +// 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-function-tostring + +// There was a bug in CreateDynamicFunction where a stack overflow +// situation caused an assertion failure. + +function test(api) { + function f() { + try { + // induce a stack overflow + f(); + } catch(e) { + // this might result in even more stack overflows + api(); + } + } + f(); +} + +test(( function (){}).constructor); // Function +test(( function*(){}).constructor); // GeneratorFunction +test((async function (){}).constructor); // AsyncFunction diff --git a/deps/v8/test/mjsunit/regress/regress-709782.js b/deps/v8/test/mjsunit/regress/regress-709782.js new file mode 100644 index 0000000000..e33f694ec9 --- /dev/null +++ b/deps/v8/test/mjsunit/regress/regress-709782.js @@ -0,0 +1,14 @@ +// 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: --allow-natives-syntax + +var a = [0]; +function bar(x) { return x; } +function foo() { return a.reduce(bar); } + +assertEquals(0, foo()); +assertEquals(0, foo()); +%OptimizeFunctionOnNextCall(foo); +assertEquals(0, foo()); diff --git a/deps/v8/test/mjsunit/regress/regress-711165.js b/deps/v8/test/mjsunit/regress/regress-711165.js new file mode 100644 index 0000000000..9a42451e25 --- /dev/null +++ b/deps/v8/test/mjsunit/regress/regress-711165.js @@ -0,0 +1,9 @@ +// 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. + +// This is testing a leak failure. + +try { + Realm.navigate(0); +} catch(e) {} diff --git a/deps/v8/test/mjsunit/regress/regress-716044.js b/deps/v8/test/mjsunit/regress/regress-716044.js new file mode 100644 index 0000000000..264424c811 --- /dev/null +++ b/deps/v8/test/mjsunit/regress/regress-716044.js @@ -0,0 +1,25 @@ +// 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: --verify-heap + +class Array1 extends Array { + constructor(len) { + super(1); + } +}; + +class MyArray extends Array { + static get [Symbol.species]() { + return Array1; + } +} + +a = new MyArray(); + +for (var i = 0; i < 100000; i++) { + a.push(1); +} + +a.map(function(x) { return 42; }); diff --git a/deps/v8/test/mjsunit/regress/regress-718285.js b/deps/v8/test/mjsunit/regress/regress-718285.js new file mode 100644 index 0000000000..409f343693 --- /dev/null +++ b/deps/v8/test/mjsunit/regress/regress-718285.js @@ -0,0 +1,46 @@ +// 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. + +function foo_reference(n) { + var array = new Int32Array(n + 1); + for (var i = 0; i < n; ++i) { + array[i] = i; + } + var array2 = new Int32Array(array); + array2.set(new Uint8Array(array.buffer, 0, n), 1); + return array2; +} + +function foo(n) { + var array = new Int32Array(n + 1); + for (var i = 0; i < n; ++i) { + array[i] = i; + } + array.set(new Uint8Array(array.buffer, 0, n), 1); + return array; +} + +function bar_reference(n) { + var array = new Int32Array(n + 1); + for (var i = 0; i < n; ++i) { + array[i] = i; + } + var array2 = new Int32Array(array); + array2.set(new Uint8Array(array.buffer, 34), 0); + return array2; +} + +function bar(n) { + var array = new Int32Array(n + 1); + for (var i = 0; i < n; ++i) { + array[i] = i; + } + array.set(new Uint8Array(array.buffer, 34), 0); + return array; +} + +foo(10); +foo_reference(10); +bar(10); +bar_reference(10); diff --git a/deps/v8/test/mjsunit/regress/regress-718891.js b/deps/v8/test/mjsunit/regress/regress-718891.js new file mode 100644 index 0000000000..60ce380e01 --- /dev/null +++ b/deps/v8/test/mjsunit/regress/regress-718891.js @@ -0,0 +1,68 @@ +// 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: --allow-natives-syntax --expose-gc + +function Data() { +} +Data.prototype = { x: 1 }; + +function TriggerDeopt() { + Data.prototype = { x: 2 }; +} + +function TestDontSelfHealWithDeoptedCode(run_unoptimized, ClosureFactory) { + // Create some function closures which don't have + // optimized code. + var unoptimized_closure = ClosureFactory(); + if (run_unoptimized) { + unoptimized_closure(); + } + + // Run and optimize the code (do this in a seperate function + // so that the closure doesn't leak in a dead register). + (() => { + var optimized_closure = ClosureFactory(); + // Use .call to avoid the CallIC retaining the JSFunction in the + // feedback vector via a weak map, which would mean it wouldn't be + // collected in the minor gc below. + optimized_closure.call(undefined); + %OptimizeFunctionOnNextCall(optimized_closure); + optimized_closure.call(undefined); + })(); + + // Optimize a dummy function, just so it gets linked into the + // Contexts optimized_functions list head, which is in the old + // space, and the link from to the optimized_closure's JSFunction + // moves to the inline link in dummy's JSFunction in the new space, + // otherwise optimized_closure's JSFunction will be retained by the + // old->new remember set. + (() => { + var dummy = function() { return 1; }; + %OptimizeFunctionOnNextCall(dummy); + dummy(); + })(); + + // GC the optimized closure with a minor GC - the optimized + // code will remain in the feedback vector. + gc(true); + + // Trigger deoptimization by changing the prototype of Data. This + // will mark the code for deopt, but since no live JSFunction has + // optimized code, we won't clear the feedback vector. + TriggerDeopt(); + + // Call pre-existing functions, these will try to self-heal with the + // optimized code in the feedback vector op, but should bail-out + // since the code is marked for deoptimization. + unoptimized_closure(); +} + +// Run with the unoptimized closure both uncomplied and compiled for the +// interpreter initially, to test self healing on both CompileLazy and +// the InterpreterEntryTrampoline respectively. +TestDontSelfHealWithDeoptedCode(false, + () => { return () => { return new Data() }}); +TestDontSelfHealWithDeoptedCode(true, + () => { return () => { return new Data() }}); diff --git a/deps/v8/test/mjsunit/regress/regress-719380.js b/deps/v8/test/mjsunit/regress/regress-719380.js new file mode 100644 index 0000000000..18d541a5fe --- /dev/null +++ b/deps/v8/test/mjsunit/regress/regress-719380.js @@ -0,0 +1,7 @@ +// 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. + +TypeError.prototype.__defineGetter__("name", () => { throw 42; }); +console.log({ toString: () => { throw new TypeError() }}); +try { new WebAssembly.Table({}); } catch (e) {} diff --git a/deps/v8/test/mjsunit/regress/regress-722978.js b/deps/v8/test/mjsunit/regress/regress-722978.js new file mode 100644 index 0000000000..082c1f8be3 --- /dev/null +++ b/deps/v8/test/mjsunit/regress/regress-722978.js @@ -0,0 +1,15 @@ +// Copyright 2014 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: --always-opt + +var __v_3 = {}; +function __f_0() { + var __v_30 = -0; + __v_30.__defineGetter__("0", function() { return undefined; }); + __v_30 = 0; + __v_3 = 0; + assertTrue(Object.is(0, __v_30)); +} +__f_0(); diff --git a/deps/v8/test/mjsunit/regress/regress-725858.js b/deps/v8/test/mjsunit/regress/regress-725858.js new file mode 100644 index 0000000000..466673f816 --- /dev/null +++ b/deps/v8/test/mjsunit/regress/regress-725858.js @@ -0,0 +1,11 @@ +// 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: --allow-natives-syntax + +function f() {} +var src = 'f(' + '0,'.repeat(0x201f) + ')'; +var boom = new Function(src); +%OptimizeFunctionOnNextCall(boom); +boom(); diff --git a/deps/v8/test/mjsunit/regress/regress-727218.js b/deps/v8/test/mjsunit/regress/regress-727218.js new file mode 100644 index 0000000000..8b2aa06a20 --- /dev/null +++ b/deps/v8/test/mjsunit/regress/regress-727218.js @@ -0,0 +1,12 @@ +// 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. + +var f = ({ x } = { x: y }) => { + x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x; + x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x; + x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x; + x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x; + x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x; + x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x;x; +}; diff --git a/deps/v8/test/mjsunit/regress/regress-conditional-position.js b/deps/v8/test/mjsunit/regress/regress-conditional-position.js index ae5a3acb58..c9badd6830 100644 --- a/deps/v8/test/mjsunit/regress/regress-conditional-position.js +++ b/deps/v8/test/mjsunit/regress/regress-conditional-position.js @@ -25,7 +25,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// Flags: --nocrankshaft +// Flags: --noopt var functionToCatch; var lineNumber; diff --git a/deps/v8/test/mjsunit/regress/regress-crbug-157019.js b/deps/v8/test/mjsunit/regress/regress-crbug-157019.js index 1c54089ff9..66eb41bdd2 100644 --- a/deps/v8/test/mjsunit/regress/regress-crbug-157019.js +++ b/deps/v8/test/mjsunit/regress/regress-crbug-157019.js @@ -25,7 +25,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// Flags: --allow-natives-syntax --nocrankshaft +// Flags: --allow-natives-syntax --noopt function makeConstructor() { return function() { diff --git a/deps/v8/test/mjsunit/regress/regress-crbug-157520.js b/deps/v8/test/mjsunit/regress/regress-crbug-157520.js index 17081dfa52..9570085333 100644 --- a/deps/v8/test/mjsunit/regress/regress-crbug-157520.js +++ b/deps/v8/test/mjsunit/regress/regress-crbug-157520.js @@ -25,7 +25,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// Flags: --nocrankshaft +// Flags: --noopt (function(){ var f = function(arg) { diff --git a/deps/v8/test/mjsunit/regress/regress-crbug-244461.js b/deps/v8/test/mjsunit/regress/regress-crbug-244461.js index 7b465482e0..2afb76ac12 100644 --- a/deps/v8/test/mjsunit/regress/regress-crbug-244461.js +++ b/deps/v8/test/mjsunit/regress/regress-crbug-244461.js @@ -25,7 +25,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// Flags: --allow-natives-syntax --smi-only-arrays +// Flags: --allow-natives-syntax function foo(arg) { var a = arg(); diff --git a/deps/v8/test/mjsunit/regress/regress-crbug-504787.js b/deps/v8/test/mjsunit/regress/regress-crbug-504787.js index 66274bc6b9..ac592e08fb 100644 --- a/deps/v8/test/mjsunit/regress/regress-crbug-504787.js +++ b/deps/v8/test/mjsunit/regress/regress-crbug-504787.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: --noturbo-osr - function f() { "use asm"; function g() { diff --git a/deps/v8/test/mjsunit/regress/regress-crbug-506443.js b/deps/v8/test/mjsunit/regress/regress-crbug-506443.js index 0ab518f9b9..490edf0d4c 100644 --- a/deps/v8/test/mjsunit/regress/regress-crbug-506443.js +++ b/deps/v8/test/mjsunit/regress/regress-crbug-506443.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 --crankshaft --no-always-opt +// Flags: --allow-natives-syntax --opt --no-always-opt assertSame = function assertSame() { if (found === expected) { diff --git a/deps/v8/test/mjsunit/regress/regress-crbug-513507.js b/deps/v8/test/mjsunit/regress/regress-crbug-513507.js index 86a0f1b1f9..ae321ba906 100644 --- a/deps/v8/test/mjsunit/regress/regress-crbug-513507.js +++ b/deps/v8/test/mjsunit/regress/regress-crbug-513507.js @@ -4,7 +4,7 @@ // Flags: --allow-natives-syntax -// The following triggers a GC in SharedFunctionInfo::AddToOptimizedCodeMap. +// The following triggers a GC in Context::AddToOSROptimizedCodeCache. // Flags: --gc-interval=1234 --gc-global function makeFun() { diff --git a/deps/v8/test/mjsunit/regress/regress-crbug-554831.js b/deps/v8/test/mjsunit/regress/regress-crbug-554831.js index da78fa4c07..3d022b257b 100644 --- a/deps/v8/test/mjsunit/regress/regress-crbug-554831.js +++ b/deps/v8/test/mjsunit/regress/regress-crbug-554831.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 --crankshaft +// Flags: --allow-natives-syntax --opt (function() { var key = "s"; diff --git a/deps/v8/test/mjsunit/regress/regress-crbug-587068.js b/deps/v8/test/mjsunit/regress/regress-crbug-587068.js index 4af8110497..864f8ce7d2 100644 --- a/deps/v8/test/mjsunit/regress/regress-crbug-587068.js +++ b/deps/v8/test/mjsunit/regress/regress-crbug-587068.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 --crankshaft +// Flags: --allow-natives-syntax --opt // The Crankshaft fast case for String.fromCharCode used to unconditionally // deoptimize on non int32 indices. diff --git a/deps/v8/test/mjsunit/regress/regress-crbug-594183.js b/deps/v8/test/mjsunit/regress/regress-crbug-594183.js index 87f3195917..cb8003404d 100644 --- a/deps/v8/test/mjsunit/regress/regress-crbug-594183.js +++ b/deps/v8/test/mjsunit/regress/regress-crbug-594183.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 --crankshaft --no-always-opt +// Flags: --allow-natives-syntax --opt --no-always-opt var global = {} diff --git a/deps/v8/test/mjsunit/regress/regress-crbug-651403-global.js b/deps/v8/test/mjsunit/regress/regress-crbug-651403-global.js index 776bdcfc87..8682d822a5 100644 --- a/deps/v8/test/mjsunit/regress/regress-crbug-651403-global.js +++ b/deps/v8/test/mjsunit/regress/regress-crbug-651403-global.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: --ignition-staging --turbo --always-opt +// Flags: --turbo --always-opt x = ""; diff --git a/deps/v8/test/mjsunit/regress/regress-crbug-707580.js b/deps/v8/test/mjsunit/regress/regress-crbug-707580.js new file mode 100644 index 0000000000..37d13d219f --- /dev/null +++ b/deps/v8/test/mjsunit/regress/regress-crbug-707580.js @@ -0,0 +1,10 @@ +// 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. + +var thrower = { [Symbol.toPrimitive] : function() { throw "I was called!" } }; +var heap_number = 4.2; +var smi_number = 23; + +assertThrows(() => heap_number.hasOwnProperty(thrower)); +assertThrows(() => smi_number.hasOwnProperty(thrower)); diff --git a/deps/v8/test/mjsunit/regress/regress-crbug-711166.js b/deps/v8/test/mjsunit/regress/regress-crbug-711166.js new file mode 100644 index 0000000000..7f4acb963d --- /dev/null +++ b/deps/v8/test/mjsunit/regress/regress-crbug-711166.js @@ -0,0 +1,22 @@ +// 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: --allow-natives-syntax + +'use strict' +function g() { + var x = 1; + try { undefined.x } catch (e) { x = e; } + (function() { x }); + return x; +} +function f(a) { + var args = arguments; + assertInstanceof(g(), TypeError); + return args.length; +} +assertEquals(1, f(0)); +assertEquals(1, f(0)); +%OptimizeFunctionOnNextCall(f); +assertEquals(1, f(0)); diff --git a/deps/v8/test/mjsunit/regress/regress-crbug-712802.js b/deps/v8/test/mjsunit/regress/regress-crbug-712802.js new file mode 100644 index 0000000000..e23519e179 --- /dev/null +++ b/deps/v8/test/mjsunit/regress/regress-crbug-712802.js @@ -0,0 +1,12 @@ +// 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: --allow-natives-syntax + +function foo(...args) { return Array.isArray(args); } + +assertTrue(foo()); +assertTrue(foo()); +%OptimizeFunctionOnNextCall(foo); +assertTrue(foo()); diff --git a/deps/v8/test/mjsunit/regress/regress-crbug-714696.js b/deps/v8/test/mjsunit/regress/regress-crbug-714696.js new file mode 100644 index 0000000000..16b09604e9 --- /dev/null +++ b/deps/v8/test/mjsunit/regress/regress-crbug-714696.js @@ -0,0 +1,10 @@ +// 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. + +if (this.Intl) { + new Intl.v8BreakIterator(); + new Intl.DateTimeFormat(); + console.log({ toString: function() { throw 1; }}); + new Intl.v8BreakIterator(); +} diff --git a/deps/v8/test/mjsunit/regress/regress-crbug-714872.js b/deps/v8/test/mjsunit/regress/regress-crbug-714872.js new file mode 100644 index 0000000000..88dee1401e --- /dev/null +++ b/deps/v8/test/mjsunit/regress/regress-crbug-714872.js @@ -0,0 +1,8 @@ +// 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. + +function f() {} +f.prototype = 1; +f.foo = 1; +f.prototype = {}; diff --git a/deps/v8/test/mjsunit/regress/regress-crbug-714971.js b/deps/v8/test/mjsunit/regress/regress-crbug-714971.js new file mode 100644 index 0000000000..d72c7a0fad --- /dev/null +++ b/deps/v8/test/mjsunit/regress/regress-crbug-714971.js @@ -0,0 +1,19 @@ +// 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: --allow-natives-syntax + +function Module(stdlib, foreign, heap) { + "use asm"; + var a = new stdlib.Int16Array(heap); + function f() { + return a[23 >> -1]; + } + return { f:f }; +} +var b = new ArrayBuffer(1024); +var m = Module(this, {}, b); +new Int16Array(b)[0] = 42; +assertEquals(42, m.f()); +assertFalse(%IsAsmWasmCode(Module)); diff --git a/deps/v8/test/mjsunit/regress/regress-crbug-714981.js b/deps/v8/test/mjsunit/regress/regress-crbug-714981.js new file mode 100644 index 0000000000..e6a664d422 --- /dev/null +++ b/deps/v8/test/mjsunit/regress/regress-crbug-714981.js @@ -0,0 +1,32 @@ +// 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. + +function addProperties(o) +{ + o.p1 = 1; + o.p2 = 2; + o.p3 = 3; + o.p4 = 4; + o.p5 = 5; + o.p6 = 6; + o.p7 = 7; + o.p8 = 8; +} +function removeProperties(o) +{ + delete o.p8; + delete o.p7; + delete o.p6; + delete o.p5; +} +function makeO() +{ + var o = { }; + addProperties(o); + removeProperties(o); + addProperties(o); +} +for (var i = 0; i < 3; ++i) { + o = makeO(); +} diff --git a/deps/v8/test/mjsunit/regress/regress-crbug-715151.js b/deps/v8/test/mjsunit/regress/regress-crbug-715151.js new file mode 100644 index 0000000000..c0b2c5dba8 --- /dev/null +++ b/deps/v8/test/mjsunit/regress/regress-crbug-715151.js @@ -0,0 +1,15 @@ +// 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: --allow-natives-syntax --verify-heap + +function foo() { + var a = [0]; + Object.preventExtensions(a); + return a.pop(); +} +foo(); +foo(); +%OptimizeFunctionOnNextCall(foo); +foo(); diff --git a/deps/v8/test/mjsunit/regress/regress-crbug-715404.js b/deps/v8/test/mjsunit/regress/regress-crbug-715404.js new file mode 100644 index 0000000000..8ff2d00ba0 --- /dev/null +++ b/deps/v8/test/mjsunit/regress/regress-crbug-715404.js @@ -0,0 +1,11 @@ +// 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: --allow-natives-syntax + +function foo() { Array(-1); } +assertThrows(foo, RangeError); +assertThrows(foo, RangeError); +%OptimizeFunctionOnNextCall(foo); +assertThrows(foo, RangeError); diff --git a/deps/v8/test/mjsunit/regress/regress-crbug-715455.js b/deps/v8/test/mjsunit/regress/regress-crbug-715455.js new file mode 100644 index 0000000000..21ec165683 --- /dev/null +++ b/deps/v8/test/mjsunit/regress/regress-crbug-715455.js @@ -0,0 +1,25 @@ +// 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: --allow-natives-syntax + +function MODULE() { + "use asm"; + function f() { + bogus_function_table[0 & LIMIT](); + } + return { f:f }; +} + +var bogus_function_table = [ Object ]; +var test_set = [ 0x3fffffff, 0x7fffffff, 0xffffffff ]; +for (var i = 0; i < test_set.length; ++i) { + bogus_function_table[i] = Object; + var src = MODULE.toString(); + src = src.replace(/MODULE/g, "Module" + i); + src = src.replace(/LIMIT/g, test_set[i]); + var module = eval("(" + src + ")"); + assertDoesNotThrow(module(this).f()); + assertFalse(%IsAsmWasmCode(module)); +} diff --git a/deps/v8/test/mjsunit/regress/regress-crbug-715862.js b/deps/v8/test/mjsunit/regress/regress-crbug-715862.js new file mode 100644 index 0000000000..60e836ddc4 --- /dev/null +++ b/deps/v8/test/mjsunit/regress/regress-crbug-715862.js @@ -0,0 +1,17 @@ +// 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: --allow-natives-syntax --verify-heap + +function f(a) { + a.x = 0; + a[1] = 0.1; + a.x = {}; +} + +f(new Array(1)); +f(new Array()); + +%OptimizeFunctionOnNextCall(f); +f(new Array(1)); diff --git a/deps/v8/test/mjsunit/regress/regress-crbug-716520.js b/deps/v8/test/mjsunit/regress/regress-crbug-716520.js new file mode 100644 index 0000000000..5058c94a6b --- /dev/null +++ b/deps/v8/test/mjsunit/regress/regress-crbug-716520.js @@ -0,0 +1,21 @@ +// 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. + +var __v_0 = {}; +var __v_8 = this; +var __v_11 = -1073741825; +__v_1 = this; +try { +} catch(e) {; } + function __f_4() {} + __f_4.prototype = __v_0; + function __f_9() { return new __f_4().v; } + __f_9(); __f_9(); +try { +(function() { +})(); +} catch(e) {; } + Object.assign(__v_0, __v_1, __v_0); +(function() { +})(); diff --git a/deps/v8/test/mjsunit/regress/regress-crbug-716804.js b/deps/v8/test/mjsunit/regress/regress-crbug-716804.js new file mode 100644 index 0000000000..181a3d6c68 --- /dev/null +++ b/deps/v8/test/mjsunit/regress/regress-crbug-716804.js @@ -0,0 +1,13 @@ +// 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: --allow-natives-syntax + +var v = []; +v.__proto__ = function() {}; +v.prototype; + +var v = []; +v.__proto__ = new Error(); +v.stack; diff --git a/deps/v8/test/mjsunit/regress/regress-crbug-716912.js b/deps/v8/test/mjsunit/regress/regress-crbug-716912.js new file mode 100644 index 0000000000..ca1663d61a --- /dev/null +++ b/deps/v8/test/mjsunit/regress/regress-crbug-716912.js @@ -0,0 +1,23 @@ +// 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: --expose-gc --invoke-weak-callbacks + +function __f_6() { +this.a4 = {}; +} +__v_6 = new __f_6(); +__v_6.prototype = __v_6; +__v_6 = new __f_6(); +gc(); +gc(); + +buf = new ArrayBuffer(8); +__v_8 = new Int32Array(buf); +__v_9 = new Float64Array(buf); + +__v_8[0] = 1; +__v_6.a4 = {a: 0}; +delete __v_6.a4; +__v_6.boom = __v_9[0]; diff --git a/deps/v8/test/mjsunit/regress/regress-crbug-718779.js b/deps/v8/test/mjsunit/regress/regress-crbug-718779.js new file mode 100644 index 0000000000..e62c10729f --- /dev/null +++ b/deps/v8/test/mjsunit/regress/regress-crbug-718779.js @@ -0,0 +1,21 @@ +// 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. + +function __f_1() +{ + __v_1.p2 = 2147483648; + __v_1.p3 = 3; + __v_1.p4 = 4; + __v_1.p5 = 2147483648; + __v_1.p6 = 6; +} +function __f_2() +{ + delete __v_1.p6; + delete __v_1.p5; +} +var __v_1 = { }; +__f_1(__v_1); +__f_2(__v_1); +__f_1(__v_1); diff --git a/deps/v8/test/mjsunit/regress/regress-crbug-719479.js b/deps/v8/test/mjsunit/regress/regress-crbug-719479.js new file mode 100644 index 0000000000..dac49de3b7 --- /dev/null +++ b/deps/v8/test/mjsunit/regress/regress-crbug-719479.js @@ -0,0 +1,24 @@ +// 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: --allow-natives-syntax + +function baz(a, b) { + for (var i = 0; i < a.length; i++) { + if (a[i], b[i]) return false; + } +} +function bar(expected, found) { + if (!baz(found, expected)) { + } +}; +bar([{}, 6, NaN], [1.8, , NaN]); +function foo() { + var a = [1,2,3,4]; + bar(a.length, a.length); +} +foo(); +foo(); +%OptimizeFunctionOnNextCall(foo); +foo(); diff --git a/deps/v8/test/mjsunit/regress/regress-crbug-721835.js b/deps/v8/test/mjsunit/regress/regress-crbug-721835.js new file mode 100644 index 0000000000..80f99e6dd5 --- /dev/null +++ b/deps/v8/test/mjsunit/regress/regress-crbug-721835.js @@ -0,0 +1,31 @@ +// 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: --validate-asm --allow-natives-syntax + +(function TestValidationFailureInForStatement() { + function Module() { + "use asm" + function f() { + var a = 0; + for (a = b; 0; 0) {}; + return 0; + } + return { f:f }; + } + assertThrows(() => Module().f(), ReferenceError); + assertFalse(%IsAsmWasmCode(Module)); +})(); + +(function TestForStatementInVoidFunction() { + function Module() { + "use asm" + function f() { + for (1; 0; 0) {}; + } + return { f:f }; + } + assertDoesNotThrow(() => Module().f()); + assertTrue(%IsAsmWasmCode(Module)); +})(); diff --git a/deps/v8/test/mjsunit/regress/regress-crbug-723132.js b/deps/v8/test/mjsunit/regress/regress-crbug-723132.js new file mode 100644 index 0000000000..99189f6f21 --- /dev/null +++ b/deps/v8/test/mjsunit/regress/regress-crbug-723132.js @@ -0,0 +1,16 @@ +// 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. + +function outer() { + function* generator() { + let arrow = () => { + assertSame(expectedReceiver, this); + assertEquals(42, arguments[0]); + }; + arrow(); + } + generator.call(this, 42).next(); +} +let expectedReceiver = {}; +outer.call(expectedReceiver); diff --git a/deps/v8/test/mjsunit/regress/regress-crbug-723455.js b/deps/v8/test/mjsunit/regress/regress-crbug-723455.js new file mode 100644 index 0000000000..85f5e3c1d5 --- /dev/null +++ b/deps/v8/test/mjsunit/regress/regress-crbug-723455.js @@ -0,0 +1,18 @@ +// 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: --allow-natives-syntax --verify-heap + +function f(a) { + a.x = 0; + a[0] = 0.1; + a.x = {}; +} + +f(new Array(1)); +f(new Array(1)); +f(new Array()); + +%OptimizeFunctionOnNextCall(f); +f(new Array(1)); diff --git a/deps/v8/test/mjsunit/regress/regress-crbug-736451.js b/deps/v8/test/mjsunit/regress/regress-crbug-736451.js new file mode 100644 index 0000000000..3f70fe271b --- /dev/null +++ b/deps/v8/test/mjsunit/regress/regress-crbug-736451.js @@ -0,0 +1,13 @@ +// 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: --expose-externalize-string --no-stress-opt + +!function() { + const s0 = "external string turned into two byte"; + const s1 = s0.substring(1); + externalizeString(s0, true); + + s1.toLowerCase(); +}(); diff --git a/deps/v8/test/mjsunit/regress/regress-crbug-736575.js b/deps/v8/test/mjsunit/regress/regress-crbug-736575.js new file mode 100644 index 0000000000..3622b09b97 --- /dev/null +++ b/deps/v8/test/mjsunit/regress/regress-crbug-736575.js @@ -0,0 +1,14 @@ +// 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: --allow-natives-syntax + +function f() { + return [...[/*hole*/, 2.3]]; +} + +assertEquals(undefined, f()[0]); +assertEquals(undefined, f()[0]); +%OptimizeFunctionOnNextCall(f); +assertEquals(undefined, f()[0]); diff --git a/deps/v8/test/mjsunit/regress/regress-crbug-738763.js b/deps/v8/test/mjsunit/regress/regress-crbug-738763.js new file mode 100644 index 0000000000..71cb67b22e --- /dev/null +++ b/deps/v8/test/mjsunit/regress/regress-crbug-738763.js @@ -0,0 +1,25 @@ +// 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: --verify-heap --allow-natives-syntax --expose-gc + +let constant = { a: 1 }; + +function update_array(array) { + array.x = constant; + %HeapObjectVerify(array); + array[0] = undefined; + %HeapObjectVerify(array); + return array; +} + +let ar1 = [1]; +let ar2 = [2]; +let ar3 = [3]; +gc(); +gc(); + +update_array(ar1); +constant = update_array(ar2); +update_array(ar3); diff --git a/deps/v8/test/mjsunit/regress/regress-crbug-740803.js b/deps/v8/test/mjsunit/regress/regress-crbug-740803.js new file mode 100644 index 0000000000..b470ecafbf --- /dev/null +++ b/deps/v8/test/mjsunit/regress/regress-crbug-740803.js @@ -0,0 +1,19 @@ +// 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. + +({ + m() { + x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; + x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; + x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; + x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; + x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; + x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; + x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; + x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; + x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; + x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; x; + x; + } +}) diff --git a/deps/v8/test/mjsunit/regress/regress-crbug-747979.js b/deps/v8/test/mjsunit/regress/regress-crbug-747979.js new file mode 100644 index 0000000000..bbdea1ddf5 --- /dev/null +++ b/deps/v8/test/mjsunit/regress/regress-crbug-747979.js @@ -0,0 +1,32 @@ +// 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: --allow-natives-syntax + +function f(a) { + %HeapObjectVerify(a); + a[1] = 0; + %HeapObjectVerify(a); +} + +function foo() {} + +var arr1 = [0]; +var arr2 = [0]; +var arr3 = [0]; + +arr1.f = foo; +arr1[0] = 4.2; + +arr2.f = foo; + +arr3.f = foo; +arr3[0] = 4.2; +arr3.f = f; + +f(arr1); +f(arr2); +f(arr3); +%OptimizeFunctionOnNextCall(f); +f(arr3); diff --git a/deps/v8/test/mjsunit/regress/regress-crbug-748539.js b/deps/v8/test/mjsunit/regress/regress-crbug-748539.js new file mode 100644 index 0000000000..bae598710e --- /dev/null +++ b/deps/v8/test/mjsunit/regress/regress-crbug-748539.js @@ -0,0 +1,22 @@ +// 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: --allow-natives-syntax + +function f1() {} +function f2() {} + +var o1 = []; +o1.a = 0; +o1.f = f1; +%HeapObjectVerify(o1); + +var o2 = []; +o2.a = 4.2; +o2.f = f2; +%HeapObjectVerify(o2); + +o1.a; +%HeapObjectVerify(o1); +%HeapObjectVerify(o2); diff --git a/deps/v8/test/mjsunit/regress/regress-embedded-cons-string.js b/deps/v8/test/mjsunit/regress/regress-embedded-cons-string.js index b7c5e14231..08de6dbab1 100644 --- a/deps/v8/test/mjsunit/regress/regress-embedded-cons-string.js +++ b/deps/v8/test/mjsunit/regress/regress-embedded-cons-string.js @@ -28,7 +28,7 @@ // Flags: --fold-constants --nodead-code-elimination // Flags: --expose-gc --allow-natives-syntax // Flags: --concurrent-recompilation --block-concurrent-recompilation -// Flags: --crankshaft --no-always-opt +// Flags: --opt --no-always-opt if (!%IsConcurrentRecompilationSupported()) { print("Concurrent recompilation is disabled. Skipping this test."); diff --git a/deps/v8/test/mjsunit/regress/regress-map-invalidation-2.js b/deps/v8/test/mjsunit/regress/regress-map-invalidation-2.js index f1d2b7703f..ece96b3ff0 100644 --- a/deps/v8/test/mjsunit/regress/regress-map-invalidation-2.js +++ b/deps/v8/test/mjsunit/regress/regress-map-invalidation-2.js @@ -25,7 +25,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// Flags: --allow-natives-syntax --crankshaft +// Flags: --allow-natives-syntax --opt var c = { x: 2, y: 1 }; diff --git a/deps/v8/test/mjsunit/regress/regress-param-local-type.js b/deps/v8/test/mjsunit/regress/regress-param-local-type.js index 076a56dd25..0eaca50af5 100644 --- a/deps/v8/test/mjsunit/regress/regress-param-local-type.js +++ b/deps/v8/test/mjsunit/regress/regress-param-local-type.js @@ -25,7 +25,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// Flags: --allow-natives-syntax --crankshaft +// Flags: --allow-natives-syntax --opt // Test that we do not confuse the first local and the first parameter // when gathering type information. diff --git a/deps/v8/test/mjsunit/regress/regress-r4998.js b/deps/v8/test/mjsunit/regress/regress-r4998.js index 9cf33713b5..a82c266777 100644 --- a/deps/v8/test/mjsunit/regress/regress-r4998.js +++ b/deps/v8/test/mjsunit/regress/regress-r4998.js @@ -28,8 +28,6 @@ // Test for a broken fast-smi-loop that does not save the incremented value // of the loop index. If this test fails, it loops forever, and times out. -// Flags: --nofull-compiler - // Calling foo() spills the virtual frame. function foo() { return; diff --git a/deps/v8/test/mjsunit/regress/regress-store-uncacheable.js b/deps/v8/test/mjsunit/regress/regress-store-uncacheable.js index fdd200ae3a..4baedbacae 100644 --- a/deps/v8/test/mjsunit/regress/regress-store-uncacheable.js +++ b/deps/v8/test/mjsunit/regress/regress-store-uncacheable.js @@ -25,7 +25,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// Flags: --allow-natives-syntax --crankshaft +// Flags: --allow-natives-syntax --opt function f() { var o = {}; diff --git a/deps/v8/test/mjsunit/regress/regress-v8-5697.js b/deps/v8/test/mjsunit/regress/regress-v8-5697.js index 550bd98017..d7c1679fa1 100644 --- a/deps/v8/test/mjsunit/regress/regress-v8-5697.js +++ b/deps/v8/test/mjsunit/regress/regress-v8-5697.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 --crankshaft +// Flags: --allow-natives-syntax --opt function load(o) { return o.x; } diff --git a/deps/v8/test/mjsunit/regress/wasm/regress-712569.js b/deps/v8/test/mjsunit/regress/wasm/regress-712569.js new file mode 100644 index 0000000000..ea7e4060a0 --- /dev/null +++ b/deps/v8/test/mjsunit/regress/wasm/regress-712569.js @@ -0,0 +1,20 @@ +// 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. +// + +var v11 = {}; +Object.defineProperty(v11.__proto__, 0, { + get: function() { + }, + set: function() { + try { + WebAssembly.instantiate(); + v11[0] = 0; + } catch (e) { + assertTrue(e instanceof RangeError); + } + } +}); +v66 = new Array(); +cv = v66; cv[0] = 0.1; cv[2] = 0.2; diff --git a/deps/v8/test/mjsunit/regress/wasm/regression-02256.js b/deps/v8/test/mjsunit/regress/wasm/regression-02256.js index d0db4ca82a..3b9b76b5a6 100644 --- a/deps/v8/test/mjsunit/regress/wasm/regression-02256.js +++ b/deps/v8/test/mjsunit/regress/wasm/regression-02256.js @@ -4,7 +4,7 @@ // // Flags: --random-seed=891196975 --expose-gc --allow-natives-syntax // Flags: --gc-interval=207 --stress-compaction --validate-asm -// Flags: --crankshaft --no-always-opt +// Flags: --opt --no-always-opt // // /v8/test/mjsunit/wasm/grow-memory.js // /v8/test/mjsunit/regress/regress-540.js diff --git a/deps/v8/test/mjsunit/regress/wasm/regression-02256b.js b/deps/v8/test/mjsunit/regress/wasm/regression-02256b.js index 6facf0d4e3..120643896d 100644 --- a/deps/v8/test/mjsunit/regress/wasm/regression-02256b.js +++ b/deps/v8/test/mjsunit/regress/wasm/regression-02256b.js @@ -4,7 +4,7 @@ // // Flags: --random-seed=891196975 --expose-gc --allow-natives-syntax // Flags: --gc-interval=207 --stress-compaction --validate-asm -// Flags: --crankshaft --no-always-opt +// Flags: --opt --no-always-opt // // /v8/test/mjsunit/wasm/grow-memory.js // /v8/test/mjsunit/regress/regress-540.js diff --git a/deps/v8/test/mjsunit/regress/wasm/regression-647649.js b/deps/v8/test/mjsunit/regress/wasm/regression-647649.js index fc228d4b10..dc89ebd845 100644 --- a/deps/v8/test/mjsunit/regress/wasm/regression-647649.js +++ b/deps/v8/test/mjsunit/regress/wasm/regression-647649.js @@ -2,8 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Flags: --nostress-opt --expose-gc --invoke-weak-callbacks --validate-asm -// Flags: --noalways-opt --invoke-weak-callbacks +// Flags: --nostress-opt --expose-gc --noalways-opt --invoke-weak-callbacks // This test was generated by the fuzzer. @@ -38,6 +37,6 @@ Array.prototype.__proto__ = {3: __v_13}; Array.prototype.__proto__.__proto__ = {7: __v_11}; __v_9 = [0, 1, , , 4, 5, , , , 9] __v_12 = __v_9.splice(4, 1) -__v_9.__defineGetter__(getRandomProperty(__v_9, 1689439720), function() {; return __f_1(); }); +__v_9.__defineGetter__(getRandomProperty(__v_9, 1689439720), function() { return {}; }); __v_9[8] gc(); diff --git a/deps/v8/test/mjsunit/regress/wasm/regression-699485.js b/deps/v8/test/mjsunit/regress/wasm/regression-699485.js index 12477c5d37..7f4560789e 100644 --- a/deps/v8/test/mjsunit/regress/wasm/regression-699485.js +++ b/deps/v8/test/mjsunit/regress/wasm/regression-699485.js @@ -1,4 +1,4 @@ -// Copyright 2016 the V8 project authors. All rights reserved. +// 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. diff --git a/deps/v8/test/mjsunit/regress/wasm/regression-710844.js b/deps/v8/test/mjsunit/regress/wasm/regression-710844.js new file mode 100644 index 0000000000..a45e953574 --- /dev/null +++ b/deps/v8/test/mjsunit/regress/wasm/regression-710844.js @@ -0,0 +1,23 @@ +// 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. + +load("test/mjsunit/wasm/wasm-constants.js"); +load("test/mjsunit/wasm/wasm-module-builder.js"); + +(function() { + "use asm"; + var builder = new WasmModuleBuilder(); + builder.addMemory(0, 5, true); + builder.addFunction("regression_710844", kSig_v_v) + .addBody([ + kExprI32Const, 0x03, + kExprNop, + kExprGrowMemory, 0x00, + kExprI32Const, 0x13, + kExprNop, + kExprI32StoreMem8, 0x00, 0x10 + ]).exportFunc(); + let instance = builder.instantiate(); + instance.exports.regression_710844(); +})(); diff --git a/deps/v8/test/mjsunit/regress/wasm/regression-711203.js b/deps/v8/test/mjsunit/regress/wasm/regression-711203.js new file mode 100644 index 0000000000..46f274a8b0 --- /dev/null +++ b/deps/v8/test/mjsunit/regress/wasm/regression-711203.js @@ -0,0 +1,30 @@ +// 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. + +load("test/mjsunit/wasm/wasm-constants.js"); +load("test/mjsunit/wasm/wasm-module-builder.js"); + +(function() { + var builder = new WasmModuleBuilder(); + builder.addMemory(16, 32, false); + builder.addFunction("test", kSig_i_iii) + .addBodyWithEnd([ + // body: + kExprI64Const, 0, + kExprI64Const, 0x1, + kExprI64Clz, + kExprI64Sub, + kExprI64Const, 0x10, + kExprI64Const, 0x1b, + kExprI64Shl, + kExprI64Sub, + kExprI64Popcnt, + kExprI32ConvertI64, + kExprEnd, // @207 + ]) + .exportFunc(); + var module = builder.instantiate(); + const result = module.exports.test(1, 2, 3); + assertEquals(58, result); +})(); diff --git a/deps/v8/test/mjsunit/regress/wasm/regression-715216-a.js b/deps/v8/test/mjsunit/regress/wasm/regression-715216-a.js new file mode 100644 index 0000000000..56253414c9 --- /dev/null +++ b/deps/v8/test/mjsunit/regress/wasm/regression-715216-a.js @@ -0,0 +1,12 @@ +// 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: --wasm-interpret-all --validate-asm + +function asm() { + "use asm"; + function f() {} + return {}; +} +asm(); diff --git a/deps/v8/test/mjsunit/regress/wasm/regression-715216-b.js b/deps/v8/test/mjsunit/regress/wasm/regression-715216-b.js new file mode 100644 index 0000000000..0954f807dd --- /dev/null +++ b/deps/v8/test/mjsunit/regress/wasm/regression-715216-b.js @@ -0,0 +1,13 @@ +// 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: --wasm-interpret-all --wasm-lazy-compilation + +load("test/mjsunit/wasm/wasm-constants.js"); +load("test/mjsunit/wasm/wasm-module-builder.js"); + +var builder = new WasmModuleBuilder(); +builder.addFunction('f', kSig_v_v).addBody([]); +builder.addFunction('g', kSig_v_v).addBody([]); +builder.instantiate(); diff --git a/deps/v8/test/mjsunit/regress/wasm/regression-717056.js b/deps/v8/test/mjsunit/regress/wasm/regression-717056.js new file mode 100644 index 0000000000..534cf74eb7 --- /dev/null +++ b/deps/v8/test/mjsunit/regress/wasm/regression-717056.js @@ -0,0 +1,16 @@ +// 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. + +// Check that stack overflow inside asm-wasm translation propagates correctly. + +function asm() { + 'use asm'; + return {}; +} + +function rec() { + asm(); + rec(); +} +assertThrows(() => rec(), RangeError); diff --git a/deps/v8/test/mjsunit/regress/wasm/regression-719175.js b/deps/v8/test/mjsunit/regress/wasm/regression-719175.js new file mode 100644 index 0000000000..c6217b0b01 --- /dev/null +++ b/deps/v8/test/mjsunit/regress/wasm/regression-719175.js @@ -0,0 +1,16 @@ +// 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: --validate-asm --wasm-interpret-all + +function asm() { + 'use asm'; + function f() { + if (1.0 % 2.5 == -0.75) { + } + return 0; + } + return {f: f}; +} +asm().f(); diff --git a/deps/v8/test/mjsunit/regress/wasm/regression-722445.js b/deps/v8/test/mjsunit/regress/wasm/regression-722445.js new file mode 100644 index 0000000000..f6a96dc60d --- /dev/null +++ b/deps/v8/test/mjsunit/regress/wasm/regression-722445.js @@ -0,0 +1,16 @@ +// 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. + +load('test/mjsunit/wasm/wasm-constants.js'); +load('test/mjsunit/wasm/wasm-module-builder.js'); + +var builder = new WasmModuleBuilder(); +builder.addFunction('f', kSig_v_v).addBody([ + kExprI32Const, 0, kExprBrTable, + // 0x80000000 in LEB: + 0x80, 0x80, 0x80, 0x80, 0x08, + // First break target. Creation of this node triggered the bug. + 0 +]); +assertThrows(() => builder.instantiate(), WebAssembly.CompileError); diff --git a/deps/v8/test/mjsunit/regress/wasm/regression-731351.js b/deps/v8/test/mjsunit/regress/wasm/regression-731351.js new file mode 100644 index 0000000000..238223ac2c --- /dev/null +++ b/deps/v8/test/mjsunit/regress/wasm/regression-731351.js @@ -0,0 +1,23 @@ +// 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: --validate-asm --expose-gc --stress-opt + +gc(); +function asm(stdlib, foreign, buffer) { + "use asm"; + var HEAP32 = new stdlib.Uint32Array(buffer); + function load(a) { + a = a | 0; + return +(HEAP32[a >> 2] >>> 0); + } + return {load: load}; +} + +function RunAsmJsTest() { + buffer = new ArrayBuffer(65536); + var asm_module = asm({Uint32Array: Uint32Array}, {}, buffer); + asm_module.load(buffer.byteLength); +} +RunAsmJsTest(); diff --git a/deps/v8/test/mjsunit/regress/wasm/regression-734108.js b/deps/v8/test/mjsunit/regress/wasm/regression-734108.js new file mode 100644 index 0000000000..d8774f4a84 --- /dev/null +++ b/deps/v8/test/mjsunit/regress/wasm/regression-734108.js @@ -0,0 +1,16 @@ +// 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: --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, + 0x00, 0x01, 0x07, 0x11, 0x02, 0x04, 0x67, 0x72, 0x6f, 0x77, 0x00, + 0x00, 0x06, 0x6d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x02, 0x00, 0x0a, + 0x08, 0x01, 0x06, 0x00, 0x41, 0x01, 0x40, 0x00, 0x0b +]); +assertPromiseResult( + WebAssembly.compile(__v_0) +); diff --git a/deps/v8/test/mjsunit/regress/wasm/regression-737069.js b/deps/v8/test/mjsunit/regress/wasm/regression-737069.js new file mode 100644 index 0000000000..c68d10f06d --- /dev/null +++ b/deps/v8/test/mjsunit/regress/wasm/regression-737069.js @@ -0,0 +1,35 @@ +// 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: --expose-wasm + +load("test/mjsunit/wasm/wasm-constants.js"); +load("test/mjsunit/wasm/wasm-module-builder.js"); + +let binary = new Binary; + +binary.emit_header(); +binary.emit_section(kTypeSectionCode, section => { + section.emit_u32v(1); // number of types + section.emit_u8(kWasmFunctionTypeForm); + section.emit_u32v(0); // number of parameters + section.emit_u32v(0); // number of returns +}); +binary.emit_section(kFunctionSectionCode, section => { + section.emit_u32v(1); // number of functions + section.emit_u32v(0); // type index +}); + +binary.emit_u8(kCodeSectionCode); +binary.emit_u8(0x02); // section length +binary.emit_u8(0x01); // number of functions +binary.emit_u8(0x40); // function body size +// Function body is missing here. + +let buffer = new ArrayBuffer(binary.length); +let view = new Uint8Array(buffer); +for (let i = 0; i < binary.length; i++) { + view[i] = binary[i] | 0; +} +WebAssembly.validate(buffer); diff --git a/deps/v8/test/mjsunit/setters-on-elements.js b/deps/v8/test/mjsunit/setters-on-elements.js index f90c510c22..48fa33b5fe 100644 --- a/deps/v8/test/mjsunit/setters-on-elements.js +++ b/deps/v8/test/mjsunit/setters-on-elements.js @@ -25,11 +25,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// Flags: --allow-natives-syntax --max-opt-count=100 --noalways-opt -// Flags: --crankshaft - -// We specify max-opt-count because we opt/deopt the same function many -// times. +// Flags: --allow-natives-syntax --noalways-opt --opt // It's nice to run this in other browsers too. var standalone = false; diff --git a/deps/v8/test/mjsunit/shared-function-tier-up-turbo.js b/deps/v8/test/mjsunit/shared-function-tier-up-turbo.js index 56d07ad62b..95fa8d337c 100644 --- a/deps/v8/test/mjsunit/shared-function-tier-up-turbo.js +++ b/deps/v8/test/mjsunit/shared-function-tier-up-turbo.js @@ -3,7 +3,7 @@ // found in the LICENSE file. // // Flags: --mark-shared-functions-for-tier-up --allow-natives-syntax -// Flags: --ignition --turbo --crankshaft --no-always-opt +// Flags: --ignition --turbo --opt --no-always-opt // Flags: --turbo-filter=* // If we are always or never optimizing it is useless. diff --git a/deps/v8/test/mjsunit/shift-for-integer-div.js b/deps/v8/test/mjsunit/shift-for-integer-div.js index 7aadb4d237..9264242879 100644 --- a/deps/v8/test/mjsunit/shift-for-integer-div.js +++ b/deps/v8/test/mjsunit/shift-for-integer-div.js @@ -25,7 +25,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// Flags: --allow-natives-syntax --crankshaft --no-always-opt +// Flags: --allow-natives-syntax --opt --no-always-opt function divp4(x) { return x / 4; diff --git a/deps/v8/test/mjsunit/shifts.js b/deps/v8/test/mjsunit/shifts.js index b91b3e8a00..37ba9d17c1 100644 --- a/deps/v8/test/mjsunit/shifts.js +++ b/deps/v8/test/mjsunit/shifts.js @@ -25,8 +25,6 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// Flags: --nofull-compiler - // test a few corners cases with shifts // The result of the shift is not a Smi. diff --git a/deps/v8/test/mjsunit/sin-cos.js b/deps/v8/test/mjsunit/sin-cos.js index 8c4b80e8c1..7af471d3c0 100644 --- a/deps/v8/test/mjsunit/sin-cos.js +++ b/deps/v8/test/mjsunit/sin-cos.js @@ -27,7 +27,7 @@ // Test Math.sin and Math.cos. -// Flags: --allow-natives-syntax --crankshaft +// Flags: --allow-natives-syntax --opt assertEquals("-Infinity", String(1/Math.sin(-0))); assertEquals(1, Math.cos(-0)); diff --git a/deps/v8/test/mjsunit/skipping-inner-functions.js b/deps/v8/test/mjsunit/skipping-inner-functions.js new file mode 100644 index 0000000000..1c5538567f --- /dev/null +++ b/deps/v8/test/mjsunit/skipping-inner-functions.js @@ -0,0 +1,37 @@ +// 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: --experimental-preparser-scope-analysis + +(function TestBasicSkipping() { + var result = 0; + + function lazy(ctxt_alloc_param) { + var ctxt_alloc_var = 10; + function skip_me() { + result = ctxt_alloc_param + ctxt_alloc_var; + } + return skip_me; + } + // Test that parameters and variables of the outer function get context + // allocated even if we skip the inner function. + lazy(9)(); + assertEquals(19, result); +})(); + +(function TestSkippingFunctionWithEval() { + var result = 0; + + function lazy(ctxt_alloc_param) { + var ctxt_alloc_var = 10; + function skip_me() { + eval('result = ctxt_alloc_param + ctxt_alloc_var'); + } + return skip_me; + } + // Test that parameters and variables of the outer function get context + // allocated even if we skip the inner function. + lazy(9)(); + assertEquals(19, result); +})(); diff --git a/deps/v8/test/mjsunit/smi-mul-const.js b/deps/v8/test/mjsunit/smi-mul-const.js index ef0685b7a9..e5255014dc 100644 --- a/deps/v8/test/mjsunit/smi-mul-const.js +++ b/deps/v8/test/mjsunit/smi-mul-const.js @@ -25,7 +25,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// Flags: --allow-natives-syntax --crankshaft --noalways-opt +// Flags: --allow-natives-syntax --opt --noalways-opt function check(func, input, expected) { func(-1); diff --git a/deps/v8/test/mjsunit/smi-mul.js b/deps/v8/test/mjsunit/smi-mul.js index 236563590b..12d206abec 100644 --- a/deps/v8/test/mjsunit/smi-mul.js +++ b/deps/v8/test/mjsunit/smi-mul.js @@ -25,7 +25,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// Flags: --allow-natives-syntax --crankshaft --noalways-opt +// Flags: --allow-natives-syntax --opt --noalways-opt function mul(a, b) { return a * b; diff --git a/deps/v8/test/mjsunit/stack-traces.js b/deps/v8/test/mjsunit/stack-traces.js index 9522178c0d..33552bbf5c 100644 --- a/deps/v8/test/mjsunit/stack-traces.js +++ b/deps/v8/test/mjsunit/stack-traces.js @@ -264,7 +264,7 @@ function testOmittedBuiltin(throwing, omitted) { } -testTrace("testArrayNative", testArrayNative, ["Array.map (native)"]); +testTrace("testArrayNative", testArrayNative, ["Array.map"]); testTrace("testNested", testNested, ["at one", "at two", "at three"]); testTrace("testMethodNameInference", testMethodNameInference, ["at Foo.bar"]); testTrace("testImplicitConversion", testImplicitConversion, ["at Nirk.valueOf"]); diff --git a/deps/v8/test/mjsunit/string-case.js b/deps/v8/test/mjsunit/string-case.js index 34c2340d33..b6934eb705 100644 --- a/deps/v8/test/mjsunit/string-case.js +++ b/deps/v8/test/mjsunit/string-case.js @@ -59,8 +59,9 @@ function test(length) { strLower += String.fromCharCode(charCodeToLower(c)); strUpper += String.fromCharCode(charCodeToUpper(c)); } - %FlattenString(strLower); - %FlattenString(strUpper); + str = %FlattenString(str); + strLower = %FlattenString(strLower); + strUpper = %FlattenString(strUpper); // Sequential string. assertEquals(strLower, str.toLowerCase()); assertEquals(strUpper, str.toUpperCase()); diff --git a/deps/v8/test/mjsunit/strong-rooted-literals.js b/deps/v8/test/mjsunit/strong-rooted-literals.js index c124a913da..55ce89e4ef 100644 --- a/deps/v8/test/mjsunit/strong-rooted-literals.js +++ b/deps/v8/test/mjsunit/strong-rooted-literals.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 --expose-gc --turbo --crankshaft +// Flags: --allow-natives-syntax --expose-gc --turbo --opt // Make sure literals are strongly rooted and safe from weak-code deopts. diff --git a/deps/v8/test/mjsunit/type-profile/regress-707223.js b/deps/v8/test/mjsunit/type-profile/regress-707223.js new file mode 100644 index 0000000000..078b687c51 --- /dev/null +++ b/deps/v8/test/mjsunit/type-profile/regress-707223.js @@ -0,0 +1,8 @@ +// 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: --type-profile + +let e; +eval("e"); diff --git a/deps/v8/test/mjsunit/unary-minus-deopt.js b/deps/v8/test/mjsunit/unary-minus-deopt.js index cc3bede4d2..07f7e0e497 100644 --- a/deps/v8/test/mjsunit/unary-minus-deopt.js +++ b/deps/v8/test/mjsunit/unary-minus-deopt.js @@ -25,7 +25,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// Flags: --allow-natives-syntax --crankshaft --no-always-opt +// Flags: --allow-natives-syntax --opt --no-always-opt // This is a boiled-down example happening in the Epic Citadel demo: // After deopting, the multiplication for unary minus stayed in Smi diff --git a/deps/v8/test/mjsunit/wasm/asm-wasm-expr.js b/deps/v8/test/mjsunit/wasm/asm-wasm-expr.js index 3b20826fe7..ac42759788 100644 --- a/deps/v8/test/mjsunit/wasm/asm-wasm-expr.js +++ b/deps/v8/test/mjsunit/wasm/asm-wasm-expr.js @@ -23,7 +23,7 @@ const assign_in_stmt = [ "do { S } while (=)", ]; const assign_in_expr = [ - "i32_func(=)", + "i32_func(=) | 0", "(=) ? E : E", "E ? (=) : E", "E ? E : (=)", @@ -108,9 +108,6 @@ function DoTheTests(expr, assign, stmt) { e = e.replace(/S/g, stmt); var str = main.toString().replace("FUNC_BODY", "return (" + e + ") | 0;"); var asm_source = MODULE_TEMPLATE.toString().replace("FUNC_DECL", str); - // TODO(titzer): a verbosity API for these kinds of tests? - // print(asm_source); - doTest(asm_source, "(" + test + ") " + e); } @@ -123,8 +120,6 @@ function DoTheTests(expr, assign, stmt) { e = e.replace(/S/g, stmt); var str = main.toString().replace("FUNC_BODY", e + "; return 0;"); var asm_source = MODULE_TEMPLATE.toString().replace("FUNC_DECL", str); -// print(asm_source); - doTest(asm_source, "(" + test + ") " + e); } @@ -134,9 +129,8 @@ function DoTheTests(expr, assign, stmt) { var js_module = eval("(" + nonasm_source + ")")(stdlib, {}, buffer); expect(js_module); - var asmfunc = eval("(" + asm_source + ")"); - print("Testing ASMJS: " + orig); + var asmfunc = eval("(" + asm_source + ")"); var asm_module = asmfunc(stdlib, {}, buffer); assertTrue(%IsAsmWasmCode(asmfunc)); expect(asm_module); diff --git a/deps/v8/test/mjsunit/wasm/asm-wasm.js b/deps/v8/test/mjsunit/wasm/asm-wasm.js index a5d04ce4fe..9d7a807bc9 100644 --- a/deps/v8/test/mjsunit/wasm/asm-wasm.js +++ b/deps/v8/test/mjsunit/wasm/asm-wasm.js @@ -549,7 +549,6 @@ function TestHeapAccessIntTypes() { assertValidAsm(module_decl); assertEquals(7, module.caller()); assertEquals(7, memory_view[2]); - assertEquals(7, module_decl(stdlib).caller()); assertValidAsm(module_decl); } } @@ -1227,8 +1226,9 @@ TestForeignVariables(); return {load: load, iload: iload, store: store, storeb: storeb}; } + var memory = new ArrayBuffer(1024); var module_decl = eval('(' + TestByteHeapAccessCompat.toString() + ')'); - var m = module_decl(stdlib); + var m = module_decl(stdlib, null, memory); assertValidAsm(module_decl); m.store(0, 20); m.store(4, 21); diff --git a/deps/v8/test/mjsunit/wasm/async-compile.js b/deps/v8/test/mjsunit/wasm/async-compile.js index 135e39a9d8..b95930aa5a 100644 --- a/deps/v8/test/mjsunit/wasm/async-compile.js +++ b/deps/v8/test/mjsunit/wasm/async-compile.js @@ -7,43 +7,66 @@ load("test/mjsunit/wasm/wasm-constants.js"); load("test/mjsunit/wasm/wasm-module-builder.js"); -let ok_buffer = (() => { - var builder = new WasmModuleBuilder(); - builder.addFunction("f", kSig_i_v) - .addBody([kExprI32Const, 42]) - .exportAs("f"); - return builder.toBuffer(); -})(); - -// The OK buffer validates and can be made into a module. -assertTrue(WebAssembly.validate(ok_buffer)); -let ok_module = new WebAssembly.Module(ok_buffer); -assertTrue(ok_module instanceof WebAssembly.Module); - -// The bad buffer does not validate and cannot be made into a module. -let bad_buffer = new ArrayBuffer(0); -assertFalse(WebAssembly.validate(bad_buffer)); -assertThrows(() => new WebAssembly.Module(bad_buffer), WebAssembly.CompileError); - -function checkModule(module) { - assertTrue(module instanceof WebAssembly.Module); +function assertCompiles(buffer) { + return assertPromiseResult( + WebAssembly.compile(buffer), + module => assertTrue(module instanceof WebAssembly.Module), + ex => assertUnreachable); } -function checkCompileError(ex) { - assertTrue(ex instanceof WebAssembly.CompileError); +function assertCompileError(buffer) { + return assertPromiseResult( + WebAssembly.compile(buffer), module => assertUnreachable, + ex => assertTrue(ex instanceof WebAssembly.CompileError)); } -let kNumCompiles = 3; +assertPromiseResult(async function basicCompile() { + let ok_buffer = (() => { + var builder = new WasmModuleBuilder(); + builder.addFunction('f', kSig_i_v) + .addBody([kExprI32Const, 42]) + .exportAs('f'); + return builder.toBuffer(); + })(); -// Three compilations of the OK module should succeed. -for (var i = 0; i < kNumCompiles; i++) { - assertPromiseResult(WebAssembly.compile(ok_buffer), checkModule, - (ex) => assertUnreachable); -} + // The OK buffer validates and can be made into a module. + assertTrue(WebAssembly.validate(ok_buffer)); + let ok_module = new WebAssembly.Module(ok_buffer); + assertTrue(ok_module instanceof WebAssembly.Module); -// Three compilations of the bad module should fail. -for (var i = 0; i < kNumCompiles; i++) { - assertPromiseResult(WebAssembly.compile(bad_buffer), - (module) => assertUnreachable, - checkCompileError); -} + // The bad buffer does not validate and cannot be made into a module. + let bad_buffer = new ArrayBuffer(0); + assertFalse(WebAssembly.validate(bad_buffer)); + assertThrows( + () => new WebAssembly.Module(bad_buffer), WebAssembly.CompileError); + + let kNumCompiles = 3; + + // Three compilations of the OK module should succeed. + for (var i = 0; i < kNumCompiles; i++) { + await assertCompiles(ok_buffer); + } + + // Three compilations of the bad module should fail. + for (var i = 0; i < kNumCompiles; i++) { + await assertCompileError(bad_buffer); + } +}()); + +assertPromiseResult(async function badFunctionInTheMiddle() { + // We had an error where an exception was generated by a background task and + // later thrown in a foreground task. The handle to the exception died + // inbetween, since the HandleScope was left. + // This test reproduced that error. + let builder = new WasmModuleBuilder(); + let sig = builder.addType(kSig_i_v); + for (var i = 0; i < 10; ++i) { + builder.addFunction('a' + i, sig).addBody([kExprI32Const, 42]); + } + builder.addFunction('bad', sig).addBody([]); + for (var i = 0; i < 10; ++i) { + builder.addFunction('b' + i, sig).addBody([kExprI32Const, 42]); + } + let buffer = builder.toBuffer(); + await assertCompileError(buffer); +}()); diff --git a/deps/v8/test/mjsunit/wasm/compilation-limits.js b/deps/v8/test/mjsunit/wasm/compilation-limits.js index 1a4fa0a8ea..2cc38bdfea 100644 --- a/deps/v8/test/mjsunit/wasm/compilation-limits.js +++ b/deps/v8/test/mjsunit/wasm/compilation-limits.js @@ -106,8 +106,4 @@ async function TestAll() { await FailAsyncInstantiate(); } -%IncrementWaitCount(); -TestAll().then( - () => { %DecrementWaitCount(); }, - () => { %DecrementWaitCount(); } -); +assertPromiseResult(TestAll()); diff --git a/deps/v8/test/mjsunit/wasm/gc-buffer.js b/deps/v8/test/mjsunit/wasm/gc-buffer.js index 6bcf299d8b..f187d7dabe 100644 --- a/deps/v8/test/mjsunit/wasm/gc-buffer.js +++ b/deps/v8/test/mjsunit/wasm/gc-buffer.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: --expose-wasm --stress-gc --expose-gc +// Flags: --expose-wasm --gc-interval=500 --stress-compaction --expose-gc load("test/mjsunit/wasm/wasm-constants.js"); load("test/mjsunit/wasm/wasm-module-builder.js"); diff --git a/deps/v8/test/mjsunit/wasm/gc-stress.js b/deps/v8/test/mjsunit/wasm/gc-stress.js index 2bf2f758d6..a6c408d3db 100644 --- a/deps/v8/test/mjsunit/wasm/gc-stress.js +++ b/deps/v8/test/mjsunit/wasm/gc-stress.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: --expose-wasm --stress-gc +// Flags: --expose-wasm --gc-interval=500 --stress-compaction load("test/mjsunit/wasm/wasm-constants.js"); load("test/mjsunit/wasm/wasm-module-builder.js"); diff --git a/deps/v8/test/mjsunit/wasm/huge-memory.js b/deps/v8/test/mjsunit/wasm/huge-memory.js new file mode 100644 index 0000000000..9719ad4a28 --- /dev/null +++ b/deps/v8/test/mjsunit/wasm/huge-memory.js @@ -0,0 +1,76 @@ +// 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: --wasm-max-mem-pages=49152 + +// This test makes sure things don't break once we support >2GB wasm memories. +load("test/mjsunit/wasm/wasm-constants.js"); +load("test/mjsunit/wasm/wasm-module-builder.js"); + +function testHugeMemory() { + var builder = new WasmModuleBuilder(); + + const num_pages = 49152; // 3GB + + builder.addMemory(num_pages, num_pages, true); + builder.addFunction("geti", kSig_i_ii) + .addBody([ + kExprGetLocal, 0, + kExprGetLocal, 1, + kExprI32Mul, + kExprI32LoadMem, 0, 0, + ]) + .exportFunc(); + + var module = builder.instantiate(); + const geti = module.exports.geti; + + print("In bounds"); + assertEquals(0, geti(2500, 1 << 20)); + print("Out of bounds"); + assertTraps(kTrapMemOutOfBounds, () => geti(3500, 1 << 20)); +} +testHugeMemory(); + +function testHugeMemoryConstInBounds() { + var builder = new WasmModuleBuilder(); + + const num_pages = 49152; // 3GB + + builder.addMemory(num_pages, num_pages, true); + builder.addFunction("geti", kSig_i_v) + .addBody([ + kExprI32Const, 0x80, 0x80, 0x80, 0x80, 0x7A, // 0xA0000000, 2.5GB + kExprI32LoadMem, 0, 0, + ]) + .exportFunc(); + + var module = builder.instantiate(); + const geti = module.exports.geti; + + print("In bounds"); + assertEquals(0, geti()); +} +testHugeMemoryConstInBounds(); + +function testHugeMemoryConstOutOfBounds() { + var builder = new WasmModuleBuilder(); + + const num_pages = 49152; // 3GB + + builder.addMemory(num_pages, num_pages, true); + builder.addFunction("geti", kSig_i_v) + .addBody([ + kExprI32Const, 0x80, 0x80, 0x80, 0x80, 0x7E, // 0xE0000000, 3.5GB + kExprI32LoadMem, 0, 0, + ]) + .exportFunc(); + + var module = builder.instantiate(); + const geti = module.exports.geti; + + print("Out of bounds"); + assertTraps(kTrapMemOutOfBounds, geti); +} +testHugeMemoryConstOutOfBounds(); diff --git a/deps/v8/test/mjsunit/wasm/indirect-tables.js b/deps/v8/test/mjsunit/wasm/indirect-tables.js index 7583d05968..9bc646e2f0 100644 --- a/deps/v8/test/mjsunit/wasm/indirect-tables.js +++ b/deps/v8/test/mjsunit/wasm/indirect-tables.js @@ -523,3 +523,34 @@ function js_div(a, b) { return (a / b) | 0; } // Try to grow past imported maximum assertThrows(() => table.grow(21)); })(); + +(function InitImportedTableSignatureMismatch() { + // instance0 exports a function table and a main function which indirectly + // calls a function from the table. + let builder0 = new WasmModuleBuilder(); + let sig_index = builder0.addType(kSig_i_v); + builder0.addFunction('main', kSig_i_i) + .addBody([ + kExprGetLocal, 0, // - + kExprCallIndirect, sig_index, kTableZero + ]) + .exportAs('main'); + builder0.setFunctionTableLength(3); + builder0.addExportOfKind('table', kExternalTable); + let module0 = new WebAssembly.Module(builder0.toBuffer()); + let instance0 = new WebAssembly.Instance(module0); + + // instance1 imports the table and adds a function to it. + let builder1 = new WasmModuleBuilder(); + builder1.addFunction('f', kSig_i_i).addBody([kExprGetLocal, 0]); + builder1.addImportedTable('z', 'table'); + builder1.addFunctionTableInit(0, false, [0], true); + let module1 = new WebAssembly.Module(builder1.toBuffer()); + let instance1 = + new WebAssembly.Instance(module1, {z: {table: instance0.exports.table}}); + + // Calling the main method on instance0 should fail, because the signature of + // the added function does not match. + assertThrows( + () => instance0.exports.main(0), WebAssembly.RuntimeError); +})(); diff --git a/deps/v8/test/mjsunit/wasm/instantiate-module-basic.js b/deps/v8/test/mjsunit/wasm/instantiate-module-basic.js index e876a7997f..d2489f3e89 100644 --- a/deps/v8/test/mjsunit/wasm/instantiate-module-basic.js +++ b/deps/v8/test/mjsunit/wasm/instantiate-module-basic.js @@ -70,7 +70,7 @@ function CheckInstance(instance) { print('async instantiate...'); let instance_promise = WebAssembly.instantiate(buffer); - assertPromiseResult(instance_promise, CheckInstance); + assertPromiseResult(instance_promise, pair => CheckInstance(pair.instance)); })(); // Check that validate works correctly for a module. diff --git a/deps/v8/test/mjsunit/wasm/instantiate-run-basic.js b/deps/v8/test/mjsunit/wasm/instantiate-run-basic.js index e9e9a9ac48..b0016ec9aa 100644 --- a/deps/v8/test/mjsunit/wasm/instantiate-run-basic.js +++ b/deps/v8/test/mjsunit/wasm/instantiate-run-basic.js @@ -2,19 +2,33 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Flags: --expose-wasm +// Flags: --allow-natives-syntax load("test/mjsunit/wasm/wasm-constants.js"); load("test/mjsunit/wasm/wasm-module-builder.js"); -(function BasicTest() { - var kReturnValue = 15; +const kReturnValue = 15; + +function getBuilder() { var builder = new WasmModuleBuilder(); builder.addFunction("main", kSig_i_i) .addBody([kExprI32Const, kReturnValue]) .exportFunc(); + return builder; +} +(function BasicTest() { + var builder = getBuilder(); var main = builder.instantiate().exports.main; assertEquals(kReturnValue, main()); })(); + +(function AsyncTest() { + var builder = getBuilder(); + var buffer = builder.toBuffer(); + assertPromiseResult( + WebAssembly.instantiate(buffer) + .then(pair => pair.instance.exports.main(), assertUnreachable) + .then(result => assertEquals(kReturnValue, result), assertUnreachable)); +})(); diff --git a/deps/v8/test/mjsunit/wasm/js-api.js b/deps/v8/test/mjsunit/wasm/js-api.js index 689a0adbc4..0f6b0816be 100644 --- a/deps/v8/test/mjsunit/wasm/js-api.js +++ b/deps/v8/test/mjsunit/wasm/js-api.js @@ -713,7 +713,6 @@ function assertCompileError(args, err, msg) { var error = null; assertPromiseResult(compile(...args), unexpectedSuccess, error => { assertTrue(error instanceof err); - assertTrue(Boolean(error.stack.match('js-api.js'))); // TODO assertTrue(Boolean(error.message.match(msg))); }); } @@ -760,7 +759,6 @@ function assertInstantiateError(args, err, msg) { var error = null; assertPromiseResult(instantiate(...args), unexpectedSuccess, error => { assertTrue(error instanceof err); - assertTrue(Boolean(error.stack.match('js-api.js'))); // TODO assertTrue(Boolean(error.message.match(msg))); }); } diff --git a/deps/v8/test/mjsunit/wasm/wasm-api-overloading.js b/deps/v8/test/mjsunit/wasm/wasm-api-overloading.js new file mode 100644 index 0000000000..37320e54ce --- /dev/null +++ b/deps/v8/test/mjsunit/wasm/wasm-api-overloading.js @@ -0,0 +1,53 @@ +// 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: --allow-natives-syntax + +load("test/mjsunit/wasm/wasm-constants.js"); +load("test/mjsunit/wasm/wasm-module-builder.js"); + +%ResetWasmOverloads(); +let buffer = (() => { + let builder = new WasmModuleBuilder(); + builder.addFunction("f", kSig_i_v) + .addBody([kExprI32Const, 42]) + .exportAs("f"); + return builder.toBuffer(); +})(); + +var module = new WebAssembly.Module(buffer); +var wrapper = [module]; + +assertPromiseResult( + WebAssembly.instantiateStreaming(wrapper), + assertUnreachable, + e => assertTrue(e instanceof TypeError)); + +assertPromiseResult( + WebAssembly.compileStreaming(wrapper), + assertUnreachable, + e => assertTrue(e instanceof TypeError)); + +assertPromiseResult( + (() => { + %SetWasmCompileFromPromiseOverload(); + return WebAssembly.compileStreaming(wrapper); + })(), + module => { + assertTrue(module instanceof WebAssembly.Module); + %ResetWasmOverloads(); + }, + assertUnreachable); + +assertPromiseResult( + (() => { + %SetWasmCompileFromPromiseOverload(); + return WebAssembly.instantiateStreaming(wrapper); + })(), + pair => { + assertTrue(pair.instance instanceof WebAssembly.Instance); + assertTrue(pair.module instanceof WebAssembly.Module); + %ResetWasmOverloads(); + }, + assertUnreachable); |