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

Issue 2806073002: [wasm] instantiate expressed in terms of compile (Closed)

Created:
3 years, 8 months ago by Mircea Trofin
Modified:
3 years, 8 months ago
Reviewers:
bradnelson, dgozman, ahaas, adamk
CC:
v8-reviews_googlegroups.com, wasm-v8_google.com
Target Ref:
refs/heads/master
Project:
v8
Visibility:
Public.

Description

[wasm] instantiate expressed in terms of compile Today, the semantics of: WebAssembly.instantiate and WebAssembly.compile().then(new WebAssemblyInstance) are subtly different, to the point where attempting the proposed change uncovered bugs. In the future, it's possible that .instantiate actually have different semantics - if we pre-specialized to the provided ffi, for example. Right now that's not the case. This CL: - gets our implementation closer to what developers may write using the compile -> new Instance alternative, in particular wrt promise creation. By reusing code paths, we uncover more bugs, and keep maintenance cost lower. - it gives us the response-based WebAssembly.instantiate implicitly. Otherwise, we'd need that same implementation on the blink side. The negative is maintenance: imagine if the bugs I mentioned could only be found when running in Blink. BUG=chromium:697028 Review-Url: https://codereview.chromium.org/2806073002 Cr-Original-Commit-Position: refs/heads/master@{#44592} Committed: https://chromium.googlesource.com/v8/v8/+/7829af3275ff4644a2d0a1270abe1a1e4415e9fb Review-Url: https://codereview.chromium.org/2806073002 Cr-Commit-Position: refs/heads/master@{#44669} Committed: https://chromium.googlesource.com/v8/v8/+/71cf4890d0a2bc3ac47597d724676df871a572d5

Patch Set 1 #

Patch Set 2 : works, except exception stacks #

Patch Set 3 : rebase #

Patch Set 4 : reset (for repetitive tests) #

Patch Set 5 : intantiate #

Total comments: 5

Patch Set 6 : fixes #

Patch Set 7 : fix #

Patch Set 8 : fix #

Patch Set 9 : Update/cleanup #

Patch Set 10 : Update/cleanup #

Patch Set 11 : fix resetting #

Total comments: 12

Patch Set 12 : feedback #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+212 lines, -91 lines) Patch
M src/runtime/runtime.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +2 lines, -0 lines 0 comments Download
M src/runtime/runtime-test.cc View 1 2 3 4 5 6 7 8 9 10 3 chunks +26 lines, -0 lines 0 comments Download
M src/wasm/wasm-js.cc View 1 2 3 4 5 6 7 8 9 10 11 9 chunks +128 lines, -44 lines 3 comments Download
M src/wasm/wasm-module.h View 1 2 1 chunk +0 lines, -4 lines 0 comments Download
M src/wasm/wasm-module.cc View 1 2 3 4 5 6 7 8 1 chunk +0 lines, -38 lines 0 comments Download
M test/mjsunit/wasm/instantiate-run-basic.js View 1 2 3 4 5 1 chunk +17 lines, -3 lines 0 comments Download
M test/mjsunit/wasm/js-api.js View 1 2 3 4 2 chunks +0 lines, -2 lines 0 comments Download
A test/mjsunit/wasm/wasm-api-overloading.js View 1 2 3 4 5 6 7 8 9 10 1 chunk +39 lines, -0 lines 0 comments Download

Messages

Total messages: 73 (59 generated)
bradnelson
lgtm https://codereview.chromium.org/2806073002/diff/120001/src/wasm/wasm-js.cc File src/wasm/wasm-js.cc (right): https://codereview.chromium.org/2806073002/diff/120001/src/wasm/wasm-js.cc#newcode340 src/wasm/wasm-js.cc:340: Local<Value> data = args[1]; You sure args does ...
3 years, 8 months ago (2017-04-11 23:18:41 UTC) #30
Mircea Trofin
https://codereview.chromium.org/2806073002/diff/120001/src/wasm/wasm-js.cc File src/wasm/wasm-js.cc (right): https://codereview.chromium.org/2806073002/diff/120001/src/wasm/wasm-js.cc#newcode340 src/wasm/wasm-js.cc:340: Local<Value> data = args[1]; On 2017/04/11 23:18:41, bradnelson wrote: ...
3 years, 8 months ago (2017-04-11 23:33:18 UTC) #31
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/2806073002/140001
3 years, 8 months ago (2017-04-11 23:33:30 UTC) #34
commit-bot: I haz the power
Committed patchset #6 (id:140001) as https://chromium.googlesource.com/v8/v8/+/7829af3275ff4644a2d0a1270abe1a1e4415e9fb
3 years, 8 months ago (2017-04-12 00:01:13 UTC) #37
Michael Hablich
A revert of this CL (patchset #6 id:140001) has been created in https://codereview.chromium.org/2810203002/ by hablich@chromium.org. ...
3 years, 8 months ago (2017-04-12 13:27:36 UTC) #38
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/2806073002/180001
3 years, 8 months ago (2017-04-13 05:40:53 UTC) #42
commit-bot: I haz the power
Try jobs failed on following builders: v8_win64_rel_ng on master.tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_win64_rel_ng/builds/26003) v8_win64_rel_ng_triggered on master.tryserver.v8 (JOB_FAILED, ...
3 years, 8 months ago (2017-04-13 06:00:01 UTC) #44
Mircea Trofin
PTAL. Dmitri, if you could look at src/wasm/wasm-js.cc, for the MicrotasksScope usage. Thanks!
3 years, 8 months ago (2017-04-17 21:33:00 UTC) #49
dgozman
On 2017/04/17 21:33:00, Mircea Trofin wrote: > PTAL. > > Dmitri, if you could look ...
3 years, 8 months ago (2017-04-17 22:34:29 UTC) #56
adamk
https://codereview.chromium.org/2806073002/diff/260001/src/wasm/wasm-js.cc File src/wasm/wasm-js.cc (right): https://codereview.chromium.org/2806073002/diff/260001/src/wasm/wasm-js.cc#newcode35 src/wasm/wasm-js.cc:35: #define ASSIGN(type, var, expr) \ The name we use ...
3 years, 8 months ago (2017-04-17 23:46:19 UTC) #61
Mircea Trofin
https://codereview.chromium.org/2806073002/diff/260001/src/wasm/wasm-js.cc File src/wasm/wasm-js.cc (right): https://codereview.chromium.org/2806073002/diff/260001/src/wasm/wasm-js.cc#newcode35 src/wasm/wasm-js.cc:35: #define ASSIGN(type, var, expr) \ On 2017/04/17 23:46:19, adamk ...
3 years, 8 months ago (2017-04-18 01:03:54 UTC) #64
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/2806073002/280001
3 years, 8 months ago (2017-04-18 01:29:34 UTC) #69
commit-bot: I haz the power
Committed patchset #12 (id:280001) as https://chromium.googlesource.com/v8/v8/+/71cf4890d0a2bc3ac47597d724676df871a572d5
3 years, 8 months ago (2017-04-18 01:31:27 UTC) #72
adamk
3 years, 8 months ago (2017-04-18 17:17:22 UTC) #73
Message was sent while issue was closed.
https://codereview.chromium.org/2806073002/diff/280001/src/wasm/wasm-js.cc
File src/wasm/wasm-js.cc (right):

https://codereview.chromium.org/2806073002/diff/280001/src/wasm/wasm-js.cc#ne...
src/wasm/wasm-js.cc:39: DCHECK(i_isolate->has_pending_exception()); \
You still need to return here, otherwise we'll crash due to the empty var
farther down in the function.

https://codereview.chromium.org/2806073002/diff/280001/src/wasm/wasm-js.cc#ne...
src/wasm/wasm-js.cc:128: i::MaybeHandle<i::JSReceiver> GetValueAsImports(const
Local<Value>& arg,
Style nit: we pass Locals and Handles by value (they're just pointers)

https://codereview.chromium.org/2806073002/diff/280001/src/wasm/wasm-js.cc#ne...
src/wasm/wasm-js.cc:323: .ToLocal(&instance))
Style nit: please add { } around if-statement body if it doesn't all fit on one
line.

Powered by Google App Engine
This is Rietveld 408576698