From d449f45dc06923537ae09d362cfca113e871f078 Mon Sep 17 00:00:00 2001 From: rossberg-chromium Date: Fri, 5 Aug 2016 11:20:10 +0200 Subject: [PATCH] Remove arities from call/return --- BinaryEncoding.md | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/BinaryEncoding.md b/BinaryEncoding.md index 37df54b6..0f9739b5 100644 --- a/BinaryEncoding.md +++ b/BinaryEncoding.md @@ -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: @@ -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 | ## Memory-related operators ([described here](AstSemantics.md#linear-memory-accesses))