Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(567)

Issue 2627613002: [wasm] Refactor call site patching (Closed)

Created:
3 years, 11 months ago by Clemens Hammacher
Modified:
3 years, 11 months ago
Reviewers:
titzer
CC:
v8-reviews_googlegroups.com
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

[wasm] Refactor call site patching 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} Committed: https://chromium.googlesource.com/v8/v8/+/cfc2e5e180f416e24fcbf532f32ded47d38a49ff

Patch Set 1 #

Patch Set 2 : Fix minor bug on arm64 #

Total comments: 2

Patch Set 3 : Use Decoder instead of LEBHelper #

Patch Set 4 : Only instantiate Decoder once #

Total comments: 2

Patch Set 5 : Add comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+90 lines, -26 lines) Patch
M src/wasm/wasm-module.cc View 1 2 3 4 2 chunks +90 lines, -26 lines 0 comments Download

Depends on Patchset:

Messages

Total messages: 33 (25 generated)
Clemens Hammacher
3 years, 11 months ago (2017-01-10 14:56:35 UTC) #10
titzer
https://codereview.chromium.org/2627613002/diff/20001/src/wasm/wasm-module.cc File src/wasm/wasm-module.cc (right): https://codereview.chromium.org/2627613002/diff/20001/src/wasm/wasm-module.cc#newcode449 src/wasm/wasm-module.cc:449: int ExtractDirectCallIndex(const byte* pc) { Can you use a ...
3 years, 11 months ago (2017-01-11 18:02:48 UTC) #11
titzer
3 years, 11 months ago (2017-01-11 18:02:49 UTC) #12
Clemens Hammacher
https://codereview.chromium.org/2627613002/diff/20001/src/wasm/wasm-module.cc File src/wasm/wasm-module.cc (right): https://codereview.chromium.org/2627613002/diff/20001/src/wasm/wasm-module.cc#newcode449 src/wasm/wasm-module.cc:449: int ExtractDirectCallIndex(const byte* pc) { On 2017/01/11 at 18:02:48, ...
3 years, 11 months ago (2017-01-11 18:28:43 UTC) #19
titzer
lgtm if we add some more comments https://codereview.chromium.org/2627613002/diff/60001/src/wasm/wasm-module.cc File src/wasm/wasm-module.cc (right): https://codereview.chromium.org/2627613002/diff/60001/src/wasm/wasm-module.cc#newcode474 src/wasm/wasm-module.cc:474: for (int ...
3 years, 11 months ago (2017-01-11 18:34:04 UTC) #20
Clemens Hammacher
https://codereview.chromium.org/2627613002/diff/60001/src/wasm/wasm-module.cc File src/wasm/wasm-module.cc (right): https://codereview.chromium.org/2627613002/diff/60001/src/wasm/wasm-module.cc#newcode474 src/wasm/wasm-module.cc:474: for (int i = start; i < num_wasm_functions; ++i) ...
3 years, 11 months ago (2017-01-12 09:03:12 UTC) #25
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2627613002/80001
3 years, 11 months ago (2017-01-12 09:38:22 UTC) #30
commit-bot: I haz the power
3 years, 11 months ago (2017-01-12 09:40:23 UTC) #33
Message was sent while issue was closed.
Committed patchset #5 (id:80001) as
https://chromium.googlesource.com/v8/v8/+/cfc2e5e180f416e24fcbf532f32ded47d38...

Powered by Google App Engine
This is Rietveld 408576698