|
|
Created:
3 years, 8 months ago by Mircea Trofin Modified:
3 years, 8 months ago 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
Messages
Total messages: 73 (59 generated)
The CQ bit was checked by mtrofin@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: v8_linux64_verify_csa_rel_ng on master.tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_linux64_verify_csa_rel_n...) v8_linux_mipsel_compile_rel on master.tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_linux_mipsel_compile_rel...) v8_presubmit on master.tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_presubmit/builds/38884)
The CQ bit was checked by mtrofin@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: 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/build...) v8_linux64_gyp_rel_ng_triggered on master.tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_linux64_gyp_rel_ng_trigg...)
The CQ bit was checked by mtrofin@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: v8_linux64_avx2_rel_ng on master.tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_linux64_avx2_rel_ng/buil...) v8_linux64_avx2_rel_ng_triggered on master.tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_linux64_avx2_rel_ng_trig...)
Description was changed from ========== [wasm] instantiate expressed in terms of compile BUG= ========== to ========== [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. 1 test fails throughout, it's the public js-api repo counterpart of the js-api tests. See https://github.com/WebAssembly/spec/pull/457. BUG= ==========
mtrofin@chromium.org changed reviewers: + adamk@chromium.org, ahaas@chromium.org, bradnelson@chromium.org
The CQ bit was checked by mtrofin@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: v8_linux64_rel_ng on master.tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_linux64_rel_ng/builds/24327) v8_linux64_rel_ng_triggered on master.tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_linux64_rel_ng_triggered...)
The CQ bit was checked by mtrofin@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: 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/build...) v8_linux64_verify_csa_rel_ng on master.tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_linux64_verify_csa_rel_n...) v8_linux_arm_rel_ng on master.tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_linux_arm_rel_ng/builds/...) v8_presubmit on master.tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_presubmit/builds/39029) v8_win64_rel_ng on master.tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_win64_rel_ng/builds/25932)
The CQ bit was checked by mtrofin@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Patchset #6 (id:100001) has been deleted
Patchset #4 (id:60001) has been deleted
Description was changed from ========== [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. 1 test fails throughout, it's the public js-api repo counterpart of the js-api tests. See https://github.com/WebAssembly/spec/pull/457. BUG= ========== to ========== [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 ==========
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
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#ne... src/wasm/wasm-js.cc:340: Local<Value> data = args[1]; You sure args does that automatically? Old code didn't assume that? https://codereview.chromium.org/2806073002/diff/120001/src/wasm/wasm-js.cc#ne... src/wasm/wasm-js.cc:405: Local<Value> data = args[1]; Same https://codereview.chromium.org/2806073002/diff/120001/test/mjsunit/wasm/inst... File test/mjsunit/wasm/instantiate-run-basic.js (right): https://codereview.chromium.org/2806073002/diff/120001/test/mjsunit/wasm/inst... test/mjsunit/wasm/instantiate-run-basic.js:31: .then(pair => pair.instance.exports.main(), assertUnreachable) >80
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#ne... src/wasm/wasm-js.cc:340: Local<Value> data = args[1]; On 2017/04/11 23:18:41, bradnelson wrote: > You sure args does that automatically? > Old code didn't assume that? Yes: https://cs.chromium.org/chromium/src/v8/include/v8.h?dr=CSs&l=9167 Old code cared about type of the argument. I just want to set it in the closure. https://codereview.chromium.org/2806073002/diff/120001/src/wasm/wasm-js.cc#ne... src/wasm/wasm-js.cc:405: Local<Value> data = args[1]; On 2017/04/11 23:18:41, bradnelson wrote: > Same See above.
The CQ bit was checked by mtrofin@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from bradnelson@chromium.org Link to the patchset: https://codereview.chromium.org/2806073002/#ps140001 (title: "fixes")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
CQ is committing da patch. Bot data: {"patchset_id": 140001, "attempt_start_ts": 1491953604096340, "parent_rev": "70ad23791a21c0dd7ecef8d4d8dd30ff6fc291f6", "commit_rev": "7829af3275ff4644a2d0a1270abe1a1e4415e9fb"}
Message was sent while issue was closed.
Description was changed from ========== [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 ========== to ========== [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-Commit-Position: refs/heads/master@{#44592} Committed: https://chromium.googlesource.com/v8/v8/+/7829af3275ff4644a2d0a1270abe1a1e441... ==========
Message was sent while issue was closed.
Committed patchset #6 (id:140001) as https://chromium.googlesource.com/v8/v8/+/7829af3275ff4644a2d0a1270abe1a1e441...
Message was sent while issue was closed.
A revert of this CL (patchset #6 id:140001) has been created in https://codereview.chromium.org/2810203002/ by hablich@chromium.org. The reason for reverting is: Roll blocker: https://bugs.chromium.org/p/chromium/issues/detail?id=710824.
Message was sent while issue was closed.
Description was changed from ========== [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-Commit-Position: refs/heads/master@{#44592} Committed: https://chromium.googlesource.com/v8/v8/+/7829af3275ff4644a2d0a1270abe1a1e441... ========== to ========== [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-Commit-Position: refs/heads/master@{#44592} Committed: https://chromium.googlesource.com/v8/v8/+/7829af3275ff4644a2d0a1270abe1a1e441... ==========
The CQ bit was checked by mtrofin@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from bradnelson@chromium.org Link to the patchset: https://codereview.chromium.org/2806073002/#ps180001 (title: "fix")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
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, http://build.chromium.org/p/tryserver.v8/builders/v8_win64_rel_ng_triggered/b...)
Patchset #9 (id:200001) has been deleted
The CQ bit was checked by mtrofin@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
mtrofin@chromium.org changed reviewers: + dgozman@chromium.org
PTAL. Dmitri, if you could look at src/wasm/wasm-js.cc, for the MicrotasksScope usage. Thanks!
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: v8_win_nosnap_shared_rel_ng on master.tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_win_nosnap_shared_rel_ng...) v8_win_nosnap_shared_rel_ng_triggered on master.tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_win_nosnap_shared_rel_ng...)
The CQ bit was checked by mtrofin@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: 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/build...) v8_linux64_gyp_rel_ng_triggered on master.tryserver.v8 (JOB_FAILED, http://build.chromium.org/p/tryserver.v8/builders/v8_linux64_gyp_rel_ng_trigg...)
On 2017/04/17 21:33:00, Mircea Trofin wrote: > PTAL. > > Dmitri, if you could look at src/wasm/wasm-js.cc, for the > MicrotasksScope usage. > > Thanks! Microtasks look good, thanks.
The CQ bit was checked by mtrofin@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
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#ne... src/wasm/wasm-js.cc:35: #define ASSIGN(type, var, expr) \ The name we use for this inside the API is ASSIGN_RETURN_ON_EXCEPTION, and it also includes a DCHECK that an exception is pending. I'd rather this be more similar to what we use inside. https://codereview.chromium.org/2806073002/diff/260001/src/wasm/wasm-js.cc#ne... src/wasm/wasm-js.cc:320: vanilla_instantiate->Call(context, args.Holder(), 1, &module)); I really feel like it's weird to create a v8::Function around a C++ function just to immediately call it. I would prefer there to be a slightly more fine-grained factoring here, where there's WebAssemblyInstiantiateImpl(), which takes isolate, module and ffi arguments, and a WebAssemblyInsantiateImplCallback, which is used for the one case where the v8::Function is actually passed to .then (down in WebAssemblyInstantiate()). I think that might even be less code overall. WDYT? https://codereview.chromium.org/2806073002/diff/260001/src/wasm/wasm-js.cc#ne... src/wasm/wasm-js.cc:325: ASSIGN(String, module_name, This and the above can't meaningfully fail (the API says that they'd only fail if their length was huge). I'd rather see them use Local<String> module_name = String::NewFromOneByte(...).ToLocalChecked(); https://codereview.chromium.org/2806073002/diff/260001/src/wasm/wasm-js.cc#ne... src/wasm/wasm-js.cc:330: DO_BOOL(ret->CreateDataProperty(context, module_name, module)); I don't believe that either of these could possibly throw. Can you wrap them in CHECK() instead of your DO_BOOL macro? Like, CHECK(ret->CreateDataProperty(...).FromJust()); https://codereview.chromium.org/2806073002/diff/260001/src/wasm/wasm-js.cc#ne... src/wasm/wasm-js.cc:405: DO_BOOL(resolver->Resolve(context, first_arg_value)); This would be the last use of DO_BOOL; given that, I think I'd rather see: if (!resolver->Resolve(...).IsJust()) return; https://codereview.chromium.org/2806073002/diff/260001/src/wasm/wasm-js.cc#ne... src/wasm/wasm-js.cc:420: Function::New(context, instantiator, data)); It's a little wasteful to create a new function each time this is called, but I guess performance here is not a big concern?
The CQ bit was checked by mtrofin@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
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#ne... src/wasm/wasm-js.cc:35: #define ASSIGN(type, var, expr) \ On 2017/04/17 23:46:19, adamk wrote: > The name we use for this inside the API is ASSIGN_RETURN_ON_EXCEPTION, and it > also includes a DCHECK that an exception is pending. I'd rather this be more > similar to what we use inside. Done. https://codereview.chromium.org/2806073002/diff/260001/src/wasm/wasm-js.cc#ne... src/wasm/wasm-js.cc:320: vanilla_instantiate->Call(context, args.Holder(), 1, &module)); On 2017/04/17 23:46:19, adamk wrote: > I really feel like it's weird to create a v8::Function around a C++ function > just to immediately call it. > > I would prefer there to be a slightly more fine-grained factoring here, where > there's WebAssemblyInstiantiateImpl(), which takes isolate, module and ffi > arguments, and a WebAssemblyInsantiateImplCallback, which is used for the one > case where the v8::Function is actually passed to .then (down in > WebAssemblyInstantiate()). I think that might even be less code overall. WDYT? Done. https://codereview.chromium.org/2806073002/diff/260001/src/wasm/wasm-js.cc#ne... src/wasm/wasm-js.cc:325: ASSIGN(String, module_name, On 2017/04/17 23:46:19, adamk wrote: > This and the above can't meaningfully fail (the API says that they'd only fail > if their length was huge). I'd rather see them use > > Local<String> module_name = > String::NewFromOneByte(...).ToLocalChecked(); Done. https://codereview.chromium.org/2806073002/diff/260001/src/wasm/wasm-js.cc#ne... src/wasm/wasm-js.cc:330: DO_BOOL(ret->CreateDataProperty(context, module_name, module)); On 2017/04/17 23:46:19, adamk wrote: > I don't believe that either of these could possibly throw. Can you wrap them in > CHECK() instead of your DO_BOOL macro? Like, > > CHECK(ret->CreateDataProperty(...).FromJust()); Done. https://codereview.chromium.org/2806073002/diff/260001/src/wasm/wasm-js.cc#ne... src/wasm/wasm-js.cc:405: DO_BOOL(resolver->Resolve(context, first_arg_value)); On 2017/04/17 23:46:19, adamk wrote: > This would be the last use of DO_BOOL; given that, I think I'd rather see: > > if (!resolver->Resolve(...).IsJust()) return; Done. https://codereview.chromium.org/2806073002/diff/260001/src/wasm/wasm-js.cc#ne... src/wasm/wasm-js.cc:420: Function::New(context, instantiator, data)); On 2017/04/17 23:46:19, adamk wrote: > It's a little wasteful to create a new function each time this is called, but I > guess performance here is not a big concern? That, but also, we need a closure to hold on to the ffi until the promise is resolved.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
The CQ bit was checked by mtrofin@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from bradnelson@chromium.org Link to the patchset: https://codereview.chromium.org/2806073002/#ps280001 (title: "feedback")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
CQ is committing da patch. Bot data: {"patchset_id": 280001, "attempt_start_ts": 1492478969190060, "parent_rev": "1236335551297ea54ae416c860bbd3ae89807993", "commit_rev": "71cf4890d0a2bc3ac47597d724676df871a572d5"}
Message was sent while issue was closed.
Description was changed from ========== [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-Commit-Position: refs/heads/master@{#44592} Committed: https://chromium.googlesource.com/v8/v8/+/7829af3275ff4644a2d0a1270abe1a1e441... ========== to ========== [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/+/7829af3275ff4644a2d0a1270abe1a1e441... Review-Url: https://codereview.chromium.org/2806073002 Cr-Commit-Position: refs/heads/master@{#44669} Committed: https://chromium.googlesource.com/v8/v8/+/71cf4890d0a2bc3ac47597d724676df871a... ==========
Message was sent while issue was closed.
Committed patchset #12 (id:280001) as https://chromium.googlesource.com/v8/v8/+/71cf4890d0a2bc3ac47597d724676df871a...
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. |