• clemensh's avatar
    [wasm] Refactor call site patching · cfc2e5e1
    clemensh authored
    For debugging, we are patching call sites to not call other
    WASM_FUNCTIONs, but call WASM_TO_INTERPRETER stubs instead. When later
    re-instantiating / cloning this code, the old logic for patching call
    sites would miss those calls.
    This CL changes the way we patch callsites by getting the called
    function index per callsite from the bytecode. This requires iterating
    both the source position table and the relocation table at the same
    time to determine the byte position for each call.
    Instead of looking up the functions to be replaced in a std::map, we now
    get the function directly from a FixedArray. This reduces the complexity
    from O(n*n*log(n)) to O(m), where n is the total number of functions and
    m is the total byte code length (note that each function is patched
    individually, so we set up the map n times before).
    Constant factor are unclear though.
    
    BUG=v8:5822
    R=titzer@chromium.org
    
    Review-Url: https://codereview.chromium.org/2627613002
    Cr-Commit-Position: refs/heads/master@{#42259}
    cfc2e5e1
Name
Last commit
Last update
..
OWNERS Loading commit data...
decoder.h Loading commit data...
function-body-decoder.cc Loading commit data...
function-body-decoder.h Loading commit data...
leb-helper.h Loading commit data...
managed.h Loading commit data...
module-decoder.cc Loading commit data...
module-decoder.h Loading commit data...
signature-map.cc Loading commit data...
signature-map.h Loading commit data...
wasm-debug.cc Loading commit data...
wasm-external-refs.cc Loading commit data...
wasm-external-refs.h Loading commit data...
wasm-interpreter.cc Loading commit data...
wasm-interpreter.h Loading commit data...
wasm-js.cc Loading commit data...
wasm-js.h Loading commit data...
wasm-limits.h Loading commit data...
wasm-macro-gen.h Loading commit data...
wasm-module-builder.cc Loading commit data...
wasm-module-builder.h Loading commit data...
wasm-module.cc Loading commit data...
wasm-module.h Loading commit data...
wasm-objects.cc Loading commit data...
wasm-objects.h Loading commit data...
wasm-opcodes.cc Loading commit data...
wasm-opcodes.h Loading commit data...
wasm-result.cc Loading commit data...
wasm-result.h Loading commit data...
wasm-text.cc Loading commit data...
wasm-text.h Loading commit data...