• 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
benchmarks Loading commit data...
build_overrides Loading commit data...
docs Loading commit data...
gni Loading commit data...
gypfiles Loading commit data...
include Loading commit data...
infra Loading commit data...
samples Loading commit data...
src Loading commit data...
test Loading commit data...
testing Loading commit data...
third_party Loading commit data...
tools Loading commit data...
.clang-format Loading commit data...
.gitignore Loading commit data...
.gn Loading commit data...
.ycm_extra_conf.py Loading commit data...
AUTHORS Loading commit data...
BUILD.gn Loading commit data...
CODE_OF_CONDUCT.md Loading commit data...
ChangeLog Loading commit data...
DEPS Loading commit data...
LICENSE Loading commit data...
LICENSE.fdlibm Loading commit data...
LICENSE.strongtalk Loading commit data...
LICENSE.v8 Loading commit data...
LICENSE.valgrind Loading commit data...
Makefile Loading commit data...
Makefile.android Loading commit data...
OWNERS Loading commit data...
PRESUBMIT.py Loading commit data...
README.md Loading commit data...
WATCHLISTS Loading commit data...
codereview.settings Loading commit data...
snapshot_toolchain.gni Loading commit data...