• Andreas Haas's avatar
    [wasm] Run foreground compilation tasks as normal tasks · 1520a851
    Andreas Haas authored
    This CL makes foreground compilation tasks normal (i.e. not cancelable)
    again, because otherwise a deadlock can happen. I think the reason why
    the foreground tasks were cancelable was to make sure that all tasks
    either finish correctly or get canceled. However, since the isolate can
    only shut down on the main thread, this means that the foreground task
    should have already finished when the isolate shuts down, or it should
    not have started at all. I reordered the deletion of the AsyncCompileJob
    though to make sure that an AsyncCompileJob is removed from
    CompilationManager before its promise is resolved.
    
    Here is the deadlock: The JS code which is executed after a promise is
    resolved is executed within the task which resolves the promise. In case
    of async compilation this means that some JS code is executed within a
    CompileTask. In JS, the shutdown of the isolate can be triggered. During
    the shutdown of the isolate, the CancelableTaskManager waits for all
    registered cancelable tasks to complete, including the CompileTask of
    async compilation. This means that the CancelableTaskManager waits for
    itself to finish, which is a deadlock.
    
    R=clemensh@chromium.org, mtrofin@chromium.org
    
    Change-Id: I9f8c7fb2cfc5b9bfc53c761010b1590293bb82c9
    Reviewed-on: https://chromium-review.googlesource.com/554733
    Commit-Queue: Andreas Haas <ahaas@chromium.org>
    Reviewed-by: 's avatarMircea Trofin <mtrofin@chromium.org>
    Reviewed-by: 's avatarClemens Hammacher <clemensh@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#46343}
    1520a851
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...
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-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-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-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.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...