• Clemens Hammacher's avatar
    [wasm] Fix detection of unreachable code · 912cd314
    Clemens Hammacher authored
    The current Control::unreachable flag served two things at the same
    time: It tracked whether the label of that block is reachable (anyone
    jumps / falls through to there), and it tracked whether that block was
    ended by an unconditional branch or something similar.
    
    It turns out that these two things cannot be tracked with a single
    boolean per control struct. This CL introduces a Merge::reached flag,
    which tracks whether a merge point was reached so far.
    Also, the boolean flag to track unreachability of instructions within a
    block is extended to track implicitly unreachable instructions.
    According to the spec, a new block inside of unreachable code must be
    validated as reachable code again, and also code after a block which
    never returns has to be validated. It's not needed to generate code for
    such instructions, however.
    This new state will be particularly needed for the baseline compiler.
    
    A follow-up CL will avoid calling interface methods for unreachable
    code.
    
    R=titzer@chromium.org
    
    Bug: v8:6600
    Change-Id: I54c97a19121eace65e25c448639330d06f61b1c8
    Reviewed-on: https://chromium-review.googlesource.com/715637
    Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
    Reviewed-by: 's avatarAndreas Rossberg <rossberg@chromium.org>
    Reviewed-by: 's avatarBen Titzer <titzer@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#48509}
    912cd314
Name
Last commit
Last update
..
OWNERS Loading commit data...
compilation-manager.cc Loading commit data...
compilation-manager.h Loading commit data...
decoder.h Loading commit data...
function-body-decoder-impl.h Loading commit data...
function-body-decoder.cc Loading commit data...
function-body-decoder.h Loading commit data...
leb-helper.h Loading commit data...
local-decl-encoder.cc Loading commit data...
local-decl-encoder.h Loading commit data...
memory-tracing.cc Loading commit data...
memory-tracing.h Loading commit data...
module-compiler.cc Loading commit data...
module-compiler.h Loading commit data...
module-decoder.cc Loading commit data...
module-decoder.h Loading commit data...
signature-map.cc Loading commit data...
signature-map.h Loading commit data...
streaming-decoder.cc Loading commit data...
streaming-decoder.h Loading commit data...
wasm-api.cc Loading commit data...
wasm-api.h Loading commit data...
wasm-code-specialization.cc Loading commit data...
wasm-code-specialization.h Loading commit data...
wasm-debug.cc Loading commit data...
wasm-external-refs.cc Loading commit data...
wasm-external-refs.h Loading commit data...
wasm-heap.cc Loading commit data...
wasm-heap.h Loading commit data...
wasm-interpreter.cc Loading commit data...
wasm-interpreter.h Loading commit data...
wasm-js.cc Loading commit data...
wasm-js.h Loading commit data...
wasm-limits.h Loading commit data...
wasm-memory.cc Loading commit data...
wasm-memory.h Loading commit data...
wasm-module-builder.cc Loading commit data...
wasm-module-builder.h Loading commit data...
wasm-module.cc Loading commit data...
wasm-module.h Loading commit data...
wasm-objects-inl.h Loading commit data...
wasm-objects.cc Loading commit data...
wasm-objects.h Loading commit data...
wasm-opcodes.cc Loading commit data...
wasm-opcodes.h Loading commit data...
wasm-result.cc Loading commit data...
wasm-result.h Loading commit data...
wasm-text.cc Loading commit data...
wasm-text.h Loading commit data...
wasm-value.h Loading commit data...