Skip to content

Commit

Permalink
Remove arities from call/return (#748)
Browse files Browse the repository at this point in the history
  • Loading branch information
rossberg committed Aug 16, 2016
1 parent 99d098e commit 4c3cf81
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions BinaryEncoding.md
Expand Up @@ -444,17 +444,15 @@ It is legal to have several entries with the same type.
| `if` | `0x03` | | begin if expression |
| `else` | `0x04` | | begin else expression of if |
| `select` | `0x05` | | select one of two values based on condition |
| `br` | `0x06` | argument_count : `varuint1`, relative_depth : `varuint32` | break that targets an outer nested block |
| `br_if` | `0x07` | argument_count : `varuint1`, relative_depth : `varuint32` | conditional break that targets an outer nested block |
| `br` | `0x06` | arity : `varuint1`, relative_depth : `varuint32` | break that targets an outer nested block |
| `br_if` | `0x07` | arity : `varuint1`, relative_depth : `varuint32` | conditional break that targets an outer nested block |
| `br_table` | `0x08` | see below | branch table control flow construct |
| `return` | `0x09` | argument_count : `varuint1` | return zero or one value from this function |
| `return` | `0x09` | return zero or one value from this function |
| `drop` | `0x0b` | | ignore value |
| `nop` | `0x0a` | | no operation |
| `end` | `0x0f` | | end a block, loop, or if |

Note that there is no explicit `if_else` opcode, as the else clause is encoded with the `else` bytecode.

The counts following the break and return operators specify how many preceding operands are taken as transfer arguments; in the MVP, all these values must be either 0 or 1.
The counts following the break operators specify how many operands are taken as transfer arguments; in the MVP, all these values must be either 0 or 1.

The `br_table` operator has an immediate operand which is encoded as follows:

Expand Down Expand Up @@ -483,10 +481,8 @@ out of range, `br_table` branches to the default target.
| `tee_local` | `0x19` | local_index : `varuint32` | write a local variable or parameter and return the same value |
| `get_global` | `0xbb` | global_index : `varuint32` | read a global variable |
| `set_global` | `0xbc` | global_index : `varuint32` | write a global variable |
| `call` | `0x16` | argument_count : `varuint1`, function_index : `varuint32` | call a function by its [index](Modules.md#function-index-space) |
| `call_indirect` | `0x17` | argument_count : `varuint1`, type_index : `varuint32` | call a function indirect with an expected signature |

The counts following the different call opcodes specify the number of preceding operands taken as arguments.
| `call` | `0x16` | function_index : `varuint32` | call a function by its [index](Modules.md#function-index-space) |
| `call_indirect` | `0x17` | type_index : `varuint32` | call a function indirect with an expected signature |

The `call_indirect` operator takes a list of function arguments and as the last operand the index into the table.

Expand Down

0 comments on commit 4c3cf81

Please sign in to comment.