From 5c49b34d3562ec32228177fb71f17a85e583a60b Mon Sep 17 00:00:00 2001 From: Douglas Crosher Date: Sun, 28 Feb 2016 12:30:37 +1100 Subject: Document the magic number and version. As implemented in https://codereview.chromium.org/1740373002/ --- BinaryEncoding.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'BinaryEncoding.md') diff --git a/BinaryEncoding.md b/BinaryEncoding.md index b6e3a6b..33ca33d 100644 --- a/BinaryEncoding.md +++ b/BinaryEncoding.md @@ -73,7 +73,15 @@ Strings referenced by the module (i.e. function names) are encoded as null-termi The following documents the current prototype format. This format is based on and supersedes the v8-native prototype format, originally in a [public design doc](https://docs.google.com/document/d/1-G11CnMA0My20KI9D7dBR6ZCPOBCRD0oCH6SHCPFGx0/edit?usp=sharing). ## High-level structure -A module contains a sequence of sections. Sections can in general be repeated, but some can occur only once or have dependant sections that must preceed them but not immediately as unknown sections can occur in any order. Each section is identified by an immediate string. Sections whose identity is unknown to the WebAssembly implementation are ignored and this is supported by including the size in bytes for all sections. The encoding of all sections begins as follows: + +The module starts with a magic number and version as follows. + +| Field | Type | Description | +| ----- | ----- | ----- | +| magic number | `uint32 0x6d736100` | Magic number '\0asm' | +| version | `uint32 0xa` | Version 10 | + +This is followed by a sequence of sections. Sections can in general be repeated, but some can occur only once or have dependant sections that must preceed them but not immediately as unknown sections can occur in any order. Each section is identified by an immediate string. Sections whose identity is unknown to the WebAssembly implementation are ignored and this is supported by including the size in bytes for all sections. The encoding of all sections begins as follows: | Field | Type | Description | | ----- | ----- | ----- | -- cgit v1.2.3 From 14952154322a6508cfc2a8eb1942df9a117d8e0e Mon Sep 17 00:00:00 2001 From: Douglas Crosher Date: Sun, 28 Feb 2016 16:13:08 +1100 Subject: Note that the version number will be reset to 1 for MVP. --- BinaryEncoding.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'BinaryEncoding.md') diff --git a/BinaryEncoding.md b/BinaryEncoding.md index 33ca33d..acf874b 100644 --- a/BinaryEncoding.md +++ b/BinaryEncoding.md @@ -79,7 +79,7 @@ The module starts with a magic number and version as follows. | Field | Type | Description | | ----- | ----- | ----- | | magic number | `uint32 0x6d736100` | Magic number '\0asm' | -| version | `uint32 0xa` | Version 10 | +| version | `uint32` | Version number, currently 10. The version for MVP will be reset to 1. | This is followed by a sequence of sections. Sections can in general be repeated, but some can occur only once or have dependant sections that must preceed them but not immediately as unknown sections can occur in any order. Each section is identified by an immediate string. Sections whose identity is unknown to the WebAssembly implementation are ignored and this is supported by including the size in bytes for all sections. The encoding of all sections begins as follows: -- cgit v1.2.3