• Clemens Hammacher's avatar
    [heap] Run phantom handle callbacks on tear down · fa65063a
    Clemens Hammacher authored
    Pending phantom handle callbacks are not reliably executed if the heap
    shuts down. This can cause to memory leaks or other unwanted behaviour,
    like in wasm where the NativeModules (held in Managed objects
    implemented via phantom handles) unregister from the WasmEngine in the
    second-pass callback. This must be executed before tearing down the
    WasmEngine.
    
    This CL fixes this by running pending callback synchronously on heap
    tear down.
    
    R=ulan@chromium.org, mlippautz@chromium.org
    
    Bug: v8:8208
    Change-Id: I27b630c4d8f1fb12309040ea2179b64eed38710a
    Reviewed-on: https://chromium-review.googlesource.com/1249101
    Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
    Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#56286}
    fa65063a
global-handles.cc 35.4 KB