• mtrofin's avatar
    [wasm] reuse the first compiled module. · b4dc310a
    mtrofin authored
    This change avoids needing to keep around an unused compiled
    module. Instead, the result of compiling the wasm bytes is
    given to the first instance. The module object and that instance object
    point to the same compiled module. Instances are, then, cloned from
    the compiled module the module object points to. When an instance is
    collected, we make sure that the module object still has a clone
    available, and, if the last instance is GC-ed, we also reset the compiled
    module so that it does not reference its heap, so that it (==heap) may
    be collected.
    
    This is achieved by linking the clones in a double-linked list and
    registering a finalizer for each. When we create an instance, we tie it
    in the front of the list, making the module object point to it (O(1)). When
    the finalizer is called, we relink the list over the dying object (O(1)). The
    costliest operation is finalizing the last instance, since we need to visit
    all wasm functions and reset heap references.
    
    BUG=v8:5316
    
    Committed: https://crrev.com/01f5af515728aebe6c5246f4f7dd6c573e8748af
    Review-Url: https://codereview.chromium.org/2305903002
    Cr-Original-Commit-Position: refs/heads/master@{#39153}
    Cr-Commit-Position: refs/heads/master@{#39361}
    b4dc310a
Name
Last commit
Last update
..
runtime-array.cc Loading commit data...
runtime-atomics.cc Loading commit data...
runtime-classes.cc Loading commit data...
runtime-collections.cc Loading commit data...
runtime-compiler.cc Loading commit data...
runtime-date.cc Loading commit data...
runtime-debug.cc Loading commit data...
runtime-error.cc Loading commit data...
runtime-forin.cc Loading commit data...
runtime-function.cc Loading commit data...
runtime-futex.cc Loading commit data...
runtime-generator.cc Loading commit data...
runtime-i18n.cc Loading commit data...
runtime-internal.cc Loading commit data...
runtime-interpreter.cc Loading commit data...
runtime-literals.cc Loading commit data...
runtime-liveedit.cc Loading commit data...
runtime-maths.cc Loading commit data...
runtime-numbers.cc Loading commit data...
runtime-object.cc Loading commit data...
runtime-operators.cc Loading commit data...
runtime-proxy.cc Loading commit data...
runtime-regexp.cc Loading commit data...
runtime-scopes.cc Loading commit data...
runtime-simd.cc Loading commit data...
runtime-strings.cc Loading commit data...
runtime-symbol.cc Loading commit data...
runtime-test.cc Loading commit data...
runtime-typedarray.cc Loading commit data...
runtime-utils.h Loading commit data...
runtime-wasm.cc Loading commit data...
runtime.cc Loading commit data...
runtime.h Loading commit data...