Skip to content

Commit

Permalink
Add new tail-call WASM features (mdn#31040)
Browse files Browse the repository at this point in the history
  • Loading branch information
pepelsbey authored Dec 19, 2023
1 parent 496ddf3 commit dfdfd2d
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions files/en-us/webassembly/reference/control_flow/call/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ page-type: webassembly-instruction

{{WebAssemblySidebar}}

**`call`** calls a function. `call_indirect` calls a function in a table.
**`call`** calls a function, `return_call` being the tail-call version of it. `call_indirect` calls a function in a table with the `return_call_indirect` tail-call version as well.

{{EmbedInteractiveExample("pages/wat/call.html", "tabbed-standard")}}

Expand All @@ -16,7 +16,14 @@ page-type: webassembly-instruction
call $greet
```

| Instruction | Binary opcode |
| --------------- | ------------- |
| `call` | `0x10` |
| `call_indirect` | `0x11` |
| Instruction | Binary opcode |
| ---------------------- | ------------- |
| `call` | `0x10` |
| `call_indirect` | `0x11` |
| `return_call` | `0x12` |
| `return_call_indirect` | `0x13` |

## See also

- [Tail Call Extension proposal overview](https://github.com/WebAssembly/tail-call/blob/main/proposals/tail-call/Overview.md)
- [V8 on WebAssembly tail calls support](https://v8.dev/blog/wasm-tail-call)

0 comments on commit dfdfd2d

Please sign in to comment.