aboutsummaryrefslogtreecommitdiff
path: root/BinaryEncoding.md
diff options
context:
space:
mode:
authorrossberg-chromium <rossberg@chromium.org>2016-03-01 12:12:41 +0100
committerrossberg-chromium <rossberg@chromium.org>2016-03-01 12:12:41 +0100
commit88d3303877586d2fd8d7a41415ea4e05e1961820 (patch)
treeb913107e515a80e7ab2486d69c4aa884f7a43095 /BinaryEncoding.md
parentc8137d9a6bdefd015f5daadd3f0eb233dc6996b6 (diff)
parent19b7cf90f07ad23a0261f775f301febab753edfa (diff)
downloadnanowasm-design-88d3303877586d2fd8d7a41415ea4e05e1961820.tar.gz
Merge pull request #546 from WebAssembly/locals
Binary: Condense format of local declarations
Diffstat (limited to 'BinaryEncoding.md')
-rw-r--r--BinaryEncoding.md16
1 files changed, 12 insertions, 4 deletions
diff --git a/BinaryEncoding.md b/BinaryEncoding.md
index acf874b..1c3c5df 100644
--- a/BinaryEncoding.md
+++ b/BinaryEncoding.md
@@ -162,13 +162,21 @@ must contain a function body. Imported and exported functions must have a name.
| flags | `uint8` | always | flags indicating attributes of a function <br>bit `0` : a name is present<br>bit `1` : the function is an import<br>bit `2` : the function has local variables<br>bit `3` : the function is an export |
| signature | `uint16` | always | index into the Signature section |
| name | `uint32` | `flags[0] == 1` | name of the function as an offset within the module |
-| i32 count | `uint16` | `flags[2] == 1` | number of `i32` local variables |
-| i64 count | `uint16` | `flags[2] == 1` | number of `i64` local variables |
-| f32 count | `uint16` | `flags[2] == 1` | number of `f32` local variables |
-| f64 count | `uint16` | `flags[2] == 1` | number of `f64` local variables |
+| local count | `varuint32` | always | number of local entries |
+| locals | `local_entry*` | always | local variables |
| body size | `uint16` | `flags[0] == 0` | size of function body to follow, in bytes |
| body | `bytes` | `flags[0] == 0` | function body |
+#### Local Entry
+
+Each local entry declares a number of local variables of a given type.
+It is legal to have several entries with the same type.
+
+| Field | Type | Description |
+| ----- | ----- | ----- |
+| count | `varuint32` | number of local variables of the following type |
+| type | `value_type` | type of the variables |
+
### Export Table section
ID: `export_table`