Skip to content
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

Add new tail-call WASM features #31040

Merged
merged 3 commits into from
Dec 19, 2023
Merged

Add new tail-call WASM features #31040

merged 3 commits into from
Dec 19, 2023

Conversation

pepelsbey
Copy link
Member

Description

  • Adds two new tail-call versions of the call function: return_call and return_call_indirect.
  • Mentions two sources of information on the WASM tail call functions.

Motivation

To support enabled tail calls in Firefox 121.

Related issues and pull requests

@pepelsbey pepelsbey requested a review from a team as a code owner December 15, 2023 16:10
@pepelsbey pepelsbey requested review from zfox23 and removed request for a team December 15, 2023 16:10
@pepelsbey
Copy link
Member Author

@eqrion could you please have a look?

@pepelsbey pepelsbey changed the title Init Add new tail-call WASM features Dec 15, 2023
Copy link
Contributor

github-actions bot commented Dec 15, 2023

Preview URLs

External URLs (2)

URL: /en-US/docs/WebAssembly/Reference/Control_flow/call
Title: call

(comment last updated: 2023-12-19 09:57:13)

@yurydelendik
Copy link

The specification also adds return_call_ref instruction. This instruction added to complement call_ref, and was part of the function references / GC specification as well (which are landed before tail calls). See https://github.com/WebAssembly/function-references/blob/main/proposals/function-references/Overview.md

@pepelsbey
Copy link
Member Author

@yurydelendik the question is the browser support, we don’t document spec-only features, only the ones that are implemented in browsers. Do you know anything about it?

@yurydelendik
Copy link

@yurydelendik the question is the browser support, we don’t document spec-only features, only the ones that are implemented in browsers. Do you know anything about it?

Firefox implements function references and GC proposal in version 120, and tail calls proposal in 121. (Chrome implemented them in other order)

@yurydelendik
Copy link

See also https://webassembly.org/roadmap/

@pepelsbey
Copy link
Member Author

Firefox implements function references and GC proposal in version 120, and tail calls proposal in 121

Yes! That’s the reason we’re updating the docs. But is it just return_call and return_call_indirect or return_call_ref is also implemented in Chrome and Firefox? I don’t see V8 mentioning it in the blog post.

@yurydelendik
Copy link

I don’t see V8 mentioning it in the blog post.

The V8 implemented it with Wasm GC proposal since they released tail calls long ago -- the return_call_ref is part of both proposals (GC and tail calls).

@pepelsbey
Copy link
Member Author

Right, so the return_call_ref instruction is not part of the tail-call proposal, but GC one. Did I get it right? If so, I’ll file another issue to document return_call_ref on the same page.

@yurydelendik
Copy link

yurydelendik commented Dec 18, 2023

If so, I’ll file another issue to document return_call_ref on the same page.

That's fine. This detail is not really important since it was discussed internally in the Wasm WG meetings. return_call_ref can be documented with any proposals.

@bsmth bsmth self-requested a review December 19, 2023 09:56
Copy link
Member

@bsmth bsmth left a comment

Choose a reason for hiding this comment

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

Thank you!

@pepelsbey pepelsbey merged commit dfdfd2d into mdn:main Dec 19, 2023
7 checks passed
@pepelsbey pepelsbey deleted the wasm-tail branch December 19, 2023 11:12
dipikabh pushed a commit to dipikabh/content that referenced this pull request Jan 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:wasm WebAssembly docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants