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

Issue 2056633002: [wasm] Separate compilation from instantiation (Closed)

Created:
4 years, 6 months ago by Mircea Trofin
Modified:
4 years, 6 months ago
Reviewers:
titzer, bradnelson
CC:
v8-reviews_googlegroups.com, gdeepti
Base URL:
https://chromium.googlesource.com/v8/v8.git@master
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

[wasm] Separate compilation from instantiation Compilation of wasm functions happens before instantiation. Imports are linked afterwards, at instantiation time. Globals and memory are also allocated and then tied in via relocation at instantiation time. This paves the way for implementing Wasm.compile, a prerequisite to offering the compiled code serialization feature. Currently, the WasmModule::Compile method just returns a fixed array containing the code objects. More appropriate modeling of the compiled module to come. Opportunistically centralized the logic on how to update memory references, size, and globals, since that logic is the exact same on each architecture, except for the actual storing of values back in the instruction stream. BUG=v8:5072 Committed: https://crrev.com/c1d01aea117c62759cc2be1805493ed59218558c Cr-Commit-Position: refs/heads/master@{#37086}

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : #

Patch Set 4 : #

Patch Set 5 : #

Patch Set 6 : #

Patch Set 7 : #

Patch Set 8 : latest #

Patch Set 9 : fix #

Patch Set 10 : fix #

Total comments: 1

Patch Set 11 : fix #

Total comments: 10

Patch Set 12 : printfs #

Patch Set 13 : silly fix #

Total comments: 11

Patch Set 14 : silly fix #

Patch Set 15 : mem fix #

Patch Set 16 : mem fix #

Patch Set 17 : feedback #

Unified diffs Side-by-side diffs Delta from patch set Stats (+327 lines, -386 lines) Patch
M src/arm/assembler-arm.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +7 lines, -34 lines 0 comments Download
M src/arm64/assembler-arm64.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +6 lines, -33 lines 0 comments Download
M src/assembler.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 3 chunks +23 lines, -25 lines 0 comments Download
M src/assembler.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +43 lines, -0 lines 0 comments Download
M src/ia32/assembler-ia32.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +6 lines, -36 lines 0 comments Download
M src/mips/assembler-mips.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +6 lines, -33 lines 0 comments Download
M src/mips64/assembler-mips64.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +6 lines, -33 lines 0 comments Download
M src/v8memory.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +7 lines, -0 lines 0 comments Download
M src/wasm/wasm-module.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 chunks +6 lines, -4 lines 0 comments Download
M src/wasm/wasm-module.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 18 chunks +210 lines, -146 lines 0 comments Download
M src/x64/assembler-x64.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 chunks +7 lines, -40 lines 0 comments Download
M test/cctest/wasm/wasm-run-utils.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +0 lines, -1 line 0 comments Download
M test/unittests/wasm/ast-decoder-unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +0 lines, -1 line 0 comments Download

Messages

Total messages: 28 (11 generated)
Mircea Trofin
https://codereview.chromium.org/2056633002/diff/240001/src/x64/assembler-x64.cc File src/x64/assembler-x64.cc (right): https://codereview.chromium.org/2056633002/diff/240001/src/x64/assembler-x64.cc#newcode590 src/x64/assembler-x64.cc:590: if (is_int8(src.value_) && RelocInfo::IsNone(src.rmode_)) { This I copied from ...
4 years, 6 months ago (2016-06-16 06:05:05 UTC) #6
bradnelson
lgtm, sans questions/suggestions and red trybots :-) https://codereview.chromium.org/2056633002/diff/260001/src/arm/assembler-arm.cc File src/arm/assembler-arm.cc (right): https://codereview.chromium.org/2056633002/diff/260001/src/arm/assembler-arm.cc#newcode257 src/arm/assembler-arm.cc:257: void RelocInfo::UncheckedUpdateWasmMemoryReference(Address ...
4 years, 6 months ago (2016-06-16 17:46:54 UTC) #7
bradnelson
lgtm, sans questions/suggestions and red trybots :-) https://codereview.chromium.org/2056633002/diff/260001/src/arm/assembler-arm.cc File src/arm/assembler-arm.cc (right): https://codereview.chromium.org/2056633002/diff/260001/src/arm/assembler-arm.cc#newcode257 src/arm/assembler-arm.cc:257: void RelocInfo::UncheckedUpdateWasmMemoryReference(Address ...
4 years, 6 months ago (2016-06-16 17:46:54 UTC) #8
titzer
https://codereview.chromium.org/2056633002/diff/300001/src/assembler.cc File src/assembler.cc (right): https://codereview.chromium.org/2056633002/diff/300001/src/assembler.cc#newcode389 src/assembler.cc:389: if (!(new_size == 0 || (new_base <= updated_reference && ...
4 years, 6 months ago (2016-06-16 23:12:15 UTC) #9
Mircea Trofin
https://codereview.chromium.org/2056633002/diff/300001/src/wasm/wasm-module.cc File src/wasm/wasm-module.cc (right): https://codereview.chromium.org/2056633002/diff/300001/src/wasm/wasm-module.cc#newcode181 src/wasm/wasm-module.cc:181: const std::vector<Handle<Code>>& to_link, On 2016/06/16 23:12:14, titzer wrote: > ...
4 years, 6 months ago (2016-06-16 23:43:11 UTC) #10
titzer
https://codereview.chromium.org/2056633002/diff/300001/src/wasm/wasm-module.cc File src/wasm/wasm-module.cc (right): https://codereview.chromium.org/2056633002/diff/300001/src/wasm/wasm-module.cc#newcode181 src/wasm/wasm-module.cc:181: const std::vector<Handle<Code>>& to_link, On 2016/06/16 23:43:11, Mircea Trofin wrote: ...
4 years, 6 months ago (2016-06-17 00:23:42 UTC) #11
Mircea Trofin
https://codereview.chromium.org/2056633002/diff/300001/src/wasm/wasm-module.cc File src/wasm/wasm-module.cc (right): https://codereview.chromium.org/2056633002/diff/300001/src/wasm/wasm-module.cc#newcode181 src/wasm/wasm-module.cc:181: const std::vector<Handle<Code>>& to_link, On 2016/06/17 00:23:42, titzer wrote: > ...
4 years, 6 months ago (2016-06-17 00:39:30 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2056633002/380001
4 years, 6 months ago (2016-06-17 17:16:41 UTC) #15
Mircea Trofin
https://codereview.chromium.org/2056633002/diff/260001/src/arm/assembler-arm.cc File src/arm/assembler-arm.cc (right): https://codereview.chromium.org/2056633002/diff/260001/src/arm/assembler-arm.cc#newcode257 src/arm/assembler-arm.cc:257: void RelocInfo::UncheckedUpdateWasmMemoryReference(Address address, On 2016/06/16 17:46:54, bradnelson wrote: > ...
4 years, 6 months ago (2016-06-17 17:16:47 UTC) #16
commit-bot: I haz the power
Try jobs failed on following builders: v8_presubmit on tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_presubmit/builds/17498)
4 years, 6 months ago (2016-06-17 17:19:51 UTC) #18
Mircea Trofin
PTAL Note: I'll separately do something about the mem size as uint64_t for the 4GB ...
4 years, 6 months ago (2016-06-17 18:32:46 UTC) #19
titzer
lgtm
4 years, 6 months ago (2016-06-20 04:51:54 UTC) #20
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2056633002/380001
4 years, 6 months ago (2016-06-20 04:52:23 UTC) #22
commit-bot: I haz the power
Committed patchset #17 (id:380001)
4 years, 6 months ago (2016-06-20 05:22:12 UTC) #24
commit-bot: I haz the power
Patchset 17 (id:??) landed as https://crrev.com/c1d01aea117c62759cc2be1805493ed59218558c Cr-Commit-Position: refs/heads/master@{#37086}
4 years, 6 months ago (2016-06-20 05:23:47 UTC) #26
Clemens Hammacher
This CL made the reported code size drop to nearly zero: https://chromeperf.appspot.com/report?sid=8e65fdc032014d9aec8cf189855dd252e3d35854299043e045a97cda5271e8d1 In case the ...
4 years, 6 months ago (2016-06-20 07:46:10 UTC) #27
Mircea Trofin
4 years, 6 months ago (2016-06-22 21:38:47 UTC) #28
Message was sent while issue was closed.
On 2016/06/20 07:46:10, Clemens Hammacher wrote:
> This CL made the reported code size drop to nearly zero:
>
https://chromeperf.appspot.com/report?sid=8e65fdc032014d9aec8cf189855dd252e3d...
> 
> In case the link does not work: Check
> 1) internal.client.v8/Haswell_x64/v8 / Wasm / AngryBots / CodeSize
> 2) internal.client.v8/Haswell_x64/v8 / Wasm / BananaBread / CodeSize

Fixed in https://codereview.chromium.org/2079353002/

Powered by Google App Engine
This is Rietveld 408576698