From f638520afb6c669442caa7d788bbcdbef300edf8 Mon Sep 17 00:00:00 2001 From: Michael Holman Date: Mon, 29 Jun 2015 13:50:38 -0700 Subject: some cleanup --- BinaryEncoding.md | 50 +++++++++++++++++++++++++++----------------------- 1 file changed, 27 insertions(+), 23 deletions(-) (limited to 'BinaryEncoding.md') diff --git a/BinaryEncoding.md b/BinaryEncoding.md index 557664e..61fb019 100644 --- a/BinaryEncoding.md +++ b/BinaryEncoding.md @@ -65,32 +65,36 @@ Yes: ## Global structure -* A module contains: - * a header followed by - * a table (sorted by offset) containing, for each section, its type and - offset (within the module), followed by - * a sequence of sections. +* A module contains (in this order): + * A header + * A table (sorted by offset) containing, for each section: + * Section type + * Offset within the module + * A sequence of sections * A section contains: - * a header followed by - * the section contents (specific to the section type) -* A definitions section contains: - * the generic section header - * a table containing, for each opcode-space, a standardized string literal - type name (where index defines its type), offset (within the section), - sorted by offset, followed by - * a sequence of opcode tables + * A header followed by + * The section contents (specific to the section type) +* A definitions section contains (in this order): + * The generic section header + * A table (sorted by offset) containing, for each type which has opcodes: + * A standardized string literal [type name](AstSemantics.md#local-and-memory-types). + The index of a type name in this table is referred to as a type ID + * Offset of its opcode table within the section + * A sequence of opcode tables * An opcode table contains: - * a sequence of standardized string literal opcode names, where order - determines opcode index -* A code section contains: - * the generic section header - * a table containing, for each function, its signature, offset (within the - section), sorted by offset, followed by - * a sequence of functions + * A sequence of standardized string literal [opcode names](AstSemantics.md), + where order determines opcode index +* A code section contains (in this order): + * The generic section header + * A table (sorted by offset) containing, for each function: + * Signature + * Offset within the section + * A sequence of functions * A function contains: - * a table containing, for each type, how many locals are indexed by the - function body of that type - * the serialized AST + * A table containing, for each type ID that has [locals](AstSemantics.md#addressing-local-variables): + * Type ID + * Count of locals + * The serialized AST ## Serialized AST -- cgit v1.2.3