aboutsummaryrefslogtreecommitdiff
path: root/BinaryEncoding.md
diff options
context:
space:
mode:
authorLuke Wagner <luke@mozilla.com>2016-03-07 11:41:24 -0600
committerLuke Wagner <luke@mozilla.com>2016-03-07 11:41:24 -0600
commitbbc5df6284c8f6230e320c2afd387ea9054e28cc (patch)
tree3a6785d274b477fb956b8bbe78311959951e4d3d /BinaryEncoding.md
parentf09513b37079553854bfce83155d2add3bef4a14 (diff)
downloadnanowasm-design-bbc5df6284c8f6230e320c2afd387ea9054e28cc.tar.gz
Store strings inline in the import/export entries
Diffstat (limited to 'BinaryEncoding.md')
-rw-r--r--BinaryEncoding.md13
1 files changed, 6 insertions, 7 deletions
diff --git a/BinaryEncoding.md b/BinaryEncoding.md
index 09e65f5..0aac532 100644
--- a/BinaryEncoding.md
+++ b/BinaryEncoding.md
@@ -71,9 +71,6 @@ sequence, then followed recursively by any child nodes.
* Then write the (variable-length) integer `callee_index` (varuint32)
* Then recursively write each argument node, where arity is determined by looking up `callee_index` in a table of signatures
-### Strings
-Strings referenced by the module (i.e. function names) are encoded as null-terminated [UTF8](http://unicode.org/faq/utf_bom.html#UTF8).
-
# Module structure
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).
@@ -143,9 +140,10 @@ A module may contain at most one import table section.
| Field | Type | Description |
| ----- | ----- | ----- |
| sig_index | `uint16` | signature index of the import |
-| module_name | `uint32` | offset from the start of the module of the string representing the module name |
-| func_name | `uint32` | offset from the start of the module of the string representing the function name |
-
+| module_len | `varuint32` | module string length |
+| module_str | `bytes` | module string of `module_len` bytes |
+| function_len | `varuint32` | function string length |
+| function_str | `bytes` | function string of `function_len` bytes |
### Functions section
@@ -188,7 +186,8 @@ This section must be preceded by a [Functions](#functions-section) section.
| ----- | ----- | ----- |
| sig_index | `uint16` | signature index of the export |
| func_index | `uint16` | index into the function table |
-| func_name | `uint32` | offset from the start of the module of the string representing the export name |
+| function_len | `varuint32` | function string length |
+| function_str | `bytes` | function string of `function_len` bytes |
### Start Function section