• Clemens Hammacher's avatar
    [wasm] Keep NativeModule alive in BackgroundCompileScope · 3df442d7
    Clemens Hammacher authored
    We need to ensure that the NativeModule stays alive while any
    {BackgroundCompileScope} exists, because during that time we hold
    shared ownership of the mutex in the {BackgroundCompileToken}. If the
    {NativeModule} dies during that period, we would need to get exclusive
    ownership of the mutex and deadlock.
    
    This change requires holding a {std::weak_ptr<NativeModule>} in the
    BackgroundCompileToken instead of a raw pointer, hence it can only be
    initialized after the NativeModule was created. This is done via a
    separate {InitCompilationState} method.
    
    R=ahaas@chromium.org
    
    Bug: v8:8979
    Change-Id: Ia14bd272ea0bc47aec547024da6020608418c9d2
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1518178
    Auto-Submit: Clemens Hammacher <clemensh@chromium.org>
    Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
    Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#60203}
    3df442d7
Name
Last commit
Last update
..
OWNERS Loading commit data...
test-c-wasm-entry.cc Loading commit data...
test-jump-table-assembler.cc Loading commit data...
test-run-wasm-64.cc Loading commit data...
test-run-wasm-asmjs.cc Loading commit data...
test-run-wasm-atomics.cc Loading commit data...
test-run-wasm-atomics64.cc Loading commit data...
test-run-wasm-exceptions.cc Loading commit data...
test-run-wasm-interpreter.cc Loading commit data...
test-run-wasm-js.cc Loading commit data...
test-run-wasm-module.cc Loading commit data...
test-run-wasm-sign-extension.cc Loading commit data...
test-run-wasm-simd.cc Loading commit data...
test-run-wasm.cc Loading commit data...
test-streaming-compilation.cc Loading commit data...
test-wasm-breakpoints.cc Loading commit data...
test-wasm-codegen.cc Loading commit data...
test-wasm-import-wrapper-cache.cc Loading commit data...
test-wasm-interpreter-entry.cc Loading commit data...
test-wasm-serialization.cc Loading commit data...
test-wasm-shared-engine.cc Loading commit data...
test-wasm-stack.cc Loading commit data...
test-wasm-trap-position.cc Loading commit data...
wasm-atomics-utils.h Loading commit data...
wasm-run-utils.cc Loading commit data...
wasm-run-utils.h Loading commit data...