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

Issue 2398023002: [wasm] asm.js - Parse and convert asm.js to wasm a function at a time. (Closed)

Created:
4 years, 2 months ago by bradnelson
Modified:
4 years ago
CC:
v8-reviews_googlegroups.com
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

[wasm] asm.js - Parse and convert asm.js to wasm a function at a time. Make the AsmWasmBuilder drive the process of typing and potentially parsing function bodies. This will allow us to keep only a single asm.js function's AST in memory as we convert to WebAssembly. This is needed to keep our memory footprint low. Add some additional output to a few tests that's helpful to see which stage they fail at. BUG= https://bugs.chromium.org/p/v8/issues/detail?id=4203 LOG=N R=marja@chromium.org,adamk@chromium.org,aseemgarg@chromium.org,titzer@chromium.org Committed: https://crrev.com/14e05c104684226ecc2ecaef9794d55803f52023 Cr-Commit-Position: refs/heads/master@{#41372}

Patch Set 1 #

Total comments: 6

Patch Set 2 : merge #

Patch Set 3 : fixes #

Patch Set 4 : fix #

Patch Set 5 : drop junk #

Patch Set 6 : fix #

Patch Set 7 : fix #

Patch Set 8 : drop old #

Patch Set 9 : drop leftover #

Total comments: 8

Patch Set 10 : revised #

Total comments: 24

Patch Set 11 : git cl try #

Total comments: 2

Patch Set 12 : fix #

Patch Set 13 : clear function node each time #

Total comments: 8

Patch Set 14 : review fixes + fix asan forward reference failure #

Total comments: 4

Patch Set 15 : Fix DCHECKS #

Total comments: 17

Patch Set 16 : fix #

Patch Set 17 : fix #

Unified diffs Side-by-side diffs Delta from patch set Stats (+447 lines, -233 lines) Patch
M src/asmjs/asm-js.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +10 lines, -10 lines 0 comments Download
M src/asmjs/asm-typer.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 8 chunks +56 lines, -6 lines 0 comments Download
M src/asmjs/asm-typer.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 12 chunks +135 lines, -114 lines 0 comments Download
M src/asmjs/asm-wasm-builder.h View 1 2 chunks +10 lines, -3 lines 0 comments Download
M src/asmjs/asm-wasm-builder.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 20 chunks +167 lines, -61 lines 0 comments Download
M src/ast/scopes.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +16 lines, -15 lines 0 comments Download
M src/ast/scopes.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +4 lines, -2 lines 0 comments Download
M src/compiler.cc View 1 2 3 4 5 6 7 8 9 10 3 chunks +3 lines, -14 lines 0 comments Download
M src/factory.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +3 lines, -0 lines 0 comments Download
M src/factory.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +11 lines, -0 lines 0 comments Download
M src/parsing/parse-info.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +6 lines, -0 lines 0 comments Download
M src/parsing/parse-info.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -0 lines 0 comments Download
M src/parsing/parser.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 3 chunks +7 lines, -4 lines 0 comments Download
M src/wasm/wasm-module-builder.h View 1 1 chunk +2 lines, -1 line 0 comments Download
M src/wasm/wasm-module-builder.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +9 lines, -2 lines 0 comments Download
M test/cctest/asmjs/test-asm-typer.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 chunk +1 line, -1 line 0 comments Download
M test/mjsunit/wasm/asm-wasm.js View 1 6 chunks +6 lines, -0 lines 0 comments Download

Messages

Total messages: 92 (63 generated)
titzer
https://codereview.chromium.org/2398023002/diff/1/src/asmjs/asm-typer.h File src/asmjs/asm-typer.h (right): https://codereview.chromium.org/2398023002/diff/1/src/asmjs/asm-typer.h#newcode254 src/asmjs/asm-typer.h:254: AsmType* ValidateModulePhase1of2(FunctionLiteral* fun); Can we get some more descriptive ...
4 years, 2 months ago (2016-10-07 12:57:00 UTC) #5
bradn
Still sorting thru ~12 failures or so, but would appreciate feedback. https://codereview.chromium.org/2398023002/diff/1/src/asmjs/asm-typer.h File src/asmjs/asm-typer.h (right): ...
4 years ago (2016-11-25 09:19:36 UTC) #15
marja
When do you use ParseFunction and when ParseProgram - why do you need to change ...
4 years ago (2016-11-25 10:34:52 UTC) #22
bradn
PTAL Marja, ah yes, I don't need to change ParseProgram, as it's not used for ...
4 years ago (2016-11-26 08:07:17 UTC) #34
marja
Had a look at the removed DCHECKS... I don't think I understand how you're calling ...
4 years ago (2016-11-26 15:46:36 UTC) #37
bradn
https://codereview.chromium.org/2398023002/diff/160001/src/ast/scopes.cc File src/ast/scopes.cc (right): https://codereview.chromium.org/2398023002/diff/160001/src/ast/scopes.cc#newcode551 src/ast/scopes.cc:551: // scope->outer_scope()->already_resolved_); On 2016/11/26 15:46:36, marja wrote: > Why ...
4 years ago (2016-11-27 01:14:02 UTC) #40
titzer
https://codereview.chromium.org/2398023002/diff/180001/src/asmjs/asm-typer.h File src/asmjs/asm-typer.h (right): https://codereview.chromium.org/2398023002/diff/180001/src/asmjs/asm-typer.h#newcode262 src/asmjs/asm-typer.h:262: AsmType* ValidateModuleBeforeFunctionsPhase(FunctionLiteral* fun); Seems a little weird to use ...
4 years ago (2016-11-28 10:40:11 UTC) #43
marja
(See previous comment from bradnelson@) https://codereview.chromium.org/2398023002/diff/180001/src/ast/scopes.cc File src/ast/scopes.cc (right): https://codereview.chromium.org/2398023002/diff/180001/src/ast/scopes.cc#newcode549 src/ast/scopes.cc:549: // DCHECK(scope->scope_type() == SCRIPT_SCOPE ...
4 years ago (2016-11-28 11:10:17 UTC) #44
marja
Alright, I'm slowly beginning to understand this CL. Below I suggest a solution to the ...
4 years ago (2016-11-28 11:47:21 UTC) #45
bradn
PTAL +jochen (have I meshed well with what you're adding with function ids?) +verawest PTAL ...
4 years ago (2016-11-29 06:30:35 UTC) #47
bradnelson
Ah good, adding some prints confirms a couple thousand bytes are allocated on the main ...
4 years ago (2016-11-29 06:49:39 UTC) #50
marja
The Zone thing is unfortunately a bit unclean (in master). E.g., it's just an implementation ...
4 years ago (2016-11-29 07:39:31 UTC) #53
marja
https://codereview.chromium.org/2398023002/diff/200001/src/ast/scopes.cc File src/ast/scopes.cc (right): https://codereview.chromium.org/2398023002/diff/200001/src/ast/scopes.cc#newcode1011 src/ast/scopes.cc:1011: DCHECK(factory->zone() == zone() || outer_scope()->IsAsmFunction()); I think this DCHECK ...
4 years ago (2016-11-29 07:39:46 UTC) #54
bradn
Figured out how to set the zone on the ast_node_factory needed. One unexpected consequence was ...
4 years ago (2016-11-29 09:54:09 UTC) #61
marja
Starting to look good (I'm only having a look at the interaction w/ parser & ...
4 years ago (2016-11-29 10:20:04 UTC) #62
bradn
PTAL https://codereview.chromium.org/2398023002/diff/240001/src/asmjs/asm-wasm-builder.cc File src/asmjs/asm-wasm-builder.cc (right): https://codereview.chromium.org/2398023002/diff/240001/src/asmjs/asm-wasm-builder.cc#newcode166 src/asmjs/asm-wasm-builder.cc:166: decl->scope()->RemoveInnerScope(decl->scope()->inner_scope()); On 2016/11/29 10:20:04, marja wrote: > This ...
4 years ago (2016-11-29 10:43:36 UTC) #67
marja
LGTM modulo the comment I had a look at the following: - parser - scopes ...
4 years ago (2016-11-29 10:48:50 UTC) #68
bradn
Could others chime in on the remaining bits. Thanks kindly! https://codereview.chromium.org/2398023002/diff/260001/src/asmjs/asm-wasm-builder.cc File src/asmjs/asm-wasm-builder.cc (right): https://codereview.chromium.org/2398023002/diff/260001/src/asmjs/asm-wasm-builder.cc#newcode170 ...
4 years ago (2016-11-29 11:00:46 UTC) #71
Toon Verwaest
some minor comments from my side only, lgtm otherwise on parser / ast / factory ...
4 years ago (2016-11-29 14:39:59 UTC) #74
jochen (gone - plz use gerrit)
I guess Toon & Marja have this covered from the things I could review?
4 years ago (2016-11-29 14:50:24 UTC) #75
titzer
On 2016/11/29 06:30:35, bradn wrote: > PTAL > > +jochen (have I meshed well with ...
4 years ago (2016-11-29 14:52:50 UTC) #76
titzer
lgtm with comments https://codereview.chromium.org/2398023002/diff/280001/src/asmjs/asm-js.cc File src/asmjs/asm-js.cc (right): https://codereview.chromium.org/2398023002/diff/280001/src/asmjs/asm-js.cc#newcode156 src/asmjs/asm-js.cc:156: v8::internal::wasm::AsmWasmBuilder builder(info->isolate(), info->zone(), Can you drop ...
4 years ago (2016-11-29 14:57:37 UTC) #77
bradn
https://codereview.chromium.org/2398023002/diff/280001/src/asmjs/asm-js.cc File src/asmjs/asm-js.cc (right): https://codereview.chromium.org/2398023002/diff/280001/src/asmjs/asm-js.cc#newcode156 src/asmjs/asm-js.cc:156: v8::internal::wasm::AsmWasmBuilder builder(info->isolate(), info->zone(), On 2016/11/29 14:57:37, titzer wrote: > ...
4 years ago (2016-11-29 22:09:06 UTC) #78
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/2398023002/300001
4 years ago (2016-11-29 22:09:28 UTC) #81
commit-bot: I haz the power
Try jobs failed on following builders: v8_linux64_gyp_rel_ng on master.tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_linux64_gyp_rel_ng/builds/8832) v8_linux64_gyp_rel_ng_triggered on master.tryserver.v8 (JOB_FAILED, ...
4 years ago (2016-11-29 22:26:19 UTC) #83
bradn
https://codereview.chromium.org/2398023002/diff/280001/src/asmjs/asm-typer.cc File src/asmjs/asm-typer.cc (right): https://codereview.chromium.org/2398023002/diff/280001/src/asmjs/asm-typer.cc#newcode130 src/asmjs/asm-typer.cc:130: bool AsmTyper::SourceLayoutTracker::Section::OverlapsWith( On 2016/11/29 22:09:06, bradn wrote: > On ...
4 years ago (2016-11-29 23:30:03 UTC) #84
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/2398023002/320001
4 years ago (2016-11-29 23:31:08 UTC) #87
commit-bot: I haz the power
Committed patchset #17 (id:320001)
4 years ago (2016-11-30 00:25:33 UTC) #90
commit-bot: I haz the power
4 years ago (2016-11-30 00:26:20 UTC) #92
Message was sent while issue was closed.
Patchset 17 (id:??) landed as
https://crrev.com/14e05c104684226ecc2ecaef9794d55803f52023
Cr-Commit-Position: refs/heads/master@{#41372}

Powered by Google App Engine
This is Rietveld 408576698