Skip to content

Refine and extend tests for function signatures #301

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 25, 2016
Merged

Refine and extend tests for function signatures #301

merged 2 commits into from
Jul 25, 2016

Conversation

rossberg
Copy link
Member

  • Extend call_indirect test to check that signature is nominal.
  • Avoid use of implicit signatures in call_indirect.wast tests.
  • Add tests to func.wast to verify correct implicit signature desugaring.

rossberg referenced this pull request Jun 27, 2016
@kripken
Copy link
Member

kripken commented Jun 27, 2016

It seems rather odd and surprising to "reuse" function signatures in this way. Why not just create a new signature when one is not specified? In practice this will just matter for small tests anyhow.

@rossberg
Copy link
Member Author

I'd be fine with changing it, although that would create rather pathological type sections with lots of redundancy. Deferring to @lukewagner, since he implemented this.

@lukewagner
Copy link
Member

lukewagner commented Jun 29, 2016

Incidentally, design/#682 just changed AstSemantics.md#calls to have structural equality of function signatures (motivated by dynamic linking which would otherwise need some first-class notion of type that had to be imported/exported so it could be nominally equal). There is not special case for "nominal when intra-module, structural when inter-module", so I think we should spec and test the opposite of what's in this PR.

@rossberg
Copy link
Member Author

PTAL. Removed the checks for nominal type tests, now superseded by #314.

@kripken
Copy link
Member

kripken commented Jul 22, 2016

Looks like this PR still adds tests that "reuse" function signatures implicitly, which as discussed above seems rather confusing. In the discussion above I don't see any objections to not doing that?

@kripken
Copy link
Member

kripken commented Jul 22, 2016

To be more clear, what I'm proposing is to not merge the changes left in this PR.

And #314 changes checks to be structural which is great.

@rossberg
Copy link
Member Author

Well, we should have tests for the desugaring, and we need to agree what the desugaring is.

With call_indirect checks becoming structural I think the current desugaring actually has no longer any draw-backs, but some pros: it avoids artificially blowing up the type section and produces exactly the code that you'd otherwise produce manually.

@kripken
Copy link
Member

kripken commented Jul 22, 2016

Ok, fair enough.

@kripken
Copy link
Member

kripken commented Jul 22, 2016

(lgtm)

@rossberg rossberg merged commit 06588e1 into master Jul 25, 2016
@rossberg rossberg deleted the func-sig branch July 25, 2016 07:23
ngzhian added a commit to ngzhian/spec that referenced this pull request Nov 4, 2021
dhil pushed a commit to dhil/webassembly-spec that referenced this pull request Oct 3, 2023
rossberg pushed a commit that referenced this pull request Jul 23, 2024
This change updates exception object allocation, initialization, and construction for exnref;
as well as dealing with exception propagation from invoking exported functions; throwing
exceptions from host functions into wasm; and wrapping and unwrapping JS exceptions as they
propagate into and out of wasm.
rossberg pushed a commit that referenced this pull request Jul 23, 2024
As discussed in #202

The JS tag was added to the JS API spec in #301, but it is not observable. This change
exposes it on the WebAssembly namespace, allowing it to be imported into wasm modules.
This allows wasm modules to explicitly extract the thrown JS objects as externrefs from the
caught exrefs, and also to throw fresh exceptions with externref payloads that will propagate 
into JS and can be caught as bare JS objects not wrapped in a WebAssembly.Exception.

It also places the restriction that WebAssembly.Exception objects cannot be created with
the JS tag, because it would result in ambiguity or asymmetry when such objects unwind
from JS into wasm and back out.
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.

4 participants