• 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
benchmarks Loading commit data...
build_overrides Loading commit data...
docs Loading commit data...
gni Loading commit data...
gypfiles Loading commit data...
include Loading commit data...
infra Loading commit data...
samples Loading commit data...
src Loading commit data...
test Loading commit data...
testing Loading commit data...
third_party Loading commit data...
tools Loading commit data...
.clang-format Loading commit data...
.gitignore Loading commit data...
.gn Loading commit data...
.ycm_extra_conf.py Loading commit data...
AUTHORS Loading commit data...
BUILD.gn Loading commit data...
CODE_OF_CONDUCT.md Loading commit data...
ChangeLog Loading commit data...
DEPS Loading commit data...
LICENSE Loading commit data...
LICENSE.fdlibm Loading commit data...
LICENSE.strongtalk Loading commit data...
LICENSE.v8 Loading commit data...
LICENSE.valgrind Loading commit data...
Makefile Loading commit data...
Makefile.android Loading commit data...
OWNERS Loading commit data...
PRESUBMIT.py Loading commit data...
README.md Loading commit data...
WATCHLISTS Loading commit data...
codereview.settings Loading commit data...
snapshot_toolchain.gni Loading commit data...