• Andreas Haas's avatar
    [wasm][interpreter] Fix memory leak with the reference stack · 9cf9e82a
    Andreas Haas authored
    This CL fixes a memory leak in the interpreter. The leak was caused by
    a cycle the object graph that was rooted with a global object. The
    cycle was the following:
    
    A global handle, owned by the interpreter -> reference stack of the
    Interpreter -> ref.func element (WasmExportedFunction) ->
    WasmInstanceObject -> WasmDebugInfo -> InterpreterHandle -> Interpreter
    
    With this CL we get rid of the global handle. Instead we store the stack
    in the WasmDebugInfo. We then have to load the reference stack every time
    we enter the Interpreter and want access the reference stack.
    
    R=mstarzinger@chromium.org
    
    Bug: chromium:1000610
    Change-Id: If8995725f7ec35862b2f99a07582c861027daaf1
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1800582
    Commit-Queue: Andreas Haas <ahaas@chromium.org>
    Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#63953}
    9cf9e82a
wasm-objects-inl.h 17.9 KB