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

Issue 1961973002: [wasm] Implement parallel compilation. (Closed)

Created:
4 years, 7 months ago by ahaas
Modified:
4 years, 7 months ago
CC:
Michael Hablich, v8-reviews_googlegroups.com
Base URL:
https://chromium.googlesource.com/v8/v8.git@master
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

[wasm] Implement parallel compilation. With this CL it is possible to compile a wasm module with multiple threads in parallel. Parallel compilation works as follows: 1) The main thread allocates a compilation unit for each wasm function. 2) The main thread spawns WasmCompilationTasks which run on the background threads. 3.a) The background threads and the main thread pick one compilation unit at a time and execute the parallel phase of the compilation unit. After finishing the execution of the parallel phase, the compilation unit is stored in a result queue. 3.b) If the result queue contains a compilation unit, the main thread dequeues it and finishes its compilation. 4) After the execution of the parallel phase of all compilation units has started, the main thread waits for all WasmCompilationTasks to finish. 5) The main thread finalizes the compilation of the module. I'm going to add some additional tests before committing this CL. R=titzer@chromium.org, bmeurer@chromium.org, mlippautz@chromium.org, mstarzinger@chromium.org Committed: https://crrev.com/17215438659d8ff2d7d55f95226bf8a1477ccd79 Cr-Commit-Position: refs/heads/master@{#36178} Committed: https://crrev.com/4aec7ba1aa34e6b45618e0672ed1c2a0026e5b04 Cr-Commit-Position: refs/heads/master@{#36207}

Patch Set 1 #

Patch Set 2 : Add tests. #

Total comments: 9

Patch Set 3 : #

Total comments: 16

Patch Set 4 : #

Patch Set 5 : #

Total comments: 4

Patch Set 6 : #

Patch Set 7 : Make the implementation thread-safe. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+479 lines, -151 lines) Patch
M src/compiler/wasm-compiler.h View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M src/compiler/wasm-compiler.cc View 1 2 3 4 5 6 15 chunks +46 lines, -28 lines 0 comments Download
M src/flag-definitions.h View 1 2 3 4 5 6 1 chunk +2 lines, -1 line 0 comments Download
M src/wasm/wasm-module.cc View 1 2 3 4 5 6 8 chunks +315 lines, -117 lines 0 comments Download
M src/wasm/wasm-opcodes.cc View 1 2 3 4 5 6 1 chunk +15 lines, -4 lines 0 comments Download
A test/mjsunit/wasm/parallel_compilation.js View 1 2 3 1 chunk +100 lines, -0 lines 0 comments Download

Messages

Total messages: 26 (6 generated)
ahaas
4 years, 7 months ago (2016-05-09 13:56:58 UTC) #1
ahaas
On 2016/05/09 at 13:56:58, ahaas wrote: > I added some tests now.
4 years, 7 months ago (2016-05-09 16:13:57 UTC) #2
Michael Lippautz
Only non-wasm specific comments on the parallelization effort. https://codereview.chromium.org/1961973002/diff/20001/src/wasm/wasm-module.cc File src/wasm/wasm-module.cc (right): https://codereview.chromium.org/1961973002/diff/20001/src/wasm/wasm-module.cc#newcode415 src/wasm/wasm-module.cc:415: static_cast<size_t>(base::NoBarrier_AtomicIncrement(next_unit, ...
4 years, 7 months ago (2016-05-10 07:36:41 UTC) #3
Michael Starzinger
I am only reviewing the changes to wasm-compiler.cc, please let me know if I should ...
4 years, 7 months ago (2016-05-10 09:06:47 UTC) #4
ahaas
https://codereview.chromium.org/1961973002/diff/20001/src/compiler/wasm-compiler.cc File src/compiler/wasm-compiler.cc (right): https://codereview.chromium.org/1961973002/diff/20001/src/compiler/wasm-compiler.cc#newcode1885 src/compiler/wasm-compiler.cc:1885: Handle<HeapObject>::cast(module_->GetFunctionCode(index)))); On 2016/05/10 at 09:06:46, Michael Starzinger wrote: > ...
4 years, 7 months ago (2016-05-10 09:45:49 UTC) #5
Michael Starzinger
LGTM on wasm-compiler. Didn't look at the rest at all. https://codereview.chromium.org/1961973002/diff/40001/src/compiler/wasm-compiler.cc File src/compiler/wasm-compiler.cc (right): https://codereview.chromium.org/1961973002/diff/40001/src/compiler/wasm-compiler.cc#newcode2946 ...
4 years, 7 months ago (2016-05-10 10:29:59 UTC) #6
Michael Lippautz
https://codereview.chromium.org/1961973002/diff/20001/src/wasm/wasm-module.cc File src/wasm/wasm-module.cc (right): https://codereview.chromium.org/1961973002/diff/20001/src/wasm/wasm-module.cc#newcode636 src/wasm/wasm-module.cc:636: bool done = false; On 2016/05/10 09:45:48, ahaas wrote: ...
4 years, 7 months ago (2016-05-10 10:35:51 UTC) #7
titzer
https://codereview.chromium.org/1961973002/diff/40001/src/compiler/wasm-compiler.cc File src/compiler/wasm-compiler.cc (right): https://codereview.chromium.org/1961973002/diff/40001/src/compiler/wasm-compiler.cc#newcode1884 src/compiler/wasm-compiler.cc:1884: args[0] = graph()->NewNode( Can you extract a helper function ...
4 years, 7 months ago (2016-05-10 12:32:11 UTC) #8
ahaas
https://codereview.chromium.org/1961973002/diff/40001/src/compiler/wasm-compiler.cc File src/compiler/wasm-compiler.cc (right): https://codereview.chromium.org/1961973002/diff/40001/src/compiler/wasm-compiler.cc#newcode1884 src/compiler/wasm-compiler.cc:1884: args[0] = graph()->NewNode( On 2016/05/10 at 12:32:10, titzer wrote: ...
4 years, 7 months ago (2016-05-11 09:52:22 UTC) #9
titzer
lgtm https://codereview.chromium.org/1961973002/diff/80001/src/wasm/wasm-module.cc File src/wasm/wasm-module.cc (right): https://codereview.chromium.org/1961973002/diff/80001/src/wasm/wasm-module.cc#newcode546 src/wasm/wasm-module.cc:546: for (size_t i = 0; i < num_tasks; ...
4 years, 7 months ago (2016-05-11 12:38:50 UTC) #10
ahaas
https://codereview.chromium.org/1961973002/diff/80001/src/wasm/wasm-module.cc File src/wasm/wasm-module.cc (right): https://codereview.chromium.org/1961973002/diff/80001/src/wasm/wasm-module.cc#newcode546 src/wasm/wasm-module.cc:546: for (size_t i = 0; i < num_tasks; i++) ...
4 years, 7 months ago (2016-05-11 13:43:08 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1961973002/100001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1961973002/100001
4 years, 7 months ago (2016-05-11 13:43:20 UTC) #14
commit-bot: I haz the power
Committed patchset #6 (id:100001)
4 years, 7 months ago (2016-05-11 14:07:02 UTC) #15
commit-bot: I haz the power
Patchset 6 (id:??) landed as https://crrev.com/17215438659d8ff2d7d55f95226bf8a1477ccd79 Cr-Commit-Position: refs/heads/master@{#36178}
4 years, 7 months ago (2016-05-11 14:09:03 UTC) #17
ahaas
A revert of this CL (patchset #6 id:100001) has been created in https://codereview.chromium.org/1965243003/ by ahaas@chromium.org. ...
4 years, 7 months ago (2016-05-11 15:57:54 UTC) #18
ahaas
On 2016/05/11 at 15:57:54, ahaas wrote: > A revert of this CL (patchset #6 id:100001) ...
4 years, 7 months ago (2016-05-12 08:26:53 UTC) #19
titzer
lgtm
4 years, 7 months ago (2016-05-12 08:41:35 UTC) #20
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1961973002/120001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1961973002/120001
4 years, 7 months ago (2016-05-12 11:56:57 UTC) #23
commit-bot: I haz the power
Committed patchset #7 (id:120001)
4 years, 7 months ago (2016-05-12 11:58:33 UTC) #24
commit-bot: I haz the power
4 years, 7 months ago (2016-05-12 11:58:57 UTC) #26
Message was sent while issue was closed.
Patchset 7 (id:??) landed as
https://crrev.com/4aec7ba1aa34e6b45618e0672ed1c2a0026e5b04
Cr-Commit-Position: refs/heads/master@{#36207}

Powered by Google App Engine
This is Rietveld 408576698