Conversation
Added link to V8 design portfolio for stack switching
Also tightened up language obout requiring traps when promise/suspending not correctly lined up.
Some of the changes that follow from reviewer's remarks. Co-authored-by: Shu-yu Guo <syg@chromium.org>
Make it clear that a 'long jump' in the meta-interpreter is being affected.
Updated test suite for jspi to reflect new API
Implementation notes
Merge remote-tracking branch 'spec/wasm-3.0'
Fix JSPI tests
Some minor tweaks in response to reviewer's remarks.
Co-authored-by: Shu-yu Guo <syg@chromium.org>
Co-authored-by: Shu-yu Guo <syg@chromium.org>
Co-authored-by: Shu-yu Guo <syg@chromium.org>
use 'marker' suffix to better distinguish Suspending objects from functions
Small changes, responding to remarks by reviewer.
Small tweak: Add an explanation for the role of the map Big tweak: Arrange to throw a JS RuntimeError rather than trap when JSPI usage not properly balanced.
Tidy up punctuation.
Clean up throwing exceptions from JS (a little bit)
Draft of spec for jspi
Use the new standard exception type SuspendError if a problem arises with trying to suspend.
Add SuspendError
Co-authored-by: Francis McCabe <fmccabe@gmail.com>
eqrion
left a comment
There was a problem hiding this comment.
This is a tricky one, and I'm still learning the spec interactions for WHATWG/TC39 so forgive me if I messed some of these comments up. I'd like to take another look at this.
| .. |WasmDraft| replace:: |pagelink| | ||
| .. _WasmDraft: |pagelink| | ||
| .. |WasmDraft| replace:: https://webassembly.github.io/js-promise-integration/core/ | ||
| .. _WasmDraft: https://webassembly.github.io/js-promise-integration/core/ | ||
|
|
||
| .. |WasmIssues| replace:: |issuelink| | ||
| .. _WasmIssues: |issuelink| | ||
| .. |WasmIssues| replace:: https://github.com/webassembly/js-promise-integration/issues/ | ||
| .. _WasmIssues: https://github.com/webassembly/js-promise-integration/issues/ | ||
|
|
||
| .. |IEEE754| replace:: IEEE 754 | ||
| .. |IEEE754| replace:: IEEE 754-2019 | ||
| .. _IEEE754: https://ieeexplore.ieee.org/document/8766229 |
There was a problem hiding this comment.
I think we want to revert these changes.
There was a problem hiding this comment.
I did the pagelink fixes. But, what about the IEEE reference?
There was a problem hiding this comment.
Please revert. This changes the inline text produced and would result in awkward wording like "integers and IEEE 754-2019 numbers". In the contexts where this macro is used, the version is irrelevant.
|  | ||
|  | ||
|  | ||
| [](https://travis-ci.org/WebAssembly/js-promise-integration) |
There was a problem hiding this comment.
This looks like an accidental removal?
| text: evaluation_suspend; url: appendix/embedding.html#embed-evaluation-suspend | ||
| text: evaluation_resume; url: appendix/embedding.html#embed-evaluation-resume |
There was a problem hiding this comment.
These are broken links. Did you intend to use them?
| 1. Otherwise, return the result of performing [=coerce a JavaScript return=] on |resultTypes| and |awaitResult|. | ||
| 1. Otherwise, return the result of performing [=coerce a JavaScript return=] on |resultTypes| and |ret|. |
There was a problem hiding this comment.
Both of these pass args in the reverse order the op expects.
| 1. Let |suspendingProto| be \[[%WebAssembly.Suspending.prototype%]]. | ||
| 1. Let |susp| be the result of [$OrdinaryObjectCreate$](|suspendingProto|,«\[[WrappedFunction]]»). | ||
| 1. Set |susp|.\[[WrappedFunction]] to |jsFun|. | ||
| 1. Return |susp|. |
There was a problem hiding this comment.
WebIDL will automatically create an object for us that is wired up with the correct prototype (and other slots such as the internal platform object brand). The other WebIDL constructors in this spec just initialize the slots on the this object.
| 1. Let [|parameters|] → [|results|] be |functype|. | ||
| 1. If any type in |parameters| or |results| [=matches/valtype|matches=] [=v128=] or [=exnref=], throw a {{TypeError}}. | ||
|
|
||
| 1. If |parameters| or |results| contain [=v128=] or [=exnref=], throw a {{TypeError}}. | ||
| Note: the above error is thrown each time the \[[Call]] method is invoked. |
There was a problem hiding this comment.
Did you mean to delete this?
Updated links in macros.def to use placeholders.
Removed links for evaluation_suspend and evaluation_resume.
Updated rejection handling for promises to include value extraction.
Clarify that [$Await$] is only invoked when |func| returns a Promise.
Co-authored-by: Ryan Hunt <rhunt@eqrion.net>
PR that represents merging of JSPI into main spec.