v8/test/cctest/interpreter
Leszek Swirski 1fba044154 [destructuring] Elide coercible check for simple keys
Simple object destructuring, such as `let {a,b} = o`, is less efficient
than the equivalent assignments `let a = o.a; let b = o.b`. This is
because it does a nil check of `o` before the assignments. However, this
nil check is not strictly necessary for simple (i.e. non-computed) names,
as there will be an equivalent nil check on the first access to o in
`o.a`. For computed names the computation is unfortunately obervable.

So, we can elide the nil check when the first property (if any) of the
destructuring target is a non-computed name. This messes a bit with our
error messages, so we re-use the CallPrinter to also find destructuring
assignment based errors, and fiddle with the error message there. As
a side-effect, we also get out the object name in the AST, so we can
output a slightly nicer error message.

Change-Id: Iafa858e27ed771a146cd3ba57903cc73bb46951d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1773254
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Reviewed-by: Toon Verwaest <verwaest@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#63453}
2019-08-29 14:42:48 +00:00
..
bytecode_expectations [destructuring] Elide coercible check for simple keys 2019-08-29 14:42:48 +00:00
bytecode-expectations-printer.cc [modules] Introduce SourceTextModule class 2019-06-19 17:54:52 +00:00
bytecode-expectations-printer.h Enable cpplint 'runtime/references' warning 2019-07-08 09:59:36 +00:00
generate-bytecode-expectations.cc [test] Fix return of int from bool function 2019-07-19 17:07:11 +00:00
interpreter-tester.cc Move more relevant files to src/objects 2019-05-23 08:52:30 +00:00
interpreter-tester.h Move remaining files in src/ 2019-05-24 18:24:36 +00:00
source-position-matcher.cc Move more relevant files to src/objects 2019-05-23 08:52:30 +00:00
source-position-matcher.h Move remaining files in src/ 2019-05-24 18:24:36 +00:00
test-bytecode-generator.cc [class] implement private accessor declarations 2019-08-20 15:32:34 +00:00
test-interpreter-intrinsics.cc Move remaining files in src/ 2019-05-24 18:24:36 +00:00
test-interpreter.cc [tests] Disable stress mode in source collection tests 2019-07-19 15:16:16 +00:00
test-source-positions.cc Move remaining files in src/ 2019-05-24 18:24:36 +00:00