Skip to content

Rename Response based compile + instantiate *Streaming. - #1068

Merged
flagxor merged 1 commit into
WebAssembly:masterfrom
flagxor:streaming
May 18, 2017
Merged

flagxor merged 1 commit into
WebAssembly:masterfrom
flagxor:streaming

Conversation

@flagxor

@flagxor flagxor commented May 18, 2017

Copy link
Copy Markdown
Member

No description provided.

@lukewagner lukewagner left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@lukewagner

Copy link
Copy Markdown
Member

Oh right, we also need to (in this PR or another) address @domenic's root issue in #1040 which is that (compile|instantiate)Streaming should not be defined as having two overloads but rather taking some argument v and unconditionally Promise.resolve(v) and then throwing if the resolved value isn't a Response.

@flagxor
flagxor force-pushed the streaming branch 2 times, most recently from 597f1f2 to c1d3317 Compare May 18, 2017 18:09
@flagxor

flagxor commented May 18, 2017

Copy link
Copy Markdown
Member Author

PTAL

Revised to address @domenic 's concern + using the syntax suggested by TAG.

@domenic domenic left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple nits, but this does take care of the major issues, wooho!

Comment thread JS.md
with a [`TypeError`](https://tc39.github.io/ecma262/#sec-native-error-types-used-in-this-standard-typeerror).

```
Promise<{module:WebAssembly.Module, instance:WebAssembly.Instance}>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, I guess the TAG suggested this change? I'm not sure it makes things clearer, given that you haven't switched wholesale to Web IDL (yet?), so it's just halfway between.

Probably WebAssembly.Module/Instance below, at the very least?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Comment thread Web.md Outdated

Developers can set the argument `source` with either a promise that resolves
with a
`source` is unconditionally passed through `Promise.resolve(source)`.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You'll want to add "using the built-in value of Promise.resolve" just so that nobody thinks that monkeypatching Promise.resolve = function () { } should affect this implementation.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@mtrofin

mtrofin commented May 18, 2017

Copy link
Copy Markdown
Contributor

How about "{compile|instantiate}Stream" rather than "..Streaming"?

"Streaming" suggests implementation detail, which may not be what necessarily happens. For example, if the engine doesn't AOT but only lazily JIT, "compileStreaming" would be incorrect.

"Stream", on the other hand, refers to the parameter, and is factually true regardless of the implementation.

@flagxor

flagxor commented May 18, 2017

Copy link
Copy Markdown
Member Author

Can folks please chime in on if we like compileStream + instantiateStream better.
(I think I like it)

@domenic

domenic commented May 18, 2017

Copy link
Copy Markdown
Member

"Stream", on the other hand, refers to the parameter, and is factually true regardless of the implementation.

Unfortunately it is not true. A Response is not a Stream. It contains a ReadableStream as its body in some implementations (eventually all).

But even if it were a Stream, we don't generally add the type name of arguments to the name of methods. E.g. we don't have compileBufferSource.

@flagxor

flagxor commented May 18, 2017

Copy link
Copy Markdown
Member Author

Dominic makes a good point on the name. Leaving that as is.

Clarify how the source parameter is resolved.
Clarify how the result of instantiate* is described.
@flagxor
flagxor merged commit 89cfa62 into WebAssembly:master May 18, 2017
kisg pushed a commit to paul99/v8mips that referenced this pull request May 19, 2017
As per spec, (WebAssembly/design#1068), we
don't have compile/instantiate overloads anymore, instead, we
have explicitly named members.

This change introduces the new APIs, implements instantiateStreaming
based on compileStreaming, and uses the existing embedder mechanism.
It does not yet remove the functionality from compile/instantiate -
we do that after we adopt the new APIs on the blink side.

Also, it temporarily handles exceptions on the v8 side, which is also
something we'll move to the blink side.

Bug: 
Change-Id: I77673b1c0d395dfcf13b2f25464fd5dfd99c8d82
Reviewed-on: https://chromium-review.googlesource.com/508852
Commit-Queue: Brad Nelson <[email protected]>
Reviewed-by: Brad Nelson <[email protected]>
Cr-Commit-Position: refs/heads/master@{#45411}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants