v8/test
Leszek Swirski 7412593920 [ignition] More accurate dead statement elision
The Ignition statement list visitor will skip the rest of the
statements in the list if it hits a jump statement (like a return
or break), as the rest of the code in the list can be considered
dead.

    return;
    dead_call(); // skipped

However, since this is at an AST node level, it does not take into
account condition shortcutting:

    if(2.2) return;
    dead_call(); // not skipped

There is also a second dead code elimination in Ignition compilation, at
the bytecode array writer level, where a bytecodes are not emitted if an
"exit" bytecode (Return, Jump, or a few others) has been written, until
the next basic block starts (i.e. a Bind).

This can cause an issue with statements that resurrect the bytecode
array writer part-way through their visit. An example is try-catch
statements, which save the context to a register, and then Bind to start
the try region.

For the case:

    if (2.2) return;
    try {     // try statement not skipped
        ...
    }

the bytecode writer is called with

    OutputReturn()             // exit bytecode seen
    OutputMove(<context>, r1)  // not emitted
    Bind(&try_begin)           // starts new basic block
    // try body

So, the try is emitted, but without saving the context to a register.
This means that the liveness analysis sees the read of that register
(as the output liveness of throwing bytecodes), but does not have a
write to the register, which means that the liveness escapes.

This patch fixes this by using the bytecode array writer dead-code
elimination (i.e. "exit bytecode seen") to inform the statement list
visitor, so that in this example the try statement is not visited at
all.

Bug: chromium:902395
Change-Id: Ieb8e46a4318df3edbac0ae17235e0ce8fba12ee3
Reviewed-on: https://chromium-review.googlesource.com/c/1322951
Reviewed-by: Mythri Alle <mythria@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57350}
2018-11-08 10:48:09 +00:00
..
benchmarks [test] Share resource-fetching logic with all d8 test cases 2018-08-29 17:51:43 +00:00
cctest [interpreter] Store CreateObjectLiteral's result into the accumulator. 2018-11-08 10:31:45 +00:00
common [wasm] Rename GrowMemory to MemoryGrow 2018-10-29 14:06:24 +00:00
debugger [test] Skip slow tests on arm simulators 2018-10-17 08:52:47 +00:00
fuzzer [wasm] Rename GrowMemory to MemoryGrow 2018-10-29 14:06:24 +00:00
inspector Skip inspector/runtime/console-messages-limits on arm debug simulators 2018-11-07 20:00:39 +00:00
intl [intl] Don't run exhaustive regression tests on tsan variants 2018-11-07 23:44:24 +00:00
js-perf-test [Intl] Add benchmark for toLocaleString/localeCompare 2018-11-07 18:08:16 +00:00
memory [snapshot] Remove the builtins snapshot 2018-10-31 10:18:28 +00:00
message [js weak refs] Implement spec change: cleanup must be callable 2018-11-08 09:24:57 +00:00
mjsunit [ignition] More accurate dead statement elision 2018-11-08 10:48:09 +00:00
mkgrokdump [cleanup] Cleanup IMMORTAL_IMMOVABLE_ROOT_LIST 2018-10-09 09:05:37 +00:00
mozilla [test] Add more test suites to Android testing 2018-09-07 09:53:15 +00:00
preparser [test] Share resource-fetching logic with all d8 test cases 2018-08-29 17:51:43 +00:00
test262 Roll Test262 2018-11-05 19:54:04 +00:00
torque [torque] allow qualified access to different modules/namespaces 2018-11-05 13:34:03 +00:00
unittests [interpreter] Store CreateObjectLiteral's result into the accumulator. 2018-11-08 10:31:45 +00:00
wasm-js Reland "[wasm] Add a new wasm-js testsuite to run js-api tests" 2018-10-18 20:18:55 +00:00
wasm-spec-tests [wasm] Update wasm spec tests 2018-10-23 08:57:08 +00:00
webkit [tests] Skip webkit/dfg-inline-function-dot-caller on debug simulators 2018-11-07 01:37:25 +00:00
BUILD.gn Reland "[wasm] Add a new wasm-js testsuite to run js-api tests" 2018-10-18 20:18:55 +00:00