v8/test/message
Hai Dang 5f8a42727d Reland "[interpreter] Add bytecode for leading array spreads."
This is a reland of 1c48d52bb1.

It turned out that IterableToList doesn't always behave according to
the ES operation with the same name. Specifically, it allows holey arrays
to take its fast path, which produces an output array with holes where
actually "undefined" elements should appear.

This CL changes the version of IterableToList that is used for spreads
(IterableToListWithSymbolLookup) such that holey arrays take the slow path.
It also includes tests for such situations.

Original change's description:
> [interpreter] Add bytecode for leading array spreads.
>
> This CL improves the performance of creating [...a, b] or [...a].
> If the array literal has a leading spread, this CL emits the bytecode
> [CreateArrayFromIterable] to create the literal. CreateArrayFromIterable
> is implemented by [IterableToListDefault] builtin to create the initial
> array for the leading spread. IterableToListDefault has a fast path to
> clone efficiently if the spread is an actual array.
>
> The bytecode generated is now shorter. Bytecode generation is refactored
> into to BuildCreateArrayLiteral, which allows VisitCallSuper to benefit
> from this optimization also.
> For now, turbofan also lowers the bytecode to the builtin.
>
> The idiomatic use of [...a] to clone the array a now performs better
> than a simple for-loop, but still does not match the performance of slice.
>
> Bug: v8:7980
>
> Cq-Include-Trybots: luci.v8.try:v8_linux_noi18n_rel_ng
> Change-Id: Ibde659c82d3c7aa1b1777a3d2f6426ac8cc15e35
> Reviewed-on: https://chromium-review.googlesource.com/1181024
> Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
> Reviewed-by: Sigurd Schneider <sigurds@chromium.org>
> Reviewed-by: Jakob Gruber <jgruber@chromium.org>
> Reviewed-by: Georg Neis <neis@chromium.org>
> Commit-Queue: Georg Neis <neis@chromium.org>
> Commit-Queue: Hai Dang <dhai@google.com>
> Cr-Commit-Position: refs/heads/master@{#55520}

Bug: v8:7980
Change-Id: I0b5603a12d2b588327658bf0a9b214bd0f22e237
Cq-Include-Trybots: luci.v8.try:v8_linux_noi18n_rel_ng
Reviewed-on: https://chromium-review.googlesource.com/1201882
Commit-Queue: Hai Dang <dhai@google.com>
Reviewed-by: Georg Neis <neis@chromium.org>
Reviewed-by: Ross McIlroy <rmcilroy@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#55639}
2018-09-05 09:29:51 +00:00
..
fail Reland "[interpreter] Add bytecode for leading array spreads." 2018-09-05 09:29:51 +00:00
mjsunit [mjsunit] Cleanup assertPromiseResult and add tests 2018-04-30 11:56:54 +00:00
regress/fail [builtins] Fix error message in Proxy set trap 2018-05-14 16:37:20 +00:00
asm-assignment-undeclared.js [asm.js] Remove deprecated --fast-validate-asm flag. 2017-05-04 13:52:39 +00:00
asm-assignment-undeclared.out [asm.js] Fix assignment with undeclared target. 2017-03-30 08:36:17 +00:00
asm-function-mismatch-def.js [asm.js] Remove deprecated --fast-validate-asm flag. 2017-05-04 13:52:39 +00:00
asm-function-mismatch-def.out [asm.js] Test and fix function type checking. 2017-04-07 12:10:45 +00:00
asm-function-mismatch-use.js [asm.js] Remove deprecated --fast-validate-asm flag. 2017-05-04 13:52:39 +00:00
asm-function-mismatch-use.out [asm.js] Test and fix function type checking. 2017-04-07 12:10:45 +00:00
asm-function-redefined.js [asm.js] Remove deprecated --fast-validate-asm flag. 2017-05-04 13:52:39 +00:00
asm-function-redefined.out [asm.js] Test and fix function name collisions. 2017-04-07 09:03:11 +00:00
asm-function-undefined.js [asm.js] Remove deprecated --fast-validate-asm flag. 2017-05-04 13:52:39 +00:00
asm-function-undefined.out [asm.js] Test and fix function table definition failures. 2017-04-11 16:46:26 +00:00
asm-function-variable-collision.js [asm.js] Remove deprecated --fast-validate-asm flag. 2017-05-04 13:52:39 +00:00
asm-function-variable-collision.out [asm.js] Test and fix function name collisions. 2017-04-07 09:03:11 +00:00
asm-import-wrong-annotation.js [asm.js] Fix validation failure in module variable import. 2017-05-05 11:39:06 +00:00
asm-import-wrong-annotation.out [asm.js] Fix validation failure in module variable import. 2017-05-05 11:39:06 +00:00
asm-import-wrong-object.js [asm.js] Fix validation failure in module variable import. 2017-05-05 11:39:06 +00:00
asm-import-wrong-object.out [asm.js] Fix validation failure in module variable import. 2017-05-05 11:39:06 +00:00
asm-linking-bogus-heap.js [asm.js] Report module linking failures to the console. 2017-05-19 11:31:12 +00:00
asm-linking-bogus-heap.out Reland "[asmjs] Properly validate asm.js heap sizes" 2018-08-21 09:00:04 +00:00
asm-linking-bogus-stdlib.js [asm.js] Report module linking failures to the console. 2017-05-19 11:31:12 +00:00
asm-linking-bogus-stdlib.out [asm.js] Report module linking failures to the console. 2017-05-19 11:31:12 +00:00
asm-linking-missing-heap.js [asm.js] Report module linking failures to the console. 2017-05-19 11:31:12 +00:00
asm-linking-missing-heap.out [asm.js] Report module linking failures to the console. 2017-05-19 11:31:12 +00:00
asm-missing-parameter-annotation.js [asm.js] Remove deprecated --fast-validate-asm flag. 2017-05-04 13:52:39 +00:00
asm-missing-parameter-annotation.out [asm.js] Make validation error messages consistent. 2017-03-29 20:55:12 +00:00
asm-missing-return-annotation.js [asm.js] Remove deprecated --fast-validate-asm flag. 2017-05-04 13:52:39 +00:00
asm-missing-return-annotation.out [asm.js] Make validation error messages consistent. 2017-03-29 20:55:12 +00:00
asm-table-mismatch-def.js [asm.js] Remove deprecated --fast-validate-asm flag. 2017-05-04 13:52:39 +00:00
asm-table-mismatch-def.out [asm.js] Test and fix function table type checks. 2017-04-10 08:47:34 +00:00
asm-table-mismatch-use.js [asm.js] Remove deprecated --fast-validate-asm flag. 2017-05-04 13:52:39 +00:00
asm-table-mismatch-use.out [asm.js] Test and fix function table type checks. 2017-04-10 08:47:34 +00:00
asm-table-redefined.js [asm.js] Remove deprecated --fast-validate-asm flag. 2017-05-04 13:52:39 +00:00
asm-table-redefined.out [asm.js] Test and fix function table definition failures. 2017-04-11 16:46:26 +00:00
asm-table-undefined.js [asm.js] Remove deprecated --fast-validate-asm flag. 2017-05-04 13:52:39 +00:00
asm-table-undefined.out [asm.js] Test and fix function table definition failures. 2017-04-11 16:46:26 +00:00
asm-table-variable-collision.js [asm.js] Remove deprecated --fast-validate-asm flag. 2017-05-04 13:52:39 +00:00
asm-table-variable-collision.out [asm.js] Test and fix function table definition failures. 2017-04-11 16:46:26 +00:00
BUILD.gn [build] Add data deps for d8 test suites 2018-03-26 13:44:58 +00:00
message.status [wasm] Distinguish Liftoff code from Turbofan code 2018-01-17 13:59:08 +00:00
non-use-strict-hex-escape.js
non-use-strict-hex-escape.out
non-use-strict-octal-escape.js
non-use-strict-octal-escape.out
non-use-strict-uhex-escape.js
non-use-strict-uhex-escape.out
nonstrict-arguments.js
nonstrict-arguments.out
nonstrict-eval.js
nonstrict-eval.out
nonstrict-with.js
nonstrict-with.out
object-binding-pattern-await-computed-name.js [parser] classify binding pattern errors when parsing await expression 2017-12-09 16:29:23 +00:00
object-binding-pattern-await-computed-name.out [parser] classify binding pattern errors when parsing await expression 2017-12-09 16:29:23 +00:00
README.md [testing] Rename documentation file. 2017-03-31 08:05:15 +00:00
strict-octal-indirect-regexp.js
strict-octal-indirect-regexp.out
strict-octal-regexp.js
strict-octal-regexp.out
testcfg.py [test] Share resource-fetching logic with all d8 test cases 2018-08-29 17:51:43 +00:00
try-catch-finally-no-message.js
try-catch-finally-no-message.out
try-catch-finally-return-in-finally.js
try-catch-finally-return-in-finally.out
try-finally-return-in-finally.js
try-finally-return-in-finally.out
wasm-finish-compilation.js Reland "Reland "[d8][wasm] Test wasm compilation completion"" 2018-04-10 08:24:27 +00:00
wasm-finish-compilation.out Reland "Reland "[d8][wasm] Test wasm compilation completion"" 2018-04-10 08:24:27 +00:00
wasm-function-name-async.js [wasm] Load module name during streaming compile 2018-03-16 09:01:20 +00:00
wasm-function-name-async.out [cleanup] Don't bake mjsunit.js line numbers into message tests. 2018-04-27 10:38:03 +00:00
wasm-function-name-streaming.js [wasm] Load module name during streaming compile 2018-03-16 09:01:20 +00:00
wasm-function-name-streaming.out [cleanup] Don't bake mjsunit.js line numbers into message tests. 2018-04-27 10:38:03 +00:00
wasm-module-and-function-name-async.js [wasm] Load module name during streaming compile 2018-03-16 09:01:20 +00:00
wasm-module-and-function-name-async.out [cleanup] Don't bake mjsunit.js line numbers into message tests. 2018-04-27 10:38:03 +00:00
wasm-module-and-function-name-streaming.js [wasm] Load module name during streaming compile 2018-03-16 09:01:20 +00:00
wasm-module-and-function-name-streaming.out [cleanup] Don't bake mjsunit.js line numbers into message tests. 2018-04-27 10:38:03 +00:00
wasm-module-name-async.js [wasm] Load module name during streaming compile 2018-03-16 09:01:20 +00:00
wasm-module-name-async.out [cleanup] Don't bake mjsunit.js line numbers into message tests. 2018-04-27 10:38:03 +00:00
wasm-module-name-streaming.js [wasm] Load module name during streaming compile 2018-03-16 09:01:20 +00:00
wasm-module-name-streaming.out [cleanup] Don't bake mjsunit.js line numbers into message tests. 2018-04-27 10:38:03 +00:00
wasm-no-name-async.js [wasm] Load module name during streaming compile 2018-03-16 09:01:20 +00:00
wasm-no-name-async.out [cleanup] Don't bake mjsunit.js line numbers into message tests. 2018-04-27 10:38:03 +00:00
wasm-no-name-streaming.js [wasm] Load module name during streaming compile 2018-03-16 09:01:20 +00:00
wasm-no-name-streaming.out [cleanup] Don't bake mjsunit.js line numbers into message tests. 2018-04-27 10:38:03 +00:00
wasm-trace-memory-interpreted.js [flags] s/wasm_trace/trace_wasm/g in flags 2018-08-29 08:49:09 +00:00
wasm-trace-memory-interpreted.out [wasm] Make the output of --wasm-trace-memory more understandable 2018-07-19 09:49:36 +00:00
wasm-trace-memory-liftoff.js [flags] s/wasm_trace/trace_wasm/g in flags 2018-08-29 08:49:09 +00:00
wasm-trace-memory-liftoff.out [wasm] Make the output of --wasm-trace-memory more understandable 2018-07-19 09:49:36 +00:00
wasm-trace-memory.js [flags] s/wasm_trace/trace_wasm/g in flags 2018-08-29 08:49:09 +00:00
wasm-trace-memory.out [wasm] Make the output of --wasm-trace-memory more understandable 2018-07-19 09:49:36 +00:00

JavaScript tests with expected output

Tests in test/message pass if the output matches the expected output. Message tests are particularly useful when checking for exact error messages.

Tests and their expected output must have the same filename, with the .js and .out extension.

foo.js
foo.out

All tests must end with an exception. The test runner does not handle output from multiple runs, e.g., --stress-opt. Without an exception, the output will be generated several times and the comparison will fail.

You can use a regex in the expected output. Instead of the exact path. use

*%(basename)s:7: SyntaxError: Detected cycle while resolving name 'a'

Empty lines are ignored in the comparison, but whitespaces are not.

Exact details of the test runner are in testcfg.py.