summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/dump/basic.txt141
-rw-r--r--test/dump/binary.txt369
-rw-r--r--test/dump/block-257-exprs-br.txt143
-rw-r--r--test/dump/block-257-exprs.txt134
-rw-r--r--test/dump/block.txt95
-rw-r--r--test/dump/br-block-named.txt96
-rw-r--r--test/dump/br-block.txt112
-rw-r--r--test/dump/br-loop-inner-expr.txt101
-rw-r--r--test/dump/br-loop-inner.txt93
-rw-r--r--test/dump/br-loop.txt79
-rw-r--r--test/dump/brif-loop.txt76
-rw-r--r--test/dump/brif.txt76
-rw-r--r--test/dump/brtable-empty.txt78
-rw-r--r--test/dump/brtable.txt111
-rw-r--r--test/dump/call.txt72
-rw-r--r--test/dump/callimport.txt117
-rw-r--r--test/dump/callindirect-after-import.txt141
-rw-r--r--test/dump/callindirect.txt92
-rw-r--r--test/dump/cast.txt88
-rw-r--r--test/dump/compare.txt356
-rw-r--r--test/dump/const.txt248
-rw-r--r--test/dump/convert.txt119
-rw-r--r--test/dump/debug-names-no-remap.txt157
-rw-r--r--test/dump/debug-names.txt157
-rw-r--r--test/dump/dedupe-sig.txt93
-rw-r--r--test/dump/export-multi.txt90
-rw-r--r--test/dump/expr-br.txt75
-rw-r--r--test/dump/expr-brif.txt84
-rw-r--r--test/dump/func-exported.txt82
-rw-r--r--test/dump/func-multi.txt78
-rw-r--r--test/dump/func-named.txt62
-rw-r--r--test/dump/getlocal-param.txt104
-rw-r--r--test/dump/getlocal.txt112
-rw-r--r--test/dump/grow-memory.txt84
-rw-r--r--test/dump/hexfloat_f32.txt140
-rw-r--r--test/dump/hexfloat_f64.txt153
-rw-r--r--test/dump/if-then-else-list.txt92
-rw-r--r--test/dump/if-then-list.txt75
-rw-r--r--test/dump/if.txt110
-rw-r--r--test/dump/import.txt81
-rw-r--r--test/dump/load-aligned.txt273
-rw-r--r--test/dump/load.txt172
-rw-r--r--test/dump/locals.txt78
-rw-r--r--test/dump/loop-257-exprs-br.txt152
-rw-r--r--test/dump/loop-257-exprs.txt134
-rw-r--r--test/dump/loop.txt70
-rw-r--r--test/dump/memory-1-byte.txt12
-rw-r--r--test/dump/memory-data-size.txt40
-rw-r--r--test/dump/memory-hex.txt34
-rw-r--r--test/dump/memory-size.txt80
-rw-r--r--test/dump/memory.txt41
-rw-r--r--test/dump/no-canonicalize.txt216
-rw-r--r--test/dump/no-remap-locals.txt125
-rw-r--r--test/dump/nop.txt64
-rw-r--r--test/dump/param-multi.txt70
-rw-r--r--test/dump/result.txt129
-rw-r--r--test/dump/return.txt87
-rw-r--r--test/dump/select.txt124
-rw-r--r--test/dump/setlocal-param.txt130
-rw-r--r--test/dump/setlocal.txt149
-rw-r--r--test/dump/signatures.txt95
-rw-r--r--test/dump/store-aligned.txt466
-rw-r--r--test/dump/store.txt196
-rw-r--r--test/dump/string-escape.txt90
-rw-r--r--test/dump/string-hex.txt82
-rw-r--r--test/dump/table.txt127
-rw-r--r--test/dump/unary.txt124
-rw-r--r--test/dump/unreachable.txt64
68 files changed, 4070 insertions, 4120 deletions
diff --git a/test/dump/basic.txt b/test/dump/basic.txt
index 77411482..2ed93bf1 100644
--- a/test/dump/basic.txt
+++ b/test/dump/basic.txt
@@ -7,78 +7,77 @@
(export "f" $f))
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
-0000004: 0a00 0000 ; WASM_BINARY_VERSION
-; section "signatures"
-0000008: 00 ; section size (guess)
-0000009: 0a ; string length
-000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
-0000014: 01 ; num signatures
-; signature 0
-0000015: 02 ; num params
-0000016: 01 ; result_type
-0000017: 01 ; param type
-0000018: 01 ; param type
-0000008: 10 ; FIXUP section size
-; section "function_signatures"
-0000019: 00 ; section size (guess)
-000001a: 13 ; string length
-000001b: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
-000002b: 7265 73 ; section id: "function_signatures"
-000002e: 01 ; num functions
-000002f: 00 ; function 0 signature index
-0000019: 16 ; FIXUP section size
+0000004: 0b00 0000 ; WASM_BINARY_VERSION
+; section "type"
+0000008: 04 ; string length
+0000009: 7479 7065 ; section id: "type"
+000000d: 00 ; section size (guess)
+000000e: 01 ; num types
+; type 0
+000000f: 40 ; function form
+0000010: 02 ; num params
+0000011: 01 ; param type
+0000012: 01 ; param type
+0000013: 01 ; num results
+0000014: 01 ; result_type
+000000d: 07 ; FIXUP section size
+; section "function"
+0000015: 08 ; string length
+0000016: 6675 6e63 7469 6f6e ; section id: "function"
+000001e: 00 ; section size (guess)
+000001f: 01 ; num functions
+0000020: 00 ; function 0 signature index
+000001e: 02 ; FIXUP section size
; section "memory"
-0000030: 00 ; section size (guess)
-0000031: 06 ; string length
-0000032: 6d65 6d6f 7279 ; section id: "memory"
-0000038: 01 ; min mem pages
-0000039: 01 ; max mem pages
-000003a: 00 ; export mem
-0000030: 0a ; FIXUP section size
-; section "export_table"
-000003b: 00 ; section size (guess)
-000003c: 0c ; string length
-000003d: 6578 706f 7274 5f74 6162 6c65 ; section id: "export_table"
-0000049: 01 ; num exports
-000004a: 00 ; export func index
-000004b: 01 ; string length
-000004c: 66 f ; export name
-000003b: 11 ; FIXUP section size
-; section "function_bodies"
-000004d: 00 ; section size (guess)
-000004e: 0f ; string length
-000004f: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
-000005e: 01 ; num functions
+0000021: 06 ; string length
+0000022: 6d65 6d6f 7279 ; section id: "memory"
+0000028: 00 ; section size (guess)
+0000029: 01 ; min mem pages
+000002a: 01 ; max mem pages
+000002b: 00 ; export mem
+0000028: 03 ; FIXUP section size
+; section "export"
+000002c: 06 ; string length
+000002d: 6578 706f 7274 ; section id: "export"
+0000033: 00 ; section size (guess)
+0000034: 01 ; num exports
+0000035: 00 ; export func index
+0000036: 01 ; string length
+0000037: 66 f ; export name
+0000033: 04 ; FIXUP section size
+; section "code"
+0000038: 04 ; string length
+0000039: 636f 6465 ; section id: "code"
+000003d: 00 ; section size (guess)
+000003e: 01 ; num functions
; function body 0
-000005f: 00 ; func body size (guess)
-0000060: 00 ; local decl count
-0000061: 33 ; OPCODE_I32_STORE
-0000062: 02 ; alignment
-0000063: 00 ; store offset
-0000064: 0a ; OPCODE_I32_CONST
-0000065: 00 ; i32 literal
-0000066: 40 ; OPCODE_I32_ADD
-0000067: 2a ; OPCODE_I32_LOAD
-0000068: 02 ; alignment
-0000069: 00 ; load offset
-000006a: 0a ; OPCODE_I32_CONST
-000006b: 00 ; i32 literal
-000006c: 0a ; OPCODE_I32_CONST
-000006d: 01 ; i32 literal
-000006e: 40 ; OPCODE_I32_ADD
-000006f: 0e ; OPCODE_GET_LOCAL
-0000070: 00 ; remapped local index
-0000071: 0e ; OPCODE_GET_LOCAL
-0000072: 01 ; remapped local index
-000005f: 13 ; FIXUP func body size
-000004d: 25 ; FIXUP section size
+000003f: 00 ; func body size (guess)
+0000040: 00 ; local decl count
+0000041: 10 ; OPCODE_I32_CONST
+0000042: 00 ; i32 literal
+0000043: 10 ; OPCODE_I32_CONST
+0000044: 00 ; i32 literal
+0000045: 2a ; OPCODE_I32_LOAD
+0000046: 02 ; alignment
+0000047: 00 ; load offset
+0000048: 10 ; OPCODE_I32_CONST
+0000049: 01 ; i32 literal
+000004a: 40 ; OPCODE_I32_ADD
+000004b: 33 ; OPCODE_I32_STORE
+000004c: 02 ; alignment
+000004d: 00 ; store offset
+000004e: 14 ; OPCODE_GET_LOCAL
+000004f: 00 ; remapped local index
+0000050: 14 ; OPCODE_GET_LOCAL
+0000051: 01 ; remapped local index
+0000052: 40 ; OPCODE_I32_ADD
+000003f: 13 ; FIXUP func body size
+000003d: 15 ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 100a 7369 676e 6174
-0000010: 7572 6573 0102 0101 0116 1366 756e 6374
-0000020: 696f 6e5f 7369 676e 6174 7572 6573 0100
-0000030: 0a06 6d65 6d6f 7279 0101 0011 0c65 7870
-0000040: 6f72 745f 7461 626c 6501 0001 6625 0f66
-0000050: 756e 6374 696f 6e5f 626f 6469 6573 0113
-0000060: 0033 0200 0a00 402a 0200 0a00 0a01 400e
-0000070: 000e 01
+0000000: 0061 736d 0b00 0000 0474 7970 6507 0140
+0000010: 0201 0101 0108 6675 6e63 7469 6f6e 0201
+0000020: 0006 6d65 6d6f 7279 0301 0100 0665 7870
+0000030: 6f72 7404 0100 0166 0463 6f64 6515 0113
+0000040: 0010 0010 002a 0200 1001 4033 0200 1400
+0000050: 1401 40
;;; STDOUT ;;)
diff --git a/test/dump/binary.txt b/test/dump/binary.txt
index 4a24fd4a..602d842a 100644
--- a/test/dump/binary.txt
+++ b/test/dump/binary.txt
@@ -101,193 +101,192 @@
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
-0000004: 0a00 0000 ; WASM_BINARY_VERSION
-; section "signatures"
-0000008: 00 ; section size (guess)
-0000009: 0a ; string length
-000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
-0000014: 01 ; num signatures
-; signature 0
-0000015: 00 ; num params
-0000016: 00 ; result_type
-0000008: 0e ; FIXUP section size
-; section "function_signatures"
-0000017: 00 ; section size (guess)
-0000018: 13 ; string length
-0000019: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
-0000029: 7265 73 ; section id: "function_signatures"
-000002c: 01 ; num functions
-000002d: 00 ; function 0 signature index
-0000017: 16 ; FIXUP section size
-; section "function_bodies"
-000002e: 00 ; section size (guess)
-000002f: 0f ; string length
-0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
-000003f: 01 ; num functions
+0000004: 0b00 0000 ; WASM_BINARY_VERSION
+; section "type"
+0000008: 04 ; string length
+0000009: 7479 7065 ; section id: "type"
+000000d: 00 ; section size (guess)
+000000e: 01 ; num types
+; type 0
+000000f: 40 ; function form
+0000010: 00 ; num params
+0000011: 00 ; num results
+000000d: 04 ; FIXUP section size
+; section "function"
+0000012: 08 ; string length
+0000013: 6675 6e63 7469 6f6e ; section id: "function"
+000001b: 00 ; section size (guess)
+000001c: 01 ; num functions
+000001d: 00 ; function 0 signature index
+000001b: 02 ; FIXUP section size
+; section "code"
+000001e: 04 ; string length
+000001f: 636f 6465 ; section id: "code"
+0000023: 00 ; section size (guess)
+0000024: 01 ; num functions
; function body 0
-0000040: 00 ; func body size (guess)
-0000041: 00 ; local decl count
-0000042: 40 ; OPCODE_I32_ADD
-0000043: 41 ; OPCODE_I32_SUB
-0000044: 42 ; OPCODE_I32_MUL
-0000045: 43 ; OPCODE_I32_DIV_S
-0000046: 44 ; OPCODE_I32_DIV_U
-0000047: 45 ; OPCODE_I32_REM_S
-0000048: 46 ; OPCODE_I32_REM_U
-0000049: 47 ; OPCODE_I32_AND
-000004a: 48 ; OPCODE_I32_OR
-000004b: 49 ; OPCODE_I32_XOR
-000004c: 4a ; OPCODE_I32_SHL
-000004d: 4b ; OPCODE_I32_SHR_U
-000004e: 4c ; OPCODE_I32_SHR_S
-000004f: b7 ; OPCODE_I32_ROTL
-0000050: b6 ; OPCODE_I32_ROTR
-0000051: 0a ; OPCODE_I32_CONST
-0000052: 00 ; i32 literal
-0000053: 0a ; OPCODE_I32_CONST
+0000025: 00 ; func body size (guess)
+0000026: 00 ; local decl count
+0000027: 10 ; OPCODE_I32_CONST
+0000028: 00 ; i32 literal
+0000029: 10 ; OPCODE_I32_CONST
+000002a: 00 ; i32 literal
+000002b: b6 ; OPCODE_I32_ROTR
+000002c: 10 ; OPCODE_I32_CONST
+000002d: 00 ; i32 literal
+000002e: b7 ; OPCODE_I32_ROTL
+000002f: 10 ; OPCODE_I32_CONST
+0000030: 00 ; i32 literal
+0000031: 4c ; OPCODE_I32_SHR_S
+0000032: 10 ; OPCODE_I32_CONST
+0000033: 00 ; i32 literal
+0000034: 4b ; OPCODE_I32_SHR_U
+0000035: 10 ; OPCODE_I32_CONST
+0000036: 00 ; i32 literal
+0000037: 4a ; OPCODE_I32_SHL
+0000038: 10 ; OPCODE_I32_CONST
+0000039: 00 ; i32 literal
+000003a: 49 ; OPCODE_I32_XOR
+000003b: 10 ; OPCODE_I32_CONST
+000003c: 00 ; i32 literal
+000003d: 48 ; OPCODE_I32_OR
+000003e: 10 ; OPCODE_I32_CONST
+000003f: 00 ; i32 literal
+0000040: 47 ; OPCODE_I32_AND
+0000041: 10 ; OPCODE_I32_CONST
+0000042: 00 ; i32 literal
+0000043: 46 ; OPCODE_I32_REM_U
+0000044: 10 ; OPCODE_I32_CONST
+0000045: 00 ; i32 literal
+0000046: 45 ; OPCODE_I32_REM_S
+0000047: 10 ; OPCODE_I32_CONST
+0000048: 00 ; i32 literal
+0000049: 44 ; OPCODE_I32_DIV_U
+000004a: 10 ; OPCODE_I32_CONST
+000004b: 00 ; i32 literal
+000004c: 43 ; OPCODE_I32_DIV_S
+000004d: 10 ; OPCODE_I32_CONST
+000004e: 00 ; i32 literal
+000004f: 42 ; OPCODE_I32_MUL
+0000050: 10 ; OPCODE_I32_CONST
+0000051: 00 ; i32 literal
+0000052: 41 ; OPCODE_I32_SUB
+0000053: 10 ; OPCODE_I32_CONST
0000054: 00 ; i32 literal
-0000055: 0a ; OPCODE_I32_CONST
-0000056: 00 ; i32 literal
-0000057: 0a ; OPCODE_I32_CONST
-0000058: 00 ; i32 literal
-0000059: 0a ; OPCODE_I32_CONST
-000005a: 00 ; i32 literal
-000005b: 0a ; OPCODE_I32_CONST
-000005c: 00 ; i32 literal
-000005d: 0a ; OPCODE_I32_CONST
-000005e: 00 ; i32 literal
-000005f: 0a ; OPCODE_I32_CONST
-0000060: 00 ; i32 literal
-0000061: 0a ; OPCODE_I32_CONST
-0000062: 00 ; i32 literal
-0000063: 0a ; OPCODE_I32_CONST
-0000064: 00 ; i32 literal
-0000065: 0a ; OPCODE_I32_CONST
-0000066: 00 ; i32 literal
-0000067: 0a ; OPCODE_I32_CONST
-0000068: 00 ; i32 literal
-0000069: 0a ; OPCODE_I32_CONST
-000006a: 00 ; i32 literal
-000006b: 0a ; OPCODE_I32_CONST
-000006c: 00 ; i32 literal
-000006d: 0a ; OPCODE_I32_CONST
-000006e: 00 ; i32 literal
-000006f: 0a ; OPCODE_I32_CONST
-0000070: 00 ; i32 literal
-0000071: 5b ; OPCODE_I64_ADD
-0000072: 5c ; OPCODE_I64_SUB
-0000073: 5d ; OPCODE_I64_MUL
-0000074: 5e ; OPCODE_I64_DIV_S
-0000075: 5f ; OPCODE_I64_DIV_U
-0000076: 60 ; OPCODE_I64_REM_S
-0000077: 61 ; OPCODE_I64_REM_U
-0000078: 62 ; OPCODE_I64_AND
-0000079: 63 ; OPCODE_I64_OR
-000007a: 64 ; OPCODE_I64_XOR
-000007b: 65 ; OPCODE_I64_SHL
-000007c: 66 ; OPCODE_I64_SHR_U
-000007d: 67 ; OPCODE_I64_SHR_S
-000007e: b9 ; OPCODE_I64_ROTL
-000007f: b8 ; OPCODE_I64_ROTR
-0000080: 0b ; OPCODE_I64_CONST
-0000081: 00 ; i64 literal
-0000082: 0b ; OPCODE_I64_CONST
+0000055: 40 ; OPCODE_I32_ADD
+0000056: 11 ; OPCODE_I64_CONST
+0000057: 00 ; i64 literal
+0000058: 11 ; OPCODE_I64_CONST
+0000059: 00 ; i64 literal
+000005a: b8 ; OPCODE_I64_ROTR
+000005b: 11 ; OPCODE_I64_CONST
+000005c: 00 ; i64 literal
+000005d: b9 ; OPCODE_I64_ROTL
+000005e: 11 ; OPCODE_I64_CONST
+000005f: 00 ; i64 literal
+0000060: 67 ; OPCODE_I64_SHR_S
+0000061: 11 ; OPCODE_I64_CONST
+0000062: 00 ; i64 literal
+0000063: 66 ; OPCODE_I64_SHR_U
+0000064: 11 ; OPCODE_I64_CONST
+0000065: 00 ; i64 literal
+0000066: 65 ; OPCODE_I64_SHL
+0000067: 11 ; OPCODE_I64_CONST
+0000068: 00 ; i64 literal
+0000069: 64 ; OPCODE_I64_XOR
+000006a: 11 ; OPCODE_I64_CONST
+000006b: 00 ; i64 literal
+000006c: 63 ; OPCODE_I64_OR
+000006d: 11 ; OPCODE_I64_CONST
+000006e: 00 ; i64 literal
+000006f: 62 ; OPCODE_I64_AND
+0000070: 11 ; OPCODE_I64_CONST
+0000071: 00 ; i64 literal
+0000072: 61 ; OPCODE_I64_REM_U
+0000073: 11 ; OPCODE_I64_CONST
+0000074: 00 ; i64 literal
+0000075: 60 ; OPCODE_I64_REM_S
+0000076: 11 ; OPCODE_I64_CONST
+0000077: 00 ; i64 literal
+0000078: 5f ; OPCODE_I64_DIV_U
+0000079: 11 ; OPCODE_I64_CONST
+000007a: 00 ; i64 literal
+000007b: 5e ; OPCODE_I64_DIV_S
+000007c: 11 ; OPCODE_I64_CONST
+000007d: 00 ; i64 literal
+000007e: 5d ; OPCODE_I64_MUL
+000007f: 11 ; OPCODE_I64_CONST
+0000080: 00 ; i64 literal
+0000081: 5c ; OPCODE_I64_SUB
+0000082: 11 ; OPCODE_I64_CONST
0000083: 00 ; i64 literal
-0000084: 0b ; OPCODE_I64_CONST
-0000085: 00 ; i64 literal
-0000086: 0b ; OPCODE_I64_CONST
-0000087: 00 ; i64 literal
-0000088: 0b ; OPCODE_I64_CONST
-0000089: 00 ; i64 literal
-000008a: 0b ; OPCODE_I64_CONST
-000008b: 00 ; i64 literal
-000008c: 0b ; OPCODE_I64_CONST
-000008d: 00 ; i64 literal
-000008e: 0b ; OPCODE_I64_CONST
-000008f: 00 ; i64 literal
-0000090: 0b ; OPCODE_I64_CONST
-0000091: 00 ; i64 literal
-0000092: 0b ; OPCODE_I64_CONST
-0000093: 00 ; i64 literal
-0000094: 0b ; OPCODE_I64_CONST
-0000095: 00 ; i64 literal
-0000096: 0b ; OPCODE_I64_CONST
-0000097: 00 ; i64 literal
-0000098: 0b ; OPCODE_I64_CONST
-0000099: 00 ; i64 literal
-000009a: 0b ; OPCODE_I64_CONST
-000009b: 00 ; i64 literal
-000009c: 0b ; OPCODE_I64_CONST
-000009d: 00 ; i64 literal
-000009e: 0b ; OPCODE_I64_CONST
-000009f: 00 ; i64 literal
-00000a0: 75 ; OPCODE_F32_ADD
-00000a1: 76 ; OPCODE_F32_SUB
-00000a2: 77 ; OPCODE_F32_MUL
-00000a3: 78 ; OPCODE_F32_DIV
-00000a4: 79 ; OPCODE_F32_MIN
-00000a5: 7a ; OPCODE_F32_MAX
-00000a6: 7d ; OPCODE_F32_COPYSIGN
-00000a7: 0d ; OPCODE_F32_CONST
-00000a8: 0000 0000 ; f32 literal
-00000ac: 0d ; OPCODE_F32_CONST
-00000ad: 0000 0000 ; f32 literal
-00000b1: 0d ; OPCODE_F32_CONST
-00000b2: 0000 0000 ; f32 literal
-00000b6: 0d ; OPCODE_F32_CONST
-00000b7: 0000 0000 ; f32 literal
-00000bb: 0d ; OPCODE_F32_CONST
-00000bc: 0000 0000 ; f32 literal
-00000c0: 0d ; OPCODE_F32_CONST
-00000c1: 0000 0000 ; f32 literal
-00000c5: 0d ; OPCODE_F32_CONST
-00000c6: 0000 0000 ; f32 literal
-00000ca: 0d ; OPCODE_F32_CONST
-00000cb: 0000 0000 ; f32 literal
-00000cf: 89 ; OPCODE_F64_ADD
-00000d0: 8a ; OPCODE_F64_SUB
-00000d1: 8b ; OPCODE_F64_MUL
-00000d2: 8c ; OPCODE_F64_DIV
-00000d3: 8d ; OPCODE_F64_MIN
-00000d4: 8e ; OPCODE_F64_MAX
-00000d5: 91 ; OPCODE_F64_COPYSIGN
-00000d6: 0c ; OPCODE_F64_CONST
-00000d7: 0000 0000 0000 0000 ; f64 literal
-00000df: 0c ; OPCODE_F64_CONST
-00000e0: 0000 0000 0000 0000 ; f64 literal
-00000e8: 0c ; OPCODE_F64_CONST
-00000e9: 0000 0000 0000 0000 ; f64 literal
-00000f1: 0c ; OPCODE_F64_CONST
-00000f2: 0000 0000 0000 0000 ; f64 literal
-00000fa: 0c ; OPCODE_F64_CONST
-00000fb: 0000 0000 0000 0000 ; f64 literal
-0000103: 0c ; OPCODE_F64_CONST
-0000104: 0000 0000 0000 0000 ; f64 literal
-000010c: 0c ; OPCODE_F64_CONST
-000010d: 0000 0000 0000 0000 ; f64 literal
-0000115: 0c ; OPCODE_F64_CONST
-0000116: 0000 0000 0000 0000 ; f64 literal
-; move data: [41, 11e) -> [42, 11f)
-0000040: dd01 ; FIXUP func body size
-; move data: [2f, 11f) -> [30, 120)
-000002e: f001 ; FIXUP section size
+0000084: 5b ; OPCODE_I64_ADD
+0000085: 13 ; OPCODE_F32_CONST
+0000086: 0000 0000 ; f32 literal
+000008a: 13 ; OPCODE_F32_CONST
+000008b: 0000 0000 ; f32 literal
+000008f: 7d ; OPCODE_F32_COPYSIGN
+0000090: 13 ; OPCODE_F32_CONST
+0000091: 0000 0000 ; f32 literal
+0000095: 7a ; OPCODE_F32_MAX
+0000096: 13 ; OPCODE_F32_CONST
+0000097: 0000 0000 ; f32 literal
+000009b: 79 ; OPCODE_F32_MIN
+000009c: 13 ; OPCODE_F32_CONST
+000009d: 0000 0000 ; f32 literal
+00000a1: 78 ; OPCODE_F32_DIV
+00000a2: 13 ; OPCODE_F32_CONST
+00000a3: 0000 0000 ; f32 literal
+00000a7: 77 ; OPCODE_F32_MUL
+00000a8: 13 ; OPCODE_F32_CONST
+00000a9: 0000 0000 ; f32 literal
+00000ad: 76 ; OPCODE_F32_SUB
+00000ae: 13 ; OPCODE_F32_CONST
+00000af: 0000 0000 ; f32 literal
+00000b3: 75 ; OPCODE_F32_ADD
+00000b4: 12 ; OPCODE_F64_CONST
+00000b5: 0000 0000 0000 0000 ; f64 literal
+00000bd: 12 ; OPCODE_F64_CONST
+00000be: 0000 0000 0000 0000 ; f64 literal
+00000c6: 91 ; OPCODE_F64_COPYSIGN
+00000c7: 12 ; OPCODE_F64_CONST
+00000c8: 0000 0000 0000 0000 ; f64 literal
+00000d0: 8e ; OPCODE_F64_MAX
+00000d1: 12 ; OPCODE_F64_CONST
+00000d2: 0000 0000 0000 0000 ; f64 literal
+00000da: 8d ; OPCODE_F64_MIN
+00000db: 12 ; OPCODE_F64_CONST
+00000dc: 0000 0000 0000 0000 ; f64 literal
+00000e4: 8c ; OPCODE_F64_DIV
+00000e5: 12 ; OPCODE_F64_CONST
+00000e6: 0000 0000 0000 0000 ; f64 literal
+00000ee: 8b ; OPCODE_F64_MUL
+00000ef: 12 ; OPCODE_F64_CONST
+00000f0: 0000 0000 0000 0000 ; f64 literal
+00000f8: 8a ; OPCODE_F64_SUB
+00000f9: 12 ; OPCODE_F64_CONST
+00000fa: 0000 0000 0000 0000 ; f64 literal
+0000102: 89 ; OPCODE_F64_ADD
+; move data: [26, 103) -> [27, 104)
+0000025: dd01 ; FIXUP func body size
+; move data: [24, 104) -> [25, 105)
+0000023: e001 ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0e0a 7369 676e 6174
-0000010: 7572 6573 0100 0016 1366 756e 6374 696f
-0000020: 6e5f 7369 676e 6174 7572 6573 0100 f001
-0000030: 0f66 756e 6374 696f 6e5f 626f 6469 6573
-0000040: 01dd 0100 4041 4243 4445 4647 4849 4a4b
-0000050: 4cb7 b60a 000a 000a 000a 000a 000a 000a
-0000060: 000a 000a 000a 000a 000a 000a 000a 000a
-0000070: 000a 005b 5c5d 5e5f 6061 6263 6465 6667
-0000080: b9b8 0b00 0b00 0b00 0b00 0b00 0b00 0b00
-0000090: 0b00 0b00 0b00 0b00 0b00 0b00 0b00 0b00
-00000a0: 0b00 7576 7778 797a 7d0d 0000 0000 0d00
-00000b0: 0000 000d 0000 0000 0d00 0000 000d 0000
-00000c0: 0000 0d00 0000 000d 0000 0000 0d00 0000
-00000d0: 0089 8a8b 8c8d 8e91 0c00 0000 0000 0000
-00000e0: 000c 0000 0000 0000 0000 0c00 0000 0000
-00000f0: 0000 000c 0000 0000 0000 0000 0c00 0000
-0000100: 0000 0000 000c 0000 0000 0000 0000 0c00
-0000110: 0000 0000 0000 000c 0000 0000 0000 0000
+0000000: 0061 736d 0b00 0000 0474 7970 6504 0140
+0000010: 0000 0866 756e 6374 696f 6e02 0100 0463
+0000020: 6f64 65e0 0101 dd01 0010 0010 00b6 1000
+0000030: b710 004c 1000 4b10 004a 1000 4910 0048
+0000040: 1000 4710 0046 1000 4510 0044 1000 4310
+0000050: 0042 1000 4110 0040 1100 1100 b811 00b9
+0000060: 1100 6711 0066 1100 6511 0064 1100 6311
+0000070: 0062 1100 6111 0060 1100 5f11 005e 1100
+0000080: 5d11 005c 1100 5b13 0000 0000 1300 0000
+0000090: 007d 1300 0000 007a 1300 0000 0079 1300
+00000a0: 0000 0078 1300 0000 0077 1300 0000 0076
+00000b0: 1300 0000 0075 1200 0000 0000 0000 0012
+00000c0: 0000 0000 0000 0000 9112 0000 0000 0000
+00000d0: 0000 8e12 0000 0000 0000 0000 8d12 0000
+00000e0: 0000 0000 0000 8c12 0000 0000 0000 0000
+00000f0: 8b12 0000 0000 0000 0000 8a12 0000 0000
+0000100: 0000 0000 89
;;; STDOUT ;;)
diff --git a/test/dump/block-257-exprs-br.txt b/test/dump/block-257-exprs-br.txt
index 746520c2..337287e7 100644
--- a/test/dump/block-257-exprs-br.txt
+++ b/test/dump/block-257-exprs-br.txt
@@ -48,34 +48,62 @@
)))
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
-0000004: 0a00 0000 ; WASM_BINARY_VERSION
-; section "signatures"
-0000008: 00 ; section size (guess)
-0000009: 0a ; string length
-000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
-0000014: 01 ; num signatures
-; signature 0
-0000015: 00 ; num params
-0000016: 00 ; result_type
-0000008: 0e ; FIXUP section size
-; section "function_signatures"
-0000017: 00 ; section size (guess)
-0000018: 13 ; string length
-0000019: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
-0000029: 7265 73 ; section id: "function_signatures"
-000002c: 01 ; num functions
-000002d: 00 ; function 0 signature index
-0000017: 16 ; FIXUP section size
-; section "function_bodies"
-000002e: 00 ; section size (guess)
-000002f: 0f ; string length
-0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
-000003f: 01 ; num functions
+0000004: 0b00 0000 ; WASM_BINARY_VERSION
+; section "type"
+0000008: 04 ; string length
+0000009: 7479 7065 ; section id: "type"
+000000d: 00 ; section size (guess)
+000000e: 01 ; num types
+; type 0
+000000f: 40 ; function form
+0000010: 00 ; num params
+0000011: 00 ; num results
+000000d: 04 ; FIXUP section size
+; section "function"
+0000012: 08 ; string length
+0000013: 6675 6e63 7469 6f6e ; section id: "function"
+000001b: 00 ; section size (guess)
+000001c: 01 ; num functions
+000001d: 00 ; function 0 signature index
+000001b: 02 ; FIXUP section size
+; section "code"
+000001e: 04 ; string length
+000001f: 636f 6465 ; section id: "code"
+0000023: 00 ; section size (guess)
+0000024: 01 ; num functions
; function body 0
-0000040: 00 ; func body size (guess)
-0000041: 00 ; local decl count
-0000042: 01 ; OPCODE_BLOCK
-0000043: 8202 ; num expressions
+0000025: 00 ; func body size (guess)
+0000026: 00 ; local decl count
+0000027: 01 ; OPCODE_BLOCK
+0000028: 00 ; OPCODE_NOP
+0000029: 00 ; OPCODE_NOP
+000002a: 00 ; OPCODE_NOP
+000002b: 00 ; OPCODE_NOP
+000002c: 00 ; OPCODE_NOP
+000002d: 00 ; OPCODE_NOP
+000002e: 00 ; OPCODE_NOP
+000002f: 00 ; OPCODE_NOP
+0000030: 00 ; OPCODE_NOP
+0000031: 00 ; OPCODE_NOP
+0000032: 00 ; OPCODE_NOP
+0000033: 00 ; OPCODE_NOP
+0000034: 00 ; OPCODE_NOP
+0000035: 00 ; OPCODE_NOP
+0000036: 00 ; OPCODE_NOP
+0000037: 00 ; OPCODE_NOP
+0000038: 00 ; OPCODE_NOP
+0000039: 00 ; OPCODE_NOP
+000003a: 00 ; OPCODE_NOP
+000003b: 00 ; OPCODE_NOP
+000003c: 00 ; OPCODE_NOP
+000003d: 00 ; OPCODE_NOP
+000003e: 00 ; OPCODE_NOP
+000003f: 00 ; OPCODE_NOP
+0000040: 00 ; OPCODE_NOP
+0000041: 00 ; OPCODE_NOP
+0000042: 00 ; OPCODE_NOP
+0000043: 00 ; OPCODE_NOP
+0000044: 00 ; OPCODE_NOP
0000045: 00 ; OPCODE_NOP
0000046: 00 ; OPCODE_NOP
0000047: 00 ; OPCODE_NOP
@@ -304,50 +332,22 @@
0000126: 00 ; OPCODE_NOP
0000127: 00 ; OPCODE_NOP
0000128: 00 ; OPCODE_NOP
-0000129: 00 ; OPCODE_NOP
-000012a: 00 ; OPCODE_NOP
+0000129: 06 ; OPCODE_BR
+000012a: 00 ; break depth
000012b: 00 ; OPCODE_NOP
-000012c: 00 ; OPCODE_NOP
-000012d: 00 ; OPCODE_NOP
-000012e: 00 ; OPCODE_NOP
-000012f: 00 ; OPCODE_NOP
-0000130: 00 ; OPCODE_NOP
-0000131: 00 ; OPCODE_NOP
-0000132: 00 ; OPCODE_NOP
-0000133: 00 ; OPCODE_NOP
-0000134: 00 ; OPCODE_NOP
-0000135: 00 ; OPCODE_NOP
-0000136: 00 ; OPCODE_NOP
-0000137: 00 ; OPCODE_NOP
-0000138: 00 ; OPCODE_NOP
-0000139: 00 ; OPCODE_NOP
-000013a: 00 ; OPCODE_NOP
-000013b: 00 ; OPCODE_NOP
-000013c: 00 ; OPCODE_NOP
-000013d: 00 ; OPCODE_NOP
-000013e: 00 ; OPCODE_NOP
-000013f: 00 ; OPCODE_NOP
-0000140: 00 ; OPCODE_NOP
-0000141: 00 ; OPCODE_NOP
-0000142: 00 ; OPCODE_NOP
-0000143: 00 ; OPCODE_NOP
-0000144: 00 ; OPCODE_NOP
-0000145: 06 ; OPCODE_BR
-0000146: 00 ; break depth
-0000147: 00 ; OPCODE_NOP
-0000148: 06 ; OPCODE_BR
-0000149: 00 ; break depth
-000014a: 00 ; OPCODE_NOP
-; move data: [41, 14b) -> [42, 14c)
-0000040: 8a02 ; FIXUP func body size
-; move data: [2f, 14c) -> [30, 14d)
-000002e: 9d02 ; FIXUP section size
+000012c: 06 ; OPCODE_BR
+000012d: 00 ; break depth
+000012e: 0f ; OPCODE_END
+; move data: [26, 12f) -> [27, 130)
+0000025: 8902 ; FIXUP func body size
+; move data: [24, 130) -> [25, 131)
+0000023: 8c02 ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0e0a 7369 676e 6174
-0000010: 7572 6573 0100 0016 1366 756e 6374 696f
-0000020: 6e5f 7369 676e 6174 7572 6573 0100 9d02
-0000030: 0f66 756e 6374 696f 6e5f 626f 6469 6573
-0000040: 018a 0200 0182 0200 0000 0000 0000 0000
+0000000: 0061 736d 0b00 0000 0474 7970 6504 0140
+0000010: 0000 0866 756e 6374 696f 6e02 0100 0463
+0000020: 6f64 658c 0201 8902 0001 0000 0000 0000
+0000030: 0000 0000 0000 0000 0000 0000 0000 0000
+0000040: 0000 0000 0000 0000 0000 0000 0000 0000
0000050: 0000 0000 0000 0000 0000 0000 0000 0000
0000060: 0000 0000 0000 0000 0000 0000 0000 0000
0000070: 0000 0000 0000 0000 0000 0000 0000 0000
@@ -361,7 +361,6 @@
00000f0: 0000 0000 0000 0000 0000 0000 0000 0000
0000100: 0000 0000 0000 0000 0000 0000 0000 0000
0000110: 0000 0000 0000 0000 0000 0000 0000 0000
-0000120: 0000 0000 0000 0000 0000 0000 0000 0000
-0000130: 0000 0000 0000 0000 0000 0000 0000 0000
-0000140: 0000 0000 0000 0006 0000 0600 00
+0000120: 0000 0000 0000 0000 0000 0006 0000 0600
+0000130: 0f
;;; STDOUT ;;)
diff --git a/test/dump/block-257-exprs.txt b/test/dump/block-257-exprs.txt
index 1e5fe723..38e57053 100644
--- a/test/dump/block-257-exprs.txt
+++ b/test/dump/block-257-exprs.txt
@@ -46,34 +46,62 @@
(nop))))
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
-0000004: 0a00 0000 ; WASM_BINARY_VERSION
-; section "signatures"
-0000008: 00 ; section size (guess)
-0000009: 0a ; string length
-000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
-0000014: 01 ; num signatures
-; signature 0
-0000015: 00 ; num params
-0000016: 00 ; result_type
-0000008: 0e ; FIXUP section size
-; section "function_signatures"
-0000017: 00 ; section size (guess)
-0000018: 13 ; string length
-0000019: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
-0000029: 7265 73 ; section id: "function_signatures"
-000002c: 01 ; num functions
-000002d: 00 ; function 0 signature index
-0000017: 16 ; FIXUP section size
-; section "function_bodies"
-000002e: 00 ; section size (guess)
-000002f: 0f ; string length
-0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
-000003f: 01 ; num functions
+0000004: 0b00 0000 ; WASM_BINARY_VERSION
+; section "type"
+0000008: 04 ; string length
+0000009: 7479 7065 ; section id: "type"
+000000d: 00 ; section size (guess)
+000000e: 01 ; num types
+; type 0
+000000f: 40 ; function form
+0000010: 00 ; num params
+0000011: 00 ; num results
+000000d: 04 ; FIXUP section size
+; section "function"
+0000012: 08 ; string length
+0000013: 6675 6e63 7469 6f6e ; section id: "function"
+000001b: 00 ; section size (guess)
+000001c: 01 ; num functions
+000001d: 00 ; function 0 signature index
+000001b: 02 ; FIXUP section size
+; section "code"
+000001e: 04 ; string length
+000001f: 636f 6465 ; section id: "code"
+0000023: 00 ; section size (guess)
+0000024: 01 ; num functions
; function body 0
-0000040: 00 ; func body size (guess)
-0000041: 00 ; local decl count
-0000042: 01 ; OPCODE_BLOCK
-0000043: 8102 ; num expressions
+0000025: 00 ; func body size (guess)
+0000026: 00 ; local decl count
+0000027: 01 ; OPCODE_BLOCK
+0000028: 00 ; OPCODE_NOP
+0000029: 00 ; OPCODE_NOP
+000002a: 00 ; OPCODE_NOP
+000002b: 00 ; OPCODE_NOP
+000002c: 00 ; OPCODE_NOP
+000002d: 00 ; OPCODE_NOP
+000002e: 00 ; OPCODE_NOP
+000002f: 00 ; OPCODE_NOP
+0000030: 00 ; OPCODE_NOP
+0000031: 00 ; OPCODE_NOP
+0000032: 00 ; OPCODE_NOP
+0000033: 00 ; OPCODE_NOP
+0000034: 00 ; OPCODE_NOP
+0000035: 00 ; OPCODE_NOP
+0000036: 00 ; OPCODE_NOP
+0000037: 00 ; OPCODE_NOP
+0000038: 00 ; OPCODE_NOP
+0000039: 00 ; OPCODE_NOP
+000003a: 00 ; OPCODE_NOP
+000003b: 00 ; OPCODE_NOP
+000003c: 00 ; OPCODE_NOP
+000003d: 00 ; OPCODE_NOP
+000003e: 00 ; OPCODE_NOP
+000003f: 00 ; OPCODE_NOP
+0000040: 00 ; OPCODE_NOP
+0000041: 00 ; OPCODE_NOP
+0000042: 00 ; OPCODE_NOP
+0000043: 00 ; OPCODE_NOP
+0000044: 00 ; OPCODE_NOP
0000045: 00 ; OPCODE_NOP
0000046: 00 ; OPCODE_NOP
0000047: 00 ; OPCODE_NOP
@@ -302,45 +330,17 @@
0000126: 00 ; OPCODE_NOP
0000127: 00 ; OPCODE_NOP
0000128: 00 ; OPCODE_NOP
-0000129: 00 ; OPCODE_NOP
-000012a: 00 ; OPCODE_NOP
-000012b: 00 ; OPCODE_NOP
-000012c: 00 ; OPCODE_NOP
-000012d: 00 ; OPCODE_NOP
-000012e: 00 ; OPCODE_NOP
-000012f: 00 ; OPCODE_NOP
-0000130: 00 ; OPCODE_NOP
-0000131: 00 ; OPCODE_NOP
-0000132: 00 ; OPCODE_NOP
-0000133: 00 ; OPCODE_NOP
-0000134: 00 ; OPCODE_NOP
-0000135: 00 ; OPCODE_NOP
-0000136: 00 ; OPCODE_NOP
-0000137: 00 ; OPCODE_NOP
-0000138: 00 ; OPCODE_NOP
-0000139: 00 ; OPCODE_NOP
-000013a: 00 ; OPCODE_NOP
-000013b: 00 ; OPCODE_NOP
-000013c: 00 ; OPCODE_NOP
-000013d: 00 ; OPCODE_NOP
-000013e: 00 ; OPCODE_NOP
-000013f: 00 ; OPCODE_NOP
-0000140: 00 ; OPCODE_NOP
-0000141: 00 ; OPCODE_NOP
-0000142: 00 ; OPCODE_NOP
-0000143: 00 ; OPCODE_NOP
-0000144: 00 ; OPCODE_NOP
-0000145: 00 ; OPCODE_NOP
-; move data: [41, 146) -> [42, 147)
-0000040: 8502 ; FIXUP func body size
-; move data: [2f, 147) -> [30, 148)
-000002e: 9802 ; FIXUP section size
+0000129: 0f ; OPCODE_END
+; move data: [26, 12a) -> [27, 12b)
+0000025: 8402 ; FIXUP func body size
+; move data: [24, 12b) -> [25, 12c)
+0000023: 8702 ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0e0a 7369 676e 6174
-0000010: 7572 6573 0100 0016 1366 756e 6374 696f
-0000020: 6e5f 7369 676e 6174 7572 6573 0100 9802
-0000030: 0f66 756e 6374 696f 6e5f 626f 6469 6573
-0000040: 0185 0200 0181 0200 0000 0000 0000 0000
+0000000: 0061 736d 0b00 0000 0474 7970 6504 0140
+0000010: 0000 0866 756e 6374 696f 6e02 0100 0463
+0000020: 6f64 6587 0201 8402 0001 0000 0000 0000
+0000030: 0000 0000 0000 0000 0000 0000 0000 0000
+0000040: 0000 0000 0000 0000 0000 0000 0000 0000
0000050: 0000 0000 0000 0000 0000 0000 0000 0000
0000060: 0000 0000 0000 0000 0000 0000 0000 0000
0000070: 0000 0000 0000 0000 0000 0000 0000 0000
@@ -354,7 +354,5 @@
00000f0: 0000 0000 0000 0000 0000 0000 0000 0000
0000100: 0000 0000 0000 0000 0000 0000 0000 0000
0000110: 0000 0000 0000 0000 0000 0000 0000 0000
-0000120: 0000 0000 0000 0000 0000 0000 0000 0000
-0000130: 0000 0000 0000 0000 0000 0000 0000 0000
-0000140: 0000 0000 0000 0000
+0000120: 0000 0000 0000 0000 0000 000f
;;; STDOUT ;;)
diff --git a/test/dump/block.txt b/test/dump/block.txt
index 425f21b2..01ea5866 100644
--- a/test/dump/block.txt
+++ b/test/dump/block.txt
@@ -11,53 +11,56 @@
(i32.const 1))))
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
-0000004: 0a00 0000 ; WASM_BINARY_VERSION
-; section "signatures"
-0000008: 00 ; section size (guess)
-0000009: 0a ; string length
-000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
-0000014: 02 ; num signatures
-; signature 0
-0000015: 00 ; num params
-0000016: 00 ; result_type
-; signature 1
-0000017: 00 ; num params
-0000018: 01 ; result_type
-0000008: 10 ; FIXUP section size
-; section "function_signatures"
-0000019: 00 ; section size (guess)
-000001a: 13 ; string length
-000001b: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
-000002b: 7265 73 ; section id: "function_signatures"
-000002e: 02 ; num functions
-000002f: 00 ; function 0 signature index
-0000030: 01 ; function 1 signature index
-0000019: 17 ; FIXUP section size
-; section "function_bodies"
-0000031: 00 ; section size (guess)
-0000032: 0f ; string length
-0000033: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
-0000042: 02 ; num functions
+0000004: 0b00 0000 ; WASM_BINARY_VERSION
+; section "type"
+0000008: 04 ; string length
+0000009: 7479 7065 ; section id: "type"
+000000d: 00 ; section size (guess)
+000000e: 02 ; num types
+; type 0
+000000f: 40 ; function form
+0000010: 00 ; num params
+0000011: 00 ; num results
+; type 1
+0000012: 40 ; function form
+0000013: 00 ; num params
+0000014: 01 ; num results
+0000015: 01 ; result_type
+000000d: 08 ; FIXUP section size
+; section "function"
+0000016: 08 ; string length
+0000017: 6675 6e63 7469 6f6e ; section id: "function"
+000001f: 00 ; section size (guess)
+0000020: 02 ; num functions
+0000021: 00 ; function 0 signature index
+0000022: 01 ; function 1 signature index
+000001f: 03 ; FIXUP section size
+; section "code"
+0000023: 04 ; string length
+0000024: 636f 6465 ; section id: "code"
+0000028: 00 ; section size (guess)
+0000029: 02 ; num functions
; function body 0
-0000043: 00 ; func body size (guess)
-0000044: 00 ; local decl count
-0000045: 01 ; OPCODE_BLOCK
-0000046: 03 ; num expressions
-0000047: 00 ; OPCODE_NOP
-0000048: 00 ; OPCODE_NOP
-0000049: 00 ; OPCODE_NOP
-0000043: 06 ; FIXUP func body size
+000002a: 00 ; func body size (guess)
+000002b: 00 ; local decl count
+000002c: 01 ; OPCODE_BLOCK
+000002d: 00 ; OPCODE_NOP
+000002e: 00 ; OPCODE_NOP
+000002f: 00 ; OPCODE_NOP
+0000030: 0f ; OPCODE_END
+000002a: 06 ; FIXUP func body size
; function body 1
-000004a: 00 ; func body size (guess)
-000004b: 00 ; local decl count
-000004c: 0a ; OPCODE_I32_CONST
-000004d: 01 ; i32 literal
-000004a: 03 ; FIXUP func body size
-0000031: 1c ; FIXUP section size
+0000031: 00 ; func body size (guess)
+0000032: 00 ; local decl count
+0000033: 01 ; OPCODE_BLOCK
+0000034: 10 ; OPCODE_I32_CONST
+0000035: 01 ; i32 literal
+0000036: 0f ; OPCODE_END
+0000031: 05 ; FIXUP func body size
+0000028: 0e ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 100a 7369 676e 6174
-0000010: 7572 6573 0200 0000 0117 1366 756e 6374
-0000020: 696f 6e5f 7369 676e 6174 7572 6573 0200
-0000030: 011c 0f66 756e 6374 696f 6e5f 626f 6469
-0000040: 6573 0206 0001 0300 0000 0300 0a01
+0000000: 0061 736d 0b00 0000 0474 7970 6508 0240
+0000010: 0000 4000 0101 0866 756e 6374 696f 6e03
+0000020: 0200 0104 636f 6465 0e02 0600 0100 0000
+0000030: 0f05 0001 1001 0f
;;; STDOUT ;;)
diff --git a/test/dump/br-block-named.txt b/test/dump/br-block-named.txt
index 29b09ca3..2b43ac60 100644
--- a/test/dump/br-block-named.txt
+++ b/test/dump/br-block-named.txt
@@ -10,55 +10,53 @@
(br $outer)))))))
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
-0000004: 0a00 0000 ; WASM_BINARY_VERSION
-; section "signatures"
-0000008: 00 ; section size (guess)
-0000009: 0a ; string length
-000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
-0000014: 01 ; num signatures
-; signature 0
-0000015: 00 ; num params
-0000016: 00 ; result_type
-0000008: 0e ; FIXUP section size
-; section "function_signatures"
-0000017: 00 ; section size (guess)
-0000018: 13 ; string length
-0000019: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
-0000029: 7265 73 ; section id: "function_signatures"
-000002c: 01 ; num functions
-000002d: 00 ; function 0 signature index
-0000017: 16 ; FIXUP section size
-; section "function_bodies"
-000002e: 00 ; section size (guess)
-000002f: 0f ; string length
-0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
-000003f: 01 ; num functions
+0000004: 0b00 0000 ; WASM_BINARY_VERSION
+; section "type"
+0000008: 04 ; string length
+0000009: 7479 7065 ; section id: "type"
+000000d: 00 ; section size (guess)
+000000e: 01 ; num types
+; type 0
+000000f: 40 ; function form
+0000010: 00 ; num params
+0000011: 00 ; num results
+000000d: 04 ; FIXUP section size
+; section "function"
+0000012: 08 ; string length
+0000013: 6675 6e63 7469 6f6e ; section id: "function"
+000001b: 00 ; section size (guess)
+000001c: 01 ; num functions
+000001d: 00 ; function 0 signature index
+000001b: 02 ; FIXUP section size
+; section "code"
+000001e: 04 ; string length
+000001f: 636f 6465 ; section id: "code"
+0000023: 00 ; section size (guess)
+0000024: 01 ; num functions
; function body 0
-0000040: 00 ; func body size (guess)
-0000041: 00 ; local decl count
-0000042: 01 ; OPCODE_BLOCK
-0000043: 01 ; num expressions
-0000044: 02 ; OPCODE_LOOP
-0000045: 01 ; num expressions
-0000046: 01 ; OPCODE_BLOCK
-0000047: 02 ; num expressions
-0000048: 0a ; OPCODE_I32_CONST
-0000049: 00 ; i32 literal
-000004a: 01 ; OPCODE_BLOCK
-000004b: 02 ; num expressions
-000004c: 06 ; OPCODE_BR
-000004d: 00 ; break depth
-000004e: 00 ; OPCODE_NOP
-000004f: 06 ; OPCODE_BR
-0000050: 04 ; break depth
-0000051: 00 ; OPCODE_NOP
-0000040: 11 ; FIXUP func body size
-000002e: 23 ; FIXUP section size
+0000025: 00 ; func body size (guess)
+0000026: 00 ; local decl count
+0000027: 01 ; OPCODE_BLOCK
+0000028: 02 ; OPCODE_LOOP
+0000029: 01 ; OPCODE_BLOCK
+000002a: 10 ; OPCODE_I32_CONST
+000002b: 00 ; i32 literal
+000002c: 01 ; OPCODE_BLOCK
+000002d: 00 ; OPCODE_NOP
+000002e: 06 ; OPCODE_BR
+000002f: 00 ; break depth
+0000030: 00 ; OPCODE_NOP
+0000031: 06 ; OPCODE_BR
+0000032: 04 ; break depth
+0000033: 0f ; OPCODE_END
+0000034: 0f ; OPCODE_END
+0000035: 0f ; OPCODE_END
+0000036: 0f ; OPCODE_END
+0000025: 11 ; FIXUP func body size
+0000023: 13 ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0e0a 7369 676e 6174
-0000010: 7572 6573 0100 0016 1366 756e 6374 696f
-0000020: 6e5f 7369 676e 6174 7572 6573 0100 230f
-0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 7301
-0000040: 1100 0101 0201 0102 0a00 0102 0600 0006
-0000050: 0400
+0000000: 0061 736d 0b00 0000 0474 7970 6504 0140
+0000010: 0000 0866 756e 6374 696f 6e02 0100 0463
+0000020: 6f64 6513 0111 0001 0201 1000 0100 0600
+0000030: 0006 040f 0f0f 0f
;;; STDOUT ;;)
diff --git a/test/dump/br-block.txt b/test/dump/br-block.txt
index 963e7c46..f413884c 100644
--- a/test/dump/br-block.txt
+++ b/test/dump/br-block.txt
@@ -13,62 +13,62 @@
(br 3)))))))
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
-0000004: 0a00 0000 ; WASM_BINARY_VERSION
-; section "signatures"
-0000008: 00 ; section size (guess)
-0000009: 0a ; string length
-000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
-0000014: 01 ; num signatures
-; signature 0
-0000015: 00 ; num params
-0000016: 00 ; result_type
-0000008: 0e ; FIXUP section size
-; section "function_signatures"
-0000017: 00 ; section size (guess)
-0000018: 13 ; string length
-0000019: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
-0000029: 7265 73 ; section id: "function_signatures"
-000002c: 01 ; num functions
-000002d: 00 ; function 0 signature index
-0000017: 16 ; FIXUP section size
-; section "function_bodies"
-000002e: 00 ; section size (guess)
-000002f: 0f ; string length
-0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
-000003f: 01 ; num functions
+0000004: 0b00 0000 ; WASM_BINARY_VERSION
+; section "type"
+0000008: 04 ; string length
+0000009: 7479 7065 ; section id: "type"
+000000d: 00 ; section size (guess)
+000000e: 01 ; num types
+; type 0
+000000f: 40 ; function form
+0000010: 00 ; num params
+0000011: 00 ; num results
+000000d: 04 ; FIXUP section size
+; section "function"
+0000012: 08 ; string length
+0000013: 6675 6e63 7469 6f6e ; section id: "function"
+000001b: 00 ; section size (guess)
+000001c: 01 ; num functions
+000001d: 00 ; function 0 signature index
+000001b: 02 ; FIXUP section size
+; section "code"
+000001e: 04 ; string length
+000001f: 636f 6465 ; section id: "code"
+0000023: 00 ; section size (guess)
+0000024: 01 ; num functions
; function body 0
-0000040: 00 ; func body size (guess)
-0000041: 00 ; local decl count
-0000042: 02 ; OPCODE_LOOP
-0000043: 01 ; num expressions
-0000044: 01 ; OPCODE_BLOCK
-0000045: 02 ; num expressions
-0000046: 0a ; OPCODE_I32_CONST
-0000047: 00 ; i32 literal
-0000048: 01 ; OPCODE_BLOCK
-0000049: 05 ; num expressions
-000004a: 06 ; OPCODE_BR
-000004b: 00 ; break depth
-000004c: 00 ; OPCODE_NOP
-000004d: 06 ; OPCODE_BR
-000004e: 00 ; break depth
-000004f: 00 ; OPCODE_NOP
-0000050: 06 ; OPCODE_BR
-0000051: 01 ; break depth
-0000052: 00 ; OPCODE_NOP
-0000053: 06 ; OPCODE_BR
-0000054: 02 ; break depth
-0000055: 00 ; OPCODE_NOP
-0000056: 06 ; OPCODE_BR
-0000057: 03 ; break depth
-0000058: 00 ; OPCODE_NOP
-0000040: 18 ; FIXUP func body size
-000002e: 2a ; FIXUP section size
+0000025: 00 ; func body size (guess)
+0000026: 00 ; local decl count
+0000027: 01 ; OPCODE_BLOCK
+0000028: 02 ; OPCODE_LOOP
+0000029: 01 ; OPCODE_BLOCK
+000002a: 10 ; OPCODE_I32_CONST
+000002b: 00 ; i32 literal
+000002c: 01 ; OPCODE_BLOCK
+000002d: 00 ; OPCODE_NOP
+000002e: 06 ; OPCODE_BR
+000002f: 00 ; break depth
+0000030: 00 ; OPCODE_NOP
+0000031: 06 ; OPCODE_BR
+0000032: 00 ; break depth
+0000033: 00 ; OPCODE_NOP
+0000034: 06 ; OPCODE_BR
+0000035: 01 ; break depth
+0000036: 00 ; OPCODE_NOP
+0000037: 06 ; OPCODE_BR
+0000038: 02 ; break depth
+0000039: 00 ; OPCODE_NOP
+000003a: 06 ; OPCODE_BR
+000003b: 03 ; break depth
+000003c: 0f ; OPCODE_END
+000003d: 0f ; OPCODE_END
+000003e: 0f ; OPCODE_END
+000003f: 0f ; OPCODE_END
+0000025: 1a ; FIXUP func body size
+0000023: 1c ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0e0a 7369 676e 6174
-0000010: 7572 6573 0100 0016 1366 756e 6374 696f
-0000020: 6e5f 7369 676e 6174 7572 6573 0100 2a0f
-0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 7301
-0000040: 1800 0201 0102 0a00 0105 0600 0006 0000
-0000050: 0601 0006 0200 0603 00
+0000000: 0061 736d 0b00 0000 0474 7970 6504 0140
+0000010: 0000 0866 756e 6374 696f 6e02 0100 0463
+0000020: 6f64 651c 011a 0001 0201 1000 0100 0600
+0000030: 0006 0000 0601 0006 0200 0603 0f0f 0f0f
;;; STDOUT ;;)
diff --git a/test/dump/br-loop-inner-expr.txt b/test/dump/br-loop-inner-expr.txt
index 8a9c38e6..a9f7ff5e 100644
--- a/test/dump/br-loop-inner-expr.txt
+++ b/test/dump/br-loop-inner-expr.txt
@@ -9,56 +9,57 @@
(i32.const 5))))
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
-0000004: 0a00 0000 ; WASM_BINARY_VERSION
-; section "signatures"
-0000008: 00 ; section size (guess)
-0000009: 0a ; string length
-000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
-0000014: 01 ; num signatures
-; signature 0
-0000015: 00 ; num params
-0000016: 01 ; result_type
-0000008: 0e ; FIXUP section size
-; section "function_signatures"
-0000017: 00 ; section size (guess)
-0000018: 13 ; string length
-0000019: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
-0000029: 7265 73 ; section id: "function_signatures"
-000002c: 01 ; num functions
-000002d: 00 ; function 0 signature index
-0000017: 16 ; FIXUP section size
-; section "function_bodies"
-000002e: 00 ; section size (guess)
-000002f: 0f ; string length
-0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
-000003f: 01 ; num functions
+0000004: 0b00 0000 ; WASM_BINARY_VERSION
+; section "type"
+0000008: 04 ; string length
+0000009: 7479 7065 ; section id: "type"
+000000d: 00 ; section size (guess)
+000000e: 01 ; num types
+; type 0
+000000f: 40 ; function form
+0000010: 00 ; num params
+0000011: 01 ; num results
+0000012: 01 ; result_type
+000000d: 05 ; FIXUP section size
+; section "function"
+0000013: 08 ; string length
+0000014: 6675 6e63 7469 6f6e ; section id: "function"
+000001c: 00 ; section size (guess)
+000001d: 01 ; num functions
+000001e: 00 ; function 0 signature index
+000001c: 02 ; FIXUP section size
+; section "code"
+000001f: 04 ; string length
+0000020: 636f 6465 ; section id: "code"
+0000024: 00 ; section size (guess)
+0000025: 01 ; num functions
; function body 0
-0000040: 00 ; func body size (guess)
-0000041: 00 ; local decl count
-0000042: 02 ; OPCODE_LOOP
-0000043: 03 ; num expressions
-0000044: 03 ; OPCODE_IF
-0000045: 0a ; OPCODE_I32_CONST
-0000046: 01 ; i32 literal
-0000047: 06 ; OPCODE_BR
-0000048: 00 ; break depth
-0000049: 00 ; OPCODE_NOP
-000004a: 03 ; OPCODE_IF
-000004b: 0a ; OPCODE_I32_CONST
-000004c: 03 ; i32 literal
-000004d: 06 ; OPCODE_BR
-000004e: 01 ; break depth
-000004f: 0a ; OPCODE_I32_CONST
-0000050: 04 ; i32 literal
-0000051: 0a ; OPCODE_I32_CONST
-0000052: 05 ; i32 literal
-0000040: 12 ; FIXUP func body size
-000002e: 24 ; FIXUP section size
+0000026: 00 ; func body size (guess)
+0000027: 00 ; local decl count
+0000028: 02 ; OPCODE_LOOP
+0000029: 10 ; OPCODE_I32_CONST
+000002a: 01 ; i32 literal
+000002b: 03 ; OPCODE_IF
+000002c: 00 ; OPCODE_NOP
+000002d: 06 ; OPCODE_BR
+000002e: 01 ; break depth
+000002f: 0f ; OPCODE_END
+0000030: 10 ; OPCODE_I32_CONST
+0000031: 03 ; i32 literal
+0000032: 03 ; OPCODE_IF
+0000033: 10 ; OPCODE_I32_CONST
+0000034: 04 ; i32 literal
+0000035: 06 ; OPCODE_BR
+0000036: 02 ; break depth
+0000037: 0f ; OPCODE_END
+0000038: 10 ; OPCODE_I32_CONST
+0000039: 05 ; i32 literal
+000003a: 0f ; OPCODE_END
+0000026: 14 ; FIXUP func body size
+0000024: 16 ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0e0a 7369 676e 6174
-0000010: 7572 6573 0100 0116 1366 756e 6374 696f
-0000020: 6e5f 7369 676e 6174 7572 6573 0100 240f
-0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 7301
-0000040: 1200 0203 030a 0106 0000 030a 0306 010a
-0000050: 040a 05
+0000000: 0061 736d 0b00 0000 0474 7970 6505 0140
+0000010: 0001 0108 6675 6e63 7469 6f6e 0201 0004
+0000020: 636f 6465 1601 1400 0210 0103 0006 010f
+0000030: 1003 0310 0406 020f 1005 0f
;;; STDOUT ;;)
diff --git a/test/dump/br-loop-inner.txt b/test/dump/br-loop-inner.txt
index 5ac7cb1f..08008309 100644
--- a/test/dump/br-loop-inner.txt
+++ b/test/dump/br-loop-inner.txt
@@ -8,52 +8,53 @@
(br $cont)))))
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
-0000004: 0a00 0000 ; WASM_BINARY_VERSION
-; section "signatures"
-0000008: 00 ; section size (guess)
-0000009: 0a ; string length
-000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
-0000014: 01 ; num signatures
-; signature 0
-0000015: 00 ; num params
-0000016: 00 ; result_type
-0000008: 0e ; FIXUP section size
-; section "function_signatures"
-0000017: 00 ; section size (guess)
-0000018: 13 ; string length
-0000019: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
-0000029: 7265 73 ; section id: "function_signatures"
-000002c: 01 ; num functions
-000002d: 00 ; function 0 signature index
-0000017: 16 ; FIXUP section size
-; section "function_bodies"
-000002e: 00 ; section size (guess)
-000002f: 0f ; string length
-0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
-000003f: 01 ; num functions
+0000004: 0b00 0000 ; WASM_BINARY_VERSION
+; section "type"
+0000008: 04 ; string length
+0000009: 7479 7065 ; section id: "type"
+000000d: 00 ; section size (guess)
+000000e: 01 ; num types
+; type 0
+000000f: 40 ; function form
+0000010: 00 ; num params
+0000011: 00 ; num results
+000000d: 04 ; FIXUP section size
+; section "function"
+0000012: 08 ; string length
+0000013: 6675 6e63 7469 6f6e ; section id: "function"
+000001b: 00 ; section size (guess)
+000001c: 01 ; num functions
+000001d: 00 ; function 0 signature index
+000001b: 02 ; FIXUP section size
+; section "code"
+000001e: 04 ; string length
+000001f: 636f 6465 ; section id: "code"
+0000023: 00 ; section size (guess)
+0000024: 01 ; num functions
; function body 0
-0000040: 00 ; func body size (guess)
-0000041: 00 ; local decl count
-0000042: 02 ; OPCODE_LOOP
-0000043: 02 ; num expressions
-0000044: 03 ; OPCODE_IF
-0000045: 0a ; OPCODE_I32_CONST
-0000046: 01 ; i32 literal
-0000047: 06 ; OPCODE_BR
-0000048: 01 ; break depth
-0000049: 00 ; OPCODE_NOP
-000004a: 03 ; OPCODE_IF
-000004b: 0a ; OPCODE_I32_CONST
-000004c: 02 ; i32 literal
-000004d: 06 ; OPCODE_BR
-000004e: 00 ; break depth
-000004f: 00 ; OPCODE_NOP
-0000040: 0f ; FIXUP func body size
-000002e: 21 ; FIXUP section size
+0000025: 00 ; func body size (guess)
+0000026: 00 ; local decl count
+0000027: 02 ; OPCODE_LOOP
+0000028: 10 ; OPCODE_I32_CONST
+0000029: 01 ; i32 literal
+000002a: 03 ; OPCODE_IF
+000002b: 00 ; OPCODE_NOP
+000002c: 06 ; OPCODE_BR
+000002d: 02 ; break depth
+000002e: 0f ; OPCODE_END
+000002f: 10 ; OPCODE_I32_CONST
+0000030: 02 ; i32 literal
+0000031: 03 ; OPCODE_IF
+0000032: 00 ; OPCODE_NOP
+0000033: 06 ; OPCODE_BR
+0000034: 01 ; break depth
+0000035: 0f ; OPCODE_END
+0000036: 0f ; OPCODE_END
+0000025: 11 ; FIXUP func body size
+0000023: 13 ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0e0a 7369 676e 6174
-0000010: 7572 6573 0100 0016 1366 756e 6374 696f
-0000020: 6e5f 7369 676e 6174 7572 6573 0100 210f
-0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 7301
-0000040: 0f00 0202 030a 0106 0100 030a 0206 0000
+0000000: 0061 736d 0b00 0000 0474 7970 6504 0140
+0000010: 0000 0866 756e 6374 696f 6e02 0100 0463
+0000020: 6f64 6513 0111 0002 1001 0300 0602 0f10
+0000030: 0203 0006 010f 0f
;;; STDOUT ;;)
diff --git a/test/dump/br-loop.txt b/test/dump/br-loop.txt
index 7667e4d7..b418c65d 100644
--- a/test/dump/br-loop.txt
+++ b/test/dump/br-loop.txt
@@ -6,46 +6,45 @@
(br $cont)))))
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
-0000004: 0a00 0000 ; WASM_BINARY_VERSION
-; section "signatures"
-0000008: 00 ; section size (guess)
-0000009: 0a ; string length
-000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
-0000014: 01 ; num signatures
-; signature 0
-0000015: 00 ; num params
-0000016: 00 ; result_type
-0000008: 0e ; FIXUP section size
-; section "function_signatures"
-0000017: 00 ; section size (guess)
-0000018: 13 ; string length
-0000019: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
-0000029: 7265 73 ; section id: "function_signatures"
-000002c: 01 ; num functions
-000002d: 00 ; function 0 signature index
-0000017: 16 ; FIXUP section size
-; section "function_bodies"
-000002e: 00 ; section size (guess)
-000002f: 0f ; string length
-0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
-000003f: 01 ; num functions
+0000004: 0b00 0000 ; WASM_BINARY_VERSION
+; section "type"
+0000008: 04 ; string length
+0000009: 7479 7065 ; section id: "type"
+000000d: 00 ; section size (guess)
+000000e: 01 ; num types
+; type 0
+000000f: 40 ; function form
+0000010: 00 ; num params
+0000011: 00 ; num results
+000000d: 04 ; FIXUP section size
+; section "function"
+0000012: 08 ; string length
+0000013: 6675 6e63 7469 6f6e ; section id: "function"
+000001b: 00 ; section size (guess)
+000001c: 01 ; num functions
+000001d: 00 ; function 0 signature index
+000001b: 02 ; FIXUP section size
+; section "code"
+000001e: 04 ; string length
+000001f: 636f 6465 ; section id: "code"
+0000023: 00 ; section size (guess)
+0000024: 01 ; num functions
; function body 0
-0000040: 00 ; func body size (guess)
-0000041: 00 ; local decl count
-0000042: 02 ; OPCODE_LOOP
-0000043: 01 ; num expressions
-0000044: 03 ; OPCODE_IF
-0000045: 0a ; OPCODE_I32_CONST
-0000046: 01 ; i32 literal
-0000047: 06 ; OPCODE_BR
-0000048: 00 ; break depth
-0000049: 00 ; OPCODE_NOP
-0000040: 09 ; FIXUP func body size
-000002e: 1b ; FIXUP section size
+0000025: 00 ; func body size (guess)
+0000026: 00 ; local decl count
+0000027: 02 ; OPCODE_LOOP
+0000028: 10 ; OPCODE_I32_CONST
+0000029: 01 ; i32 literal
+000002a: 03 ; OPCODE_IF
+000002b: 00 ; OPCODE_NOP
+000002c: 06 ; OPCODE_BR
+000002d: 01 ; break depth
+000002e: 0f ; OPCODE_END
+000002f: 0f ; OPCODE_END
+0000025: 0a ; FIXUP func body size
+0000023: 0c ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0e0a 7369 676e 6174
-0000010: 7572 6573 0100 0016 1366 756e 6374 696f
-0000020: 6e5f 7369 676e 6174 7572 6573 0100 1b0f
-0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 7301
-0000040: 0900 0201 030a 0106 0000
+0000000: 0061 736d 0b00 0000 0474 7970 6504 0140
+0000010: 0000 0866 756e 6374 696f 6e02 0100 0463
+0000020: 6f64 650c 010a 0002 1001 0300 0601 0f0f
;;; STDOUT ;;)
diff --git a/test/dump/brif-loop.txt b/test/dump/brif-loop.txt
index 4e57ebff..974bb0c0 100644
--- a/test/dump/brif-loop.txt
+++ b/test/dump/brif-loop.txt
@@ -5,45 +5,43 @@
(br_if $cont (i32.const 0)))))
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
-0000004: 0a00 0000 ; WASM_BINARY_VERSION
-; section "signatures"
-0000008: 00 ; section size (guess)
-0000009: 0a ; string length
-000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
-0000014: 01 ; num signatures
-; signature 0
-0000015: 00 ; num params
-0000016: 00 ; result_type
-0000008: 0e ; FIXUP section size
-; section "function_signatures"
-0000017: 00 ; section size (guess)
-0000018: 13 ; string length
-0000019: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
-0000029: 7265 73 ; section id: "function_signatures"
-000002c: 01 ; num functions
-000002d: 00 ; function 0 signature index
-0000017: 16 ; FIXUP section size
-; section "function_bodies"
-000002e: 00 ; section size (guess)
-000002f: 0f ; string length
-0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
-000003f: 01 ; num functions
+0000004: 0b00 0000 ; WASM_BINARY_VERSION
+; section "type"
+0000008: 04 ; string length
+0000009: 7479 7065 ; section id: "type"
+000000d: 00 ; section size (guess)
+000000e: 01 ; num types
+; type 0
+000000f: 40 ; function form
+0000010: 00 ; num params
+0000011: 00 ; num results
+000000d: 04 ; FIXUP section size
+; section "function"
+0000012: 08 ; string length
+0000013: 6675 6e63 7469 6f6e ; section id: "function"
+000001b: 00 ; section size (guess)
+000001c: 01 ; num functions
+000001d: 00 ; function 0 signature index
+000001b: 02 ; FIXUP section size
+; section "code"
+000001e: 04 ; string length
+000001f: 636f 6465 ; section id: "code"
+0000023: 00 ; section size (guess)
+0000024: 01 ; num functions
; function body 0
-0000040: 00 ; func body size (guess)
-0000041: 00 ; local decl count
-0000042: 02 ; OPCODE_LOOP
-0000043: 01 ; num expressions
-0000044: 07 ; OPCODE_BR_IF
-0000045: 00 ; break depth
-0000046: 00 ; OPCODE_NOP
-0000047: 0a ; OPCODE_I32_CONST
-0000048: 00 ; i32 literal
-0000040: 08 ; FIXUP func body size
-000002e: 1a ; FIXUP section size
+0000025: 00 ; func body size (guess)
+0000026: 00 ; local decl count
+0000027: 02 ; OPCODE_LOOP
+0000028: 00 ; OPCODE_NOP
+0000029: 10 ; OPCODE_I32_CONST
+000002a: 00 ; i32 literal
+000002b: 07 ; OPCODE_BR_IF
+000002c: 00 ; break depth
+000002d: 0f ; OPCODE_END
+0000025: 08 ; FIXUP func body size
+0000023: 0a ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0e0a 7369 676e 6174
-0000010: 7572 6573 0100 0016 1366 756e 6374 696f
-0000020: 6e5f 7369 676e 6174 7572 6573 0100 1a0f
-0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 7301
-0000040: 0800 0201 0700 000a 00
+0000000: 0061 736d 0b00 0000 0474 7970 6504 0140
+0000010: 0000 0866 756e 6374 696f 6e02 0100 0463
+0000020: 6f64 650a 0108 0002 0010 0007 000f
;;; STDOUT ;;)
diff --git a/test/dump/brif.txt b/test/dump/brif.txt
index deb66ab0..e51d08f5 100644
--- a/test/dump/brif.txt
+++ b/test/dump/brif.txt
@@ -5,45 +5,43 @@
(br_if $foo (i32.const 1)))))
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
-0000004: 0a00 0000 ; WASM_BINARY_VERSION
-; section "signatures"
-0000008: 00 ; section size (guess)
-0000009: 0a ; string length
-000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
-0000014: 01 ; num signatures
-; signature 0
-0000015: 00 ; num params
-0000016: 00 ; result_type
-0000008: 0e ; FIXUP section size
-; section "function_signatures"
-0000017: 00 ; section size (guess)
-0000018: 13 ; string length
-0000019: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
-0000029: 7265 73 ; section id: "function_signatures"
-000002c: 01 ; num functions
-000002d: 00 ; function 0 signature index
-0000017: 16 ; FIXUP section size
-; section "function_bodies"
-000002e: 00 ; section size (guess)
-000002f: 0f ; string length
-0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
-000003f: 01 ; num functions
+0000004: 0b00 0000 ; WASM_BINARY_VERSION
+; section "type"
+0000008: 04 ; string length
+0000009: 7479 7065 ; section id: "type"
+000000d: 00 ; section size (guess)
+000000e: 01 ; num types
+; type 0
+000000f: 40 ; function form
+0000010: 00 ; num params
+0000011: 00 ; num results
+000000d: 04 ; FIXUP section size
+; section "function"
+0000012: 08 ; string length
+0000013: 6675 6e63 7469 6f6e ; section id: "function"
+000001b: 00 ; section size (guess)
+000001c: 01 ; num functions
+000001d: 00 ; function 0 signature index
+000001b: 02 ; FIXUP section size
+; section "code"
+000001e: 04 ; string length
+000001f: 636f 6465 ; section id: "code"
+0000023: 00 ; section size (guess)
+0000024: 01 ; num functions
; function body 0
-0000040: 00 ; func body size (guess)
-0000041: 00 ; local decl count
-0000042: 01 ; OPCODE_BLOCK
-0000043: 01 ; num expressions
-0000044: 07 ; OPCODE_BR_IF
-0000045: 00 ; break depth
-0000046: 00 ; OPCODE_NOP
-0000047: 0a ; OPCODE_I32_CONST
-0000048: 01 ; i32 literal
-0000040: 08 ; FIXUP func body size
-000002e: 1a ; FIXUP section size
+0000025: 00 ; func body size (guess)
+0000026: 00 ; local decl count
+0000027: 01 ; OPCODE_BLOCK
+0000028: 00 ; OPCODE_NOP
+0000029: 10 ; OPCODE_I32_CONST
+000002a: 01 ; i32 literal
+000002b: 07 ; OPCODE_BR_IF
+000002c: 00 ; break depth
+000002d: 0f ; OPCODE_END
+0000025: 08 ; FIXUP func body size
+0000023: 0a ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0e0a 7369 676e 6174
-0000010: 7572 6573 0100 0016 1366 756e 6374 696f
-0000020: 6e5f 7369 676e 6174 7572 6573 0100 1a0f
-0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 7301
-0000040: 0800 0101 0700 000a 01
+0000000: 0061 736d 0b00 0000 0474 7970 6504 0140
+0000010: 0000 0866 756e 6374 696f 6e02 0100 0463
+0000020: 6f64 650a 0108 0001 0010 0107 000f
;;; STDOUT ;;)
diff --git a/test/dump/brtable-empty.txt b/test/dump/brtable-empty.txt
index 957a765e..e4c3ff68 100644
--- a/test/dump/brtable-empty.txt
+++ b/test/dump/brtable-empty.txt
@@ -5,45 +5,45 @@
(br_table 0 (i32.const 0)))))
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
-0000004: 0a00 0000 ; WASM_BINARY_VERSION
-; section "signatures"
-0000008: 00 ; section size (guess)
-0000009: 0a ; string length
-000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
-0000014: 01 ; num signatures
-; signature 0
-0000015: 00 ; num params
-0000016: 00 ; result_type
-0000008: 0e ; FIXUP section size
-; section "function_signatures"
-0000017: 00 ; section size (guess)
-0000018: 13 ; string length
-0000019: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
-0000029: 7265 73 ; section id: "function_signatures"
-000002c: 01 ; num functions
-000002d: 00 ; function 0 signature index
-0000017: 16 ; FIXUP section size
-; section "function_bodies"
-000002e: 00 ; section size (guess)
-000002f: 0f ; string length
-0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
-000003f: 01 ; num functions
+0000004: 0b00 0000 ; WASM_BINARY_VERSION
+; section "type"
+0000008: 04 ; string length
+0000009: 7479 7065 ; section id: "type"
+000000d: 00 ; section size (guess)
+000000e: 01 ; num types
+; type 0
+000000f: 40 ; function form
+0000010: 00 ; num params
+0000011: 00 ; num results
+000000d: 04 ; FIXUP section size
+; section "function"
+0000012: 08 ; string length
+0000013: 6675 6e63 7469 6f6e ; section id: "function"
+000001b: 00 ; section size (guess)
+000001c: 01 ; num functions
+000001d: 00 ; function 0 signature index
+000001b: 02 ; FIXUP section size
+; section "code"
+000001e: 04 ; string length
+000001f: 636f 6465 ; section id: "code"
+0000023: 00 ; section size (guess)
+0000024: 01 ; num functions
; function body 0
-0000040: 00 ; func body size (guess)
-0000041: 00 ; local decl count
-0000042: 01 ; OPCODE_BLOCK
-0000043: 01 ; num expressions
-0000044: 08 ; OPCODE_BR_TABLE
-0000045: 00 ; num targets
-0000046: 0000 0000 ; break depth for default
-000004a: 0a ; OPCODE_I32_CONST
-000004b: 00 ; i32 literal
-0000040: 0b ; FIXUP func body size
-000002e: 1d ; FIXUP section size
+0000025: 00 ; func body size (guess)
+0000026: 00 ; local decl count
+0000027: 01 ; OPCODE_BLOCK
+0000028: 00 ; OPCODE_NOP
+0000029: 10 ; OPCODE_I32_CONST
+000002a: 00 ; i32 literal
+000002b: 08 ; OPCODE_BR_TABLE
+000002c: 00 ; num targets
+000002d: 0000 0000 ; break depth for default
+0000031: 0f ; OPCODE_END
+0000025: 0c ; FIXUP func body size
+0000023: 0e ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0e0a 7369 676e 6174
-0000010: 7572 6573 0100 0016 1366 756e 6374 696f
-0000020: 6e5f 7369 676e 6174 7572 6573 0100 1d0f
-0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 7301
-0000040: 0b00 0101 0800 0000 0000 0a00
+0000000: 0061 736d 0b00 0000 0474 7970 6504 0140
+0000010: 0000 0866 756e 6374 696f 6e02 0100 0463
+0000020: 6f64 650e 010c 0001 0010 0008 0000 0000
+0000030: 000f
;;; STDOUT ;;)
diff --git a/test/dump/brtable.txt b/test/dump/brtable.txt
index c8219e74..b387d85b 100644
--- a/test/dump/brtable.txt
+++ b/test/dump/brtable.txt
@@ -15,62 +15,61 @@
(i32.const 3)))
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
-0000004: 0a00 0000 ; WASM_BINARY_VERSION
-; section "signatures"
-0000008: 00 ; section size (guess)
-0000009: 0a ; string length
-000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
-0000014: 01 ; num signatures
-; signature 0
-0000015: 00 ; num params
-0000016: 00 ; result_type
-0000008: 0e ; FIXUP section size
-; section "function_signatures"
-0000017: 00 ; section size (guess)
-0000018: 13 ; string length
-0000019: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
-0000029: 7265 73 ; section id: "function_signatures"
-000002c: 01 ; num functions
-000002d: 00 ; function 0 signature index
-0000017: 16 ; FIXUP section size
-; section "function_bodies"
-000002e: 00 ; section size (guess)
-000002f: 0f ; string length
-0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
-000003f: 01 ; num functions
+0000004: 0b00 0000 ; WASM_BINARY_VERSION
+; section "type"
+0000008: 04 ; string length
+0000009: 7479 7065 ; section id: "type"
+000000d: 00 ; section size (guess)
+000000e: 01 ; num types
+; type 0
+000000f: 40 ; function form
+0000010: 00 ; num params
+0000011: 00 ; num results
+000000d: 04 ; FIXUP section size
+; section "function"
+0000012: 08 ; string length
+0000013: 6675 6e63 7469 6f6e ; section id: "function"
+000001b: 00 ; section size (guess)
+000001c: 01 ; num functions
+000001d: 00 ; function 0 signature index
+000001b: 02 ; FIXUP section size
+; section "code"
+000001e: 04 ; string length
+000001f: 636f 6465 ; section id: "code"
+0000023: 00 ; section size (guess)
+0000024: 01 ; num functions
; function body 0
-0000040: 00 ; func body size (guess)
-0000041: 00 ; local decl count
-0000042: 01 ; OPCODE_BLOCK
-0000043: 01 ; num expressions
-0000044: 01 ; OPCODE_BLOCK
-0000045: 04 ; num expressions
-0000046: 01 ; OPCODE_BLOCK
-0000047: 01 ; num expressions
-0000048: 08 ; OPCODE_BR_TABLE
-0000049: 02 ; num targets
-000004a: 0000 0000 ; break depth
-000004e: 0100 0000 ; break depth
-0000052: 0000 0000 ; break depth for default
-0000056: 0a ; OPCODE_I32_CONST
-0000057: 00 ; i32 literal
-0000058: 0a ; OPCODE_I32_CONST
-0000059: 01 ; i32 literal
-000005a: 0a ; OPCODE_I32_CONST
-000005b: 02 ; i32 literal
-000005c: 06 ; OPCODE_BR
-000005d: 01 ; break depth
-000005e: 00 ; OPCODE_NOP
-000005f: 0a ; OPCODE_I32_CONST
-0000060: 03 ; i32 literal
-0000040: 20 ; FIXUP func body size
-000002e: 32 ; FIXUP section size
+0000025: 00 ; func body size (guess)
+0000026: 00 ; local decl count
+0000027: 01 ; OPCODE_BLOCK
+0000028: 01 ; OPCODE_BLOCK
+0000029: 01 ; OPCODE_BLOCK
+000002a: 00 ; OPCODE_NOP
+000002b: 10 ; OPCODE_I32_CONST
+000002c: 00 ; i32 literal
+000002d: 08 ; OPCODE_BR_TABLE
+000002e: 02 ; num targets
+000002f: 0000 0000 ; break depth
+0000033: 0100 0000 ; break depth
+0000037: 0000 0000 ; break depth for default
+000003b: 0f ; OPCODE_END
+000003c: 10 ; OPCODE_I32_CONST
+000003d: 01 ; i32 literal
+000003e: 10 ; OPCODE_I32_CONST
+000003f: 02 ; i32 literal
+0000040: 00 ; OPCODE_NOP
+0000041: 06 ; OPCODE_BR
+0000042: 01 ; break depth
+0000043: 0f ; OPCODE_END
+0000044: 0f ; OPCODE_END
+0000045: 10 ; OPCODE_I32_CONST
+0000046: 03 ; i32 literal
+0000025: 21 ; FIXUP func body size
+0000023: 23 ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0e0a 7369 676e 6174
-0000010: 7572 6573 0100 0016 1366 756e 6374 696f
-0000020: 6e5f 7369 676e 6174 7572 6573 0100 320f
-0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 7301
-0000040: 2000 0101 0104 0101 0802 0000 0000 0100
-0000050: 0000 0000 0000 0a00 0a01 0a02 0601 000a
-0000060: 03
+0000000: 0061 736d 0b00 0000 0474 7970 6504 0140
+0000010: 0000 0866 756e 6374 696f 6e02 0100 0463
+0000020: 6f64 6523 0121 0001 0101 0010 0008 0200
+0000030: 0000 0001 0000 0000 0000 000f 1001 1002
+0000040: 0006 010f 0f10 03
;;; STDOUT ;;)
diff --git a/test/dump/call.txt b/test/dump/call.txt
index 5f748e79..d84fa0c4 100644
--- a/test/dump/call.txt
+++ b/test/dump/call.txt
@@ -4,43 +4,41 @@
(call 0 (i32.const 1))))
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
-0000004: 0a00 0000 ; WASM_BINARY_VERSION
-; section "signatures"
-0000008: 00 ; section size (guess)
-0000009: 0a ; string length
-000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
-0000014: 01 ; num signatures
-; signature 0
-0000015: 01 ; num params
-0000016: 00 ; result_type
-0000017: 01 ; param type
-0000008: 0f ; FIXUP section size
-; section "function_signatures"
-0000018: 00 ; section size (guess)
-0000019: 13 ; string length
-000001a: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
-000002a: 7265 73 ; section id: "function_signatures"
-000002d: 01 ; num functions
-000002e: 00 ; function 0 signature index
-0000018: 16 ; FIXUP section size
-; section "function_bodies"
-000002f: 00 ; section size (guess)
-0000030: 0f ; string length
-0000031: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
-0000040: 01 ; num functions
+0000004: 0b00 0000 ; WASM_BINARY_VERSION
+; section "type"
+0000008: 04 ; string length
+0000009: 7479 7065 ; section id: "type"
+000000d: 00 ; section size (guess)
+000000e: 01 ; num types
+; type 0
+000000f: 40 ; function form
+0000010: 01 ; num params
+0000011: 01 ; param type
+0000012: 00 ; num results
+000000d: 05 ; FIXUP section size
+; section "function"
+0000013: 08 ; string length
+0000014: 6675 6e63 7469 6f6e ; section id: "function"
+000001c: 00 ; section size (guess)
+000001d: 01 ; num functions
+000001e: 00 ; function 0 signature index
+000001c: 02 ; FIXUP section size
+; section "code"
+000001f: 04 ; string length
+0000020: 636f 6465 ; section id: "code"
+0000024: 00 ; section size (guess)
+0000025: 01 ; num functions
; function body 0
-0000041: 00 ; func body size (guess)
-0000042: 00 ; local decl count
-0000043: 12 ; OPCODE_CALL_FUNCTION
-0000044: 00 ; func index
-0000045: 0a ; OPCODE_I32_CONST
-0000046: 01 ; i32 literal
-0000041: 05 ; FIXUP func body size
-000002f: 17 ; FIXUP section size
+0000026: 00 ; func body size (guess)
+0000027: 00 ; local decl count
+0000028: 10 ; OPCODE_I32_CONST
+0000029: 01 ; i32 literal
+000002a: 16 ; OPCODE_CALL_FUNCTION
+000002b: 00 ; func index
+0000026: 05 ; FIXUP func body size
+0000024: 07 ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0f0a 7369 676e 6174
-0000010: 7572 6573 0101 0001 1613 6675 6e63 7469
-0000020: 6f6e 5f73 6967 6e61 7475 7265 7301 0017
-0000030: 0f66 756e 6374 696f 6e5f 626f 6469 6573
-0000040: 0105 0012 000a 01
+0000000: 0061 736d 0b00 0000 0474 7970 6505 0140
+0000010: 0101 0008 6675 6e63 7469 6f6e 0201 0004
+0000020: 636f 6465 0701 0500 1001 1600
;;; STDOUT ;;)
diff --git a/test/dump/callimport.txt b/test/dump/callimport.txt
index 5a2ff2d1..cad23b12 100644
--- a/test/dump/callimport.txt
+++ b/test/dump/callimport.txt
@@ -11,65 +11,66 @@
(call 0)))
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
-0000004: 0a00 0000 ; WASM_BINARY_VERSION
-; section "signatures"
-0000008: 00 ; section size (guess)
-0000009: 0a ; string length
-000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
-0000014: 02 ; num signatures
-; signature 0
-0000015: 02 ; num params
-0000016: 01 ; result_type
-0000017: 01 ; param type
-0000018: 03 ; param type
-; signature 1
-0000019: 00 ; num params
-000001a: 01 ; result_type
-0000008: 12 ; FIXUP section size
-; section "import_table"
-000001b: 00 ; section size (guess)
-000001c: 0c ; string length
-000001d: 696d 706f 7274 5f74 6162 6c65 ; section id: "import_table"
-0000029: 01 ; num imports
+0000004: 0b00 0000 ; WASM_BINARY_VERSION
+; section "type"
+0000008: 04 ; string length
+0000009: 7479 7065 ; section id: "type"
+000000d: 00 ; section size (guess)
+000000e: 02 ; num types
+; type 0
+000000f: 40 ; function form
+0000010: 02 ; num params
+0000011: 01 ; param type
+0000012: 03 ; param type
+0000013: 01 ; num results
+0000014: 01 ; result_type
+; type 1
+0000015: 40 ; function form
+0000016: 00 ; num params
+0000017: 01 ; num results
+0000018: 01 ; result_type
+000000d: 0b ; FIXUP section size
+; section "import"
+0000019: 06 ; string length
+000001a: 696d 706f 7274 ; section id: "import"
+0000020: 00 ; section size (guess)
+0000021: 01 ; num imports
; import header 0
-000002a: 00 ; import signature index
-000002b: 03 ; string length
-000002c: 666f 6f foo ; import module name
-000002f: 03 ; string length
-0000030: 6261 72 bar ; import function name
-000001b: 17 ; FIXUP section size
-; section "function_signatures"
-0000033: 00 ; section size (guess)
-0000034: 13 ; string length
-0000035: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
-0000045: 7265 73 ; section id: "function_signatures"
-0000048: 01 ; num functions
-0000049: 01 ; function 0 signature index
-0000033: 16 ; FIXUP section size
-; section "function_bodies"
-000004a: 00 ; section size (guess)
-000004b: 0f ; string length
-000004c: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
-000005b: 01 ; num functions
+0000022: 00 ; import signature index
+0000023: 03 ; string length
+0000024: 666f 6f foo ; import module name
+0000027: 03 ; string length
+0000028: 6261 72 bar ; import function name
+0000020: 0a ; FIXUP section size
+; section "function"
+000002b: 08 ; string length
+000002c: 6675 6e63 7469 6f6e ; section id: "function"
+0000034: 00 ; section size (guess)
+0000035: 01 ; num functions
+0000036: 01 ; function 0 signature index
+0000034: 02 ; FIXUP section size
+; section "code"
+0000037: 04 ; string length
+0000038: 636f 6465 ; section id: "code"
+000003c: 00 ; section size (guess)
+000003d: 01 ; num functions
; function body 0
-000005c: 00 ; func body size (guess)
-000005d: 00 ; local decl count
-000005e: 1f ; OPCODE_CALL_IMPORT
-000005f: 00 ; import index
-0000060: 0a ; OPCODE_I32_CONST
-0000061: 01 ; i32 literal
-0000062: 0d ; OPCODE_F32_CONST
-0000063: 0000 0040 ; f32 literal
-0000067: 12 ; OPCODE_CALL_FUNCTION
-0000068: 00 ; func index
-000005c: 0c ; FIXUP func body size
-000004a: 1e ; FIXUP section size
+000003e: 00 ; func body size (guess)
+000003f: 00 ; local decl count
+0000040: 10 ; OPCODE_I32_CONST
+0000041: 01 ; i32 literal
+0000042: 13 ; OPCODE_F32_CONST
+0000043: 0000 0040 ; f32 literal
+0000047: 18 ; OPCODE_CALL_IMPORT
+0000048: 00 ; import index
+0000049: 16 ; OPCODE_CALL_FUNCTION
+000004a: 00 ; func index
+000003e: 0c ; FIXUP func body size
+000003c: 0e ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 120a 7369 676e 6174
-0000010: 7572 6573 0202 0101 0300 0117 0c69 6d70
-0000020: 6f72 745f 7461 626c 6501 0003 666f 6f03
-0000030: 6261 7216 1366 756e 6374 696f 6e5f 7369
-0000040: 676e 6174 7572 6573 0101 1e0f 6675 6e63
-0000050: 7469 6f6e 5f62 6f64 6965 7301 0c00 1f00
-0000060: 0a01 0d00 0000 4012 00
+0000000: 0061 736d 0b00 0000 0474 7970 650b 0240
+0000010: 0201 0301 0140 0001 0106 696d 706f 7274
+0000020: 0a01 0003 666f 6f03 6261 7208 6675 6e63
+0000030: 7469 6f6e 0201 0104 636f 6465 0e01 0c00
+0000040: 1001 1300 0000 4018 0016 00
;;; STDOUT ;;)
diff --git a/test/dump/callindirect-after-import.txt b/test/dump/callindirect-after-import.txt
index ad63ebc7..b147d278 100644
--- a/test/dump/callindirect-after-import.txt
+++ b/test/dump/callindirect-after-import.txt
@@ -19,79 +19,80 @@
(table $indirect))
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
-0000004: 0a00 0000 ; WASM_BINARY_VERSION
-; section "signatures"
-0000008: 00 ; section size (guess)
-0000009: 0a ; string length
-000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
-0000014: 03 ; num signatures
-; signature 0
-0000015: 01 ; num params
-0000016: 00 ; result_type
-0000017: 03 ; param type
-; signature 1
+0000004: 0b00 0000 ; WASM_BINARY_VERSION
+; section "type"
+0000008: 04 ; string length
+0000009: 7479 7065 ; section id: "type"
+000000d: 00 ; section size (guess)
+000000e: 03 ; num types
+; type 0
+000000f: 40 ; function form
+0000010: 01 ; num params
+0000011: 03 ; param type
+0000012: 00 ; num results
+; type 1
+0000013: 40 ; function form
+0000014: 00 ; num params
+0000015: 01 ; num results
+0000016: 01 ; result_type
+; type 2
+0000017: 40 ; function form
0000018: 00 ; num params
-0000019: 01 ; result_type
-; signature 2
-000001a: 00 ; num params
-000001b: 00 ; result_type
-0000008: 13 ; FIXUP section size
-; section "import_table"
-000001c: 00 ; section size (guess)
-000001d: 0c ; string length
-000001e: 696d 706f 7274 5f74 6162 6c65 ; section id: "import_table"
-000002a: 01 ; num imports
+0000019: 00 ; num results
+000000d: 0c ; FIXUP section size
+; section "import"
+000001a: 06 ; string length
+000001b: 696d 706f 7274 ; section id: "import"
+0000021: 00 ; section size (guess)
+0000022: 01 ; num imports
; import header 0
-000002b: 01 ; import signature index
-000002c: 03 ; string length
-000002d: 666f 6f foo ; import module name
-0000030: 03 ; string length
-0000031: 6261 72 bar ; import function name
-000001c: 17 ; FIXUP section size
-; section "function_signatures"
-0000034: 00 ; section size (guess)
-0000035: 13 ; string length
-0000036: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
-0000046: 7265 73 ; section id: "function_signatures"
-0000049: 02 ; num functions
-000004a: 00 ; function 0 signature index
-000004b: 02 ; function 1 signature index
-0000034: 17 ; FIXUP section size
-; section "function_table"
-000004c: 00 ; section size (guess)
-000004d: 0e ; string length
-000004e: 6675 6e63 7469 6f6e 5f74 6162 6c65 ; section id: "function_table"
-000005c: 01 ; num function table entries
-000005d: 00 ; function table entry
-000004c: 11 ; FIXUP section size
-; section "function_bodies"
-000005e: 00 ; section size (guess)
-000005f: 0f ; string length
-0000060: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
-000006f: 02 ; num functions
+0000023: 01 ; import signature index
+0000024: 03 ; string length
+0000025: 666f 6f foo ; import module name
+0000028: 03 ; string length
+0000029: 6261 72 bar ; import function name
+0000021: 0a ; FIXUP section size
+; section "function"
+000002c: 08 ; string length
+000002d: 6675 6e63 7469 6f6e ; section id: "function"
+0000035: 00 ; section size (guess)
+0000036: 02 ; num functions
+0000037: 00 ; function 0 signature index
+0000038: 02 ; function 1 signature index
+0000035: 03 ; FIXUP section size
+; section "table"
+0000039: 05 ; string length
+000003a: 7461 626c 65 ; section id: "table"
+000003f: 00 ; section size (guess)
+0000040: 01 ; num function table entries
+0000041: 00 ; function table entry
+000003f: 02 ; FIXUP section size
+; section "code"
+0000042: 04 ; string length
+0000043: 636f 6465 ; section id: "code"
+0000047: 00 ; section size (guess)
+0000048: 02 ; num functions
; function body 0
-0000070: 00 ; func body size (guess)
-0000071: 00 ; local decl count
-0000072: 00 ; OPCODE_NOP
-0000070: 02 ; FIXUP func body size
+0000049: 00 ; func body size (guess)
+000004a: 00 ; local decl count
+000004b: 00 ; OPCODE_NOP
+0000049: 02 ; FIXUP func body size
; function body 1
-0000073: 00 ; func body size (guess)
-0000074: 00 ; local decl count
-0000075: 13 ; OPCODE_CALL_INDIRECT
-0000076: 00 ; signature index
-0000077: 0a ; OPCODE_I32_CONST
-0000078: 00 ; i32 literal
-0000079: 0d ; OPCODE_F32_CONST
-000007a: 0000 803f ; f32 literal
-0000073: 0a ; FIXUP func body size
-000005e: 1f ; FIXUP section size
+000004c: 00 ; func body size (guess)
+000004d: 00 ; local decl count
+000004e: 10 ; OPCODE_I32_CONST
+000004f: 00 ; i32 literal
+0000050: 13 ; OPCODE_F32_CONST
+0000051: 0000 803f ; f32 literal
+0000055: 17 ; OPCODE_CALL_INDIRECT
+0000056: 00 ; signature index
+000004c: 0a ; FIXUP func body size
+0000047: 0f ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 130a 7369 676e 6174
-0000010: 7572 6573 0301 0003 0001 0000 170c 696d
-0000020: 706f 7274 5f74 6162 6c65 0101 0366 6f6f
-0000030: 0362 6172 1713 6675 6e63 7469 6f6e 5f73
-0000040: 6967 6e61 7475 7265 7302 0002 110e 6675
-0000050: 6e63 7469 6f6e 5f74 6162 6c65 0100 1f0f
-0000060: 6675 6e63 7469 6f6e 5f62 6f64 6965 7302
-0000070: 0200 000a 0013 000a 000d 0000 803f
+0000000: 0061 736d 0b00 0000 0474 7970 650c 0340
+0000010: 0103 0040 0001 0140 0000 0669 6d70 6f72
+0000020: 740a 0101 0366 6f6f 0362 6172 0866 756e
+0000030: 6374 696f 6e03 0200 0205 7461 626c 6502
+0000040: 0100 0463 6f64 650f 0202 0000 0a00 1000
+0000050: 1300 0080 3f17 00
;;; STDOUT ;;)
diff --git a/test/dump/callindirect.txt b/test/dump/callindirect.txt
index a689e41b..5afdbc6d 100644
--- a/test/dump/callindirect.txt
+++ b/test/dump/callindirect.txt
@@ -6,53 +6,51 @@
(table $f))
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
-0000004: 0a00 0000 ; WASM_BINARY_VERSION
-; section "signatures"
-0000008: 00 ; section size (guess)
-0000009: 0a ; string length
-000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
-0000014: 01 ; num signatures
-; signature 0
-0000015: 01 ; num params
-0000016: 00 ; result_type
-0000017: 01 ; param type
-0000008: 0f ; FIXUP section size
-; section "function_signatures"
-0000018: 00 ; section size (guess)
-0000019: 13 ; string length
-000001a: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
-000002a: 7265 73 ; section id: "function_signatures"
-000002d: 01 ; num functions
-000002e: 00 ; function 0 signature index
-0000018: 16 ; FIXUP section size
-; section "function_table"
-000002f: 00 ; section size (guess)
-0000030: 0e ; string length
-0000031: 6675 6e63 7469 6f6e 5f74 6162 6c65 ; section id: "function_table"
-000003f: 01 ; num function table entries
-0000040: 00 ; function table entry
-000002f: 11 ; FIXUP section size
-; section "function_bodies"
-0000041: 00 ; section size (guess)
-0000042: 0f ; string length
-0000043: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
-0000052: 01 ; num functions
+0000004: 0b00 0000 ; WASM_BINARY_VERSION
+; section "type"
+0000008: 04 ; string length
+0000009: 7479 7065 ; section id: "type"
+000000d: 00 ; section size (guess)
+000000e: 01 ; num types
+; type 0
+000000f: 40 ; function form
+0000010: 01 ; num params
+0000011: 01 ; param type
+0000012: 00 ; num results
+000000d: 05 ; FIXUP section size
+; section "function"
+0000013: 08 ; string length
+0000014: 6675 6e63 7469 6f6e ; section id: "function"
+000001c: 00 ; section size (guess)
+000001d: 01 ; num functions
+000001e: 00 ; function 0 signature index
+000001c: 02 ; FIXUP section size
+; section "table"
+000001f: 05 ; string length
+0000020: 7461 626c 65 ; section id: "table"
+0000025: 00 ; section size (guess)
+0000026: 01 ; num function table entries
+0000027: 00 ; function table entry
+0000025: 02 ; FIXUP section size
+; section "code"
+0000028: 04 ; string length
+0000029: 636f 6465 ; section id: "code"
+000002d: 00 ; section size (guess)
+000002e: 01 ; num functions
; function body 0
-0000053: 00 ; func body size (guess)
-0000054: 00 ; local decl count
-0000055: 13 ; OPCODE_CALL_INDIRECT
-0000056: 00 ; signature index
-0000057: 0a ; OPCODE_I32_CONST
-0000058: 00 ; i32 literal
-0000059: 0a ; OPCODE_I32_CONST
-000005a: 00 ; i32 literal
-0000053: 07 ; FIXUP func body size
-0000041: 19 ; FIXUP section size
+000002f: 00 ; func body size (guess)
+0000030: 00 ; local decl count
+0000031: 10 ; OPCODE_I32_CONST
+0000032: 00 ; i32 literal
+0000033: 10 ; OPCODE_I32_CONST
+0000034: 00 ; i32 literal
+0000035: 17 ; OPCODE_CALL_INDIRECT
+0000036: 00 ; signature index
+000002f: 07 ; FIXUP func body size
+000002d: 09 ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0f0a 7369 676e 6174
-0000010: 7572 6573 0101 0001 1613 6675 6e63 7469
-0000020: 6f6e 5f73 6967 6e61 7475 7265 7301 0011
-0000030: 0e66 756e 6374 696f 6e5f 7461 626c 6501
-0000040: 0019 0f66 756e 6374 696f 6e5f 626f 6469
-0000050: 6573 0107 0013 000a 000a 00
+0000000: 0061 736d 0b00 0000 0474 7970 6505 0140
+0000010: 0101 0008 6675 6e63 7469 6f6e 0201 0005
+0000020: 7461 626c 6502 0100 0463 6f64 6509 0107
+0000030: 0010 0010 0017 00
;;; STDOUT ;;)
diff --git a/test/dump/cast.txt b/test/dump/cast.txt
index 0e5a0493..249f7c3c 100644
--- a/test/dump/cast.txt
+++ b/test/dump/cast.txt
@@ -8,51 +8,49 @@
(i64.reinterpret/f64 (f64.const 0))))
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
-0000004: 0a00 0000 ; WASM_BINARY_VERSION
-; section "signatures"
-0000008: 00 ; section size (guess)
-0000009: 0a ; string length
-000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
-0000014: 01 ; num signatures
-; signature 0
-0000015: 00 ; num params
-0000016: 00 ; result_type
-0000008: 0e ; FIXUP section size
-; section "function_signatures"
-0000017: 00 ; section size (guess)
-0000018: 13 ; string length
-0000019: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
-0000029: 7265 73 ; section id: "function_signatures"
-000002c: 01 ; num functions
-000002d: 00 ; function 0 signature index
-0000017: 16 ; FIXUP section size
-; section "function_bodies"
-000002e: 00 ; section size (guess)
-000002f: 0f ; string length
-0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
-000003f: 01 ; num functions
+0000004: 0b00 0000 ; WASM_BINARY_VERSION
+; section "type"
+0000008: 04 ; string length
+0000009: 7479 7065 ; section id: "type"
+000000d: 00 ; section size (guess)
+000000e: 01 ; num types
+; type 0
+000000f: 40 ; function form
+0000010: 00 ; num params
+0000011: 00 ; num results
+000000d: 04 ; FIXUP section size
+; section "function"
+0000012: 08 ; string length
+0000013: 6675 6e63 7469 6f6e ; section id: "function"
+000001b: 00 ; section size (guess)
+000001c: 01 ; num functions
+000001d: 00 ; function 0 signature index
+000001b: 02 ; FIXUP section size
+; section "code"
+000001e: 04 ; string length
+000001f: 636f 6465 ; section id: "code"
+0000023: 00 ; section size (guess)
+0000024: 01 ; num functions
; function body 0
-0000040: 00 ; func body size (guess)
-0000041: 00 ; local decl count
-0000042: ad ; OPCODE_F32_REINTERPRET_I32
-0000043: 0a ; OPCODE_I32_CONST
-0000044: 00 ; i32 literal
-0000045: b4 ; OPCODE_I32_REINTERPRET_F32
-0000046: 0d ; OPCODE_F32_CONST
-0000047: 0000 0000 ; f32 literal
-000004b: b3 ; OPCODE_F64_REINTERPRET_I64
-000004c: 0b ; OPCODE_I64_CONST
-000004d: 00 ; i64 literal
-000004e: b5 ; OPCODE_I64_REINTERPRET_F64
-000004f: 0c ; OPCODE_F64_CONST
-0000050: 0000 0000 0000 0000 ; f64 literal
-0000040: 17 ; FIXUP func body size
-000002e: 29 ; FIXUP section size
+0000025: 00 ; func body size (guess)
+0000026: 00 ; local decl count
+0000027: 10 ; OPCODE_I32_CONST
+0000028: 00 ; i32 literal
+0000029: ad ; OPCODE_F32_REINTERPRET_I32
+000002a: 13 ; OPCODE_F32_CONST
+000002b: 0000 0000 ; f32 literal
+000002f: b4 ; OPCODE_I32_REINTERPRET_F32
+0000030: 11 ; OPCODE_I64_CONST
+0000031: 00 ; i64 literal
+0000032: b3 ; OPCODE_F64_REINTERPRET_I64
+0000033: 12 ; OPCODE_F64_CONST
+0000034: 0000 0000 0000 0000 ; f64 literal
+000003c: b5 ; OPCODE_I64_REINTERPRET_F64
+0000025: 17 ; FIXUP func body size
+0000023: 19 ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0e0a 7369 676e 6174
-0000010: 7572 6573 0100 0016 1366 756e 6374 696f
-0000020: 6e5f 7369 676e 6174 7572 6573 0100 290f
-0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 7301
-0000040: 1700 ad0a 00b4 0d00 0000 00b3 0b00 b50c
-0000050: 0000 0000 0000 0000
+0000000: 0061 736d 0b00 0000 0474 7970 6504 0140
+0000010: 0000 0866 756e 6374 696f 6e02 0100 0463
+0000020: 6f64 6519 0117 0010 00ad 1300 0000 00b4
+0000030: 1100 b312 0000 0000 0000 0000 b5
;;; STDOUT ;;)
diff --git a/test/dump/compare.txt b/test/dump/compare.txt
index a575d0d0..e47a36af 100644
--- a/test/dump/compare.txt
+++ b/test/dump/compare.txt
@@ -51,198 +51,196 @@
(f64.ge (f64.const 0) (f64.const 0))))
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
-0000004: 0a00 0000 ; WASM_BINARY_VERSION
-; section "signatures"
-0000008: 00 ; section size (guess)
-0000009: 0a ; string length
-000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
-0000014: 01 ; num signatures
-; signature 0
-0000015: 00 ; num params
-0000016: 00 ; result_type
-0000008: 0e ; FIXUP section size
-; section "function_signatures"
-0000017: 00 ; section size (guess)
-0000018: 13 ; string length
-0000019: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
-0000029: 7265 73 ; section id: "function_signatures"
-000002c: 01 ; num functions
-000002d: 00 ; function 0 signature index
-0000017: 16 ; FIXUP section size
-; section "function_bodies"
-000002e: 00 ; section size (guess)
-000002f: 0f ; string length
-0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
-000003f: 01 ; num functions
+0000004: 0b00 0000 ; WASM_BINARY_VERSION
+; section "type"
+0000008: 04 ; string length
+0000009: 7479 7065 ; section id: "type"
+000000d: 00 ; section size (guess)
+000000e: 01 ; num types
+; type 0
+000000f: 40 ; function form
+0000010: 00 ; num params
+0000011: 00 ; num results
+000000d: 04 ; FIXUP section size
+; section "function"
+0000012: 08 ; string length
+0000013: 6675 6e63 7469 6f6e ; section id: "function"
+000001b: 00 ; section size (guess)
+000001c: 01 ; num functions
+000001d: 00 ; function 0 signature index
+000001b: 02 ; FIXUP section size
+; section "code"
+000001e: 04 ; string length
+000001f: 636f 6465 ; section id: "code"
+0000023: 00 ; section size (guess)
+0000024: 01 ; num functions
; function body 0
-0000040: 00 ; func body size (guess)
-0000041: 00 ; local decl count
-0000042: 4d ; OPCODE_I32_EQ
+0000025: 00 ; func body size (guess)
+0000026: 00 ; local decl count
+0000027: 10 ; OPCODE_I32_CONST
+0000028: 00 ; i32 literal
+0000029: 10 ; OPCODE_I32_CONST
+000002a: 00 ; i32 literal
+000002b: 56 ; OPCODE_I32_GE_U
+000002c: 10 ; OPCODE_I32_CONST
+000002d: 00 ; i32 literal
+000002e: 54 ; OPCODE_I32_GE_S
+000002f: 10 ; OPCODE_I32_CONST
+0000030: 00 ; i32 literal
+0000031: 55 ; OPCODE_I32_GT_U
+0000032: 10 ; OPCODE_I32_CONST
+0000033: 00 ; i32 literal
+0000034: 53 ; OPCODE_I32_GT_S
+0000035: 10 ; OPCODE_I32_CONST
+0000036: 00 ; i32 literal
+0000037: 52 ; OPCODE_I32_LE_U
+0000038: 10 ; OPCODE_I32_CONST
+0000039: 00 ; i32 literal
+000003a: 50 ; OPCODE_I32_LE_S
+000003b: 10 ; OPCODE_I32_CONST
+000003c: 00 ; i32 literal
+000003d: 51 ; OPCODE_I32_LT_U
+000003e: 10 ; OPCODE_I32_CONST
+000003f: 00 ; i32 literal
+0000040: 4f ; OPCODE_I32_LT_S
+0000041: 10 ; OPCODE_I32_CONST
+0000042: 00 ; i32 literal
0000043: 4e ; OPCODE_I32_NE
-0000044: 4f ; OPCODE_I32_LT_S
-0000045: 51 ; OPCODE_I32_LT_U
-0000046: 50 ; OPCODE_I32_LE_S
-0000047: 52 ; OPCODE_I32_LE_U
-0000048: 53 ; OPCODE_I32_GT_S
-0000049: 55 ; OPCODE_I32_GT_U
-000004a: 54 ; OPCODE_I32_GE_S
-000004b: 56 ; OPCODE_I32_GE_U
-000004c: 0a ; OPCODE_I32_CONST
-000004d: 00 ; i32 literal
-000004e: 0a ; OPCODE_I32_CONST
-000004f: 00 ; i32 literal
-0000050: 0a ; OPCODE_I32_CONST
-0000051: 00 ; i32 literal
-0000052: 0a ; OPCODE_I32_CONST
-0000053: 00 ; i32 literal
-0000054: 0a ; OPCODE_I32_CONST
-0000055: 00 ; i32 literal
-0000056: 0a ; OPCODE_I32_CONST
-0000057: 00 ; i32 literal
-0000058: 0a ; OPCODE_I32_CONST
-0000059: 00 ; i32 literal
-000005a: 0a ; OPCODE_I32_CONST
-000005b: 00 ; i32 literal
-000005c: 0a ; OPCODE_I32_CONST
-000005d: 00 ; i32 literal
-000005e: 0a ; OPCODE_I32_CONST
-000005f: 00 ; i32 literal
-0000060: 0a ; OPCODE_I32_CONST
-0000061: 00 ; i32 literal
-0000062: 68 ; OPCODE_I64_EQ
-0000063: 0b ; OPCODE_I64_CONST
-0000064: 00 ; i64 literal
-0000065: 0b ; OPCODE_I64_CONST
+0000044: 10 ; OPCODE_I32_CONST
+0000045: 00 ; i32 literal
+0000046: 4d ; OPCODE_I32_EQ
+0000047: 11 ; OPCODE_I64_CONST
+0000048: 00 ; i64 literal
+0000049: 11 ; OPCODE_I64_CONST
+000004a: 00 ; i64 literal
+000004b: 68 ; OPCODE_I64_EQ
+000004c: 11 ; OPCODE_I64_CONST
+000004d: 00 ; i64 literal
+000004e: 11 ; OPCODE_I64_CONST
+000004f: 00 ; i64 literal
+0000050: 69 ; OPCODE_I64_NE
+0000051: 11 ; OPCODE_I64_CONST
+0000052: 00 ; i64 literal
+0000053: 11 ; OPCODE_I64_CONST
+0000054: 00 ; i64 literal
+0000055: 6a ; OPCODE_I64_LT_S
+0000056: 11 ; OPCODE_I64_CONST
+0000057: 00 ; i64 literal
+0000058: 11 ; OPCODE_I64_CONST
+0000059: 00 ; i64 literal
+000005a: 6c ; OPCODE_I64_LT_U
+000005b: 11 ; OPCODE_I64_CONST
+000005c: 00 ; i64 literal
+000005d: 11 ; OPCODE_I64_CONST
+000005e: 00 ; i64 literal
+000005f: 6b ; OPCODE_I64_LE_S
+0000060: 11 ; OPCODE_I64_CONST
+0000061: 00 ; i64 literal
+0000062: 11 ; OPCODE_I64_CONST
+0000063: 00 ; i64 literal
+0000064: 6d ; OPCODE_I64_LE_U
+0000065: 11 ; OPCODE_I64_CONST
0000066: 00 ; i64 literal
-0000067: 69 ; OPCODE_I64_NE
-0000068: 0b ; OPCODE_I64_CONST
-0000069: 00 ; i64 literal
-000006a: 0b ; OPCODE_I64_CONST
+0000067: 11 ; OPCODE_I64_CONST
+0000068: 00 ; i64 literal
+0000069: 6e ; OPCODE_I64_GT_S
+000006a: 11 ; OPCODE_I64_CONST
000006b: 00 ; i64 literal
-000006c: 6a ; OPCODE_I64_LT_S
-000006d: 0b ; OPCODE_I64_CONST
-000006e: 00 ; i64 literal
-000006f: 0b ; OPCODE_I64_CONST
+000006c: 11 ; OPCODE_I64_CONST
+000006d: 00 ; i64 literal
+000006e: 70 ; OPCODE_I64_GT_U
+000006f: 11 ; OPCODE_I64_CONST
0000070: 00 ; i64 literal
-0000071: 6c ; OPCODE_I64_LT_U
-0000072: 0b ; OPCODE_I64_CONST
-0000073: 00 ; i64 literal
-0000074: 0b ; OPCODE_I64_CONST
+0000071: 11 ; OPCODE_I64_CONST
+0000072: 00 ; i64 literal
+0000073: 6f ; OPCODE_I64_GE_S
+0000074: 11 ; OPCODE_I64_CONST
0000075: 00 ; i64 literal
-0000076: 6b ; OPCODE_I64_LE_S
-0000077: 0b ; OPCODE_I64_CONST
-0000078: 00 ; i64 literal
-0000079: 0b ; OPCODE_I64_CONST
-000007a: 00 ; i64 literal
-000007b: 6d ; OPCODE_I64_LE_U
-000007c: 0b ; OPCODE_I64_CONST
-000007d: 00 ; i64 literal
-000007e: 0b ; OPCODE_I64_CONST
-000007f: 00 ; i64 literal
-0000080: 6e ; OPCODE_I64_GT_S
-0000081: 0b ; OPCODE_I64_CONST
-0000082: 00 ; i64 literal
-0000083: 0b ; OPCODE_I64_CONST
-0000084: 00 ; i64 literal
-0000085: 70 ; OPCODE_I64_GT_U
-0000086: 0b ; OPCODE_I64_CONST
-0000087: 00 ; i64 literal
-0000088: 0b ; OPCODE_I64_CONST
-0000089: 00 ; i64 literal
-000008a: 6f ; OPCODE_I64_GE_S
-000008b: 0b ; OPCODE_I64_CONST
-000008c: 00 ; i64 literal
-000008d: 0b ; OPCODE_I64_CONST
-000008e: 00 ; i64 literal
-000008f: 71 ; OPCODE_I64_GE_U
-0000090: 0b ; OPCODE_I64_CONST
-0000091: 00 ; i64 literal
-0000092: 0b ; OPCODE_I64_CONST
-0000093: 00 ; i64 literal
-0000094: 83 ; OPCODE_F32_EQ
-0000095: 0d ; OPCODE_F32_CONST
-0000096: 0000 0000 ; f32 literal
-000009a: 0d ; OPCODE_F32_CONST
+0000076: 11 ; OPCODE_I64_CONST
+0000077: 00 ; i64 literal
+0000078: 71 ; OPCODE_I64_GE_U
+0000079: 13 ; OPCODE_F32_CONST
+000007a: 0000 0000 ; f32 literal
+000007e: 13 ; OPCODE_F32_CONST
+000007f: 0000 0000 ; f32 literal
+0000083: 83 ; OPCODE_F32_EQ
+0000084: 13 ; OPCODE_F32_CONST
+0000085: 0000 0000 ; f32 literal
+0000089: 13 ; OPCODE_F32_CONST
+000008a: 0000 0000 ; f32 literal
+000008e: 84 ; OPCODE_F32_NE
+000008f: 13 ; OPCODE_F32_CONST
+0000090: 0000 0000 ; f32 literal
+0000094: 13 ; OPCODE_F32_CONST
+0000095: 0000 0000 ; f32 literal
+0000099: 85 ; OPCODE_F32_LT
+000009a: 13 ; OPCODE_F32_CONST
000009b: 0000 0000 ; f32 literal
-000009f: 84 ; OPCODE_F32_NE
-00000a0: 0d ; OPCODE_F32_CONST
-00000a1: 0000 0000 ; f32 literal
-00000a5: 0d ; OPCODE_F32_CONST
+000009f: 13 ; OPCODE_F32_CONST
+00000a0: 0000 0000 ; f32 literal
+00000a4: 86 ; OPCODE_F32_LE
+00000a5: 13 ; OPCODE_F32_CONST
00000a6: 0000 0000 ; f32 literal
-00000aa: 85 ; OPCODE_F32_LT
-00000ab: 0d ; OPCODE_F32_CONST
-00000ac: 0000 0000 ; f32 literal
-00000b0: 0d ; OPCODE_F32_CONST
+00000aa: 13 ; OPCODE_F32_CONST
+00000ab: 0000 0000 ; f32 literal
+00000af: 87 ; OPCODE_F32_GT
+00000b0: 13 ; OPCODE_F32_CONST
00000b1: 0000 0000 ; f32 literal
-00000b5: 86 ; OPCODE_F32_LE
-00000b6: 0d ; OPCODE_F32_CONST
-00000b7: 0000 0000 ; f32 literal
-00000bb: 0d ; OPCODE_F32_CONST
-00000bc: 0000 0000 ; f32 literal
-00000c0: 87 ; OPCODE_F32_GT
-00000c1: 0d ; OPCODE_F32_CONST
-00000c2: 0000 0000 ; f32 literal
-00000c6: 0d ; OPCODE_F32_CONST
-00000c7: 0000 0000 ; f32 literal
-00000cb: 88 ; OPCODE_F32_GE
-00000cc: 0d ; OPCODE_F32_CONST
-00000cd: 0000 0000 ; f32 literal
-00000d1: 0d ; OPCODE_F32_CONST
-00000d2: 0000 0000 ; f32 literal
-00000d6: 97 ; OPCODE_F64_EQ
-00000d7: 0c ; OPCODE_F64_CONST
+00000b5: 13 ; OPCODE_F32_CONST
+00000b6: 0000 0000 ; f32 literal
+00000ba: 88 ; OPCODE_F32_GE
+00000bb: 12 ; OPCODE_F64_CONST
+00000bc: 0000 0000 0000 0000 ; f64 literal
+00000c4: 12 ; OPCODE_F64_CONST
+00000c5: 0000 0000 0000 0000 ; f64 literal
+00000cd: 97 ; OPCODE_F64_EQ
+00000ce: 12 ; OPCODE_F64_CONST
+00000cf: 0000 0000 0000 0000 ; f64 literal
+00000d7: 12 ; OPCODE_F64_CONST
00000d8: 0000 0000 0000 0000 ; f64 literal
-00000e0: 0c ; OPCODE_F64_CONST
-00000e1: 0000 0000 0000 0000 ; f64 literal
-00000e9: 98 ; OPCODE_F64_NE
-00000ea: 0c ; OPCODE_F64_CONST
+00000e0: 98 ; OPCODE_F64_NE
+00000e1: 12 ; OPCODE_F64_CONST
+00000e2: 0000 0000 0000 0000 ; f64 literal
+00000ea: 12 ; OPCODE_F64_CONST
00000eb: 0000 0000 0000 0000 ; f64 literal
-00000f3: 0c ; OPCODE_F64_CONST
-00000f4: 0000 0000 0000 0000 ; f64 literal
-00000fc: 99 ; OPCODE_F64_LT
-00000fd: 0c ; OPCODE_F64_CONST
+00000f3: 99 ; OPCODE_F64_LT
+00000f4: 12 ; OPCODE_F64_CONST
+00000f5: 0000 0000 0000 0000 ; f64 literal
+00000fd: 12 ; OPCODE_F64_CONST
00000fe: 0000 0000 0000 0000 ; f64 literal
-0000106: 0c ; OPCODE_F64_CONST
-0000107: 0000 0000 0000 0000 ; f64 literal
-000010f: 9a ; OPCODE_F64_LE
-0000110: 0c ; OPCODE_F64_CONST
+0000106: 9a ; OPCODE_F64_LE
+0000107: 12 ; OPCODE_F64_CONST
+0000108: 0000 0000 0000 0000 ; f64 literal
+0000110: 12 ; OPCODE_F64_CONST
0000111: 0000 0000 0000 0000 ; f64 literal
-0000119: 0c ; OPCODE_F64_CONST
-000011a: 0000 0000 0000 0000 ; f64 literal
-0000122: 9b ; OPCODE_F64_GT
-0000123: 0c ; OPCODE_F64_CONST
+0000119: 9b ; OPCODE_F64_GT
+000011a: 12 ; OPCODE_F64_CONST
+000011b: 0000 0000 0000 0000 ; f64 literal
+0000123: 12 ; OPCODE_F64_CONST
0000124: 0000 0000 0000 0000 ; f64 literal
-000012c: 0c ; OPCODE_F64_CONST
-000012d: 0000 0000 0000 0000 ; f64 literal
-0000135: 9c ; OPCODE_F64_GE
-0000136: 0c ; OPCODE_F64_CONST
-0000137: 0000 0000 0000 0000 ; f64 literal
-000013f: 0c ; OPCODE_F64_CONST
-0000140: 0000 0000 0000 0000 ; f64 literal
-; move data: [41, 148) -> [42, 149)
-0000040: 8702 ; FIXUP func body size
-; move data: [2f, 149) -> [30, 14a)
-000002e: 9a02 ; FIXUP section size
+000012c: 9c ; OPCODE_F64_GE
+; move data: [26, 12d) -> [27, 12e)
+0000025: 8702 ; FIXUP func body size
+; move data: [24, 12e) -> [25, 12f)
+0000023: 8a02 ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0e0a 7369 676e 6174
-0000010: 7572 6573 0100 0016 1366 756e 6374 696f
-0000020: 6e5f 7369 676e 6174 7572 6573 0100 9a02
-0000030: 0f66 756e 6374 696f 6e5f 626f 6469 6573
-0000040: 0187 0200 4d4e 4f51 5052 5355 5456 0a00
-0000050: 0a00 0a00 0a00 0a00 0a00 0a00 0a00 0a00
-0000060: 0a00 0a00 680b 000b 0069 0b00 0b00 6a0b
-0000070: 000b 006c 0b00 0b00 6b0b 000b 006d 0b00
-0000080: 0b00 6e0b 000b 0070 0b00 0b00 6f0b 000b
-0000090: 0071 0b00 0b00 830d 0000 0000 0d00 0000
-00000a0: 0084 0d00 0000 000d 0000 0000 850d 0000
-00000b0: 0000 0d00 0000 0086 0d00 0000 000d 0000
-00000c0: 0000 870d 0000 0000 0d00 0000 0088 0d00
-00000d0: 0000 000d 0000 0000 970c 0000 0000 0000
-00000e0: 0000 0c00 0000 0000 0000 0098 0c00 0000
-00000f0: 0000 0000 000c 0000 0000 0000 0000 990c
-0000100: 0000 0000 0000 0000 0c00 0000 0000 0000
-0000110: 009a 0c00 0000 0000 0000 000c 0000 0000
-0000120: 0000 0000 9b0c 0000 0000 0000 0000 0c00
-0000130: 0000 0000 0000 009c 0c00 0000 0000 0000
-0000140: 000c 0000 0000 0000 0000
+0000000: 0061 736d 0b00 0000 0474 7970 6504 0140
+0000010: 0000 0866 756e 6374 696f 6e02 0100 0463
+0000020: 6f64 658a 0201 8702 0010 0010 0056 1000
+0000030: 5410 0055 1000 5310 0052 1000 5010 0051
+0000040: 1000 4f10 004e 1000 4d11 0011 0068 1100
+0000050: 1100 6911 0011 006a 1100 1100 6c11 0011
+0000060: 006b 1100 1100 6d11 0011 006e 1100 1100
+0000070: 7011 0011 006f 1100 1100 7113 0000 0000
+0000080: 1300 0000 0083 1300 0000 0013 0000 0000
+0000090: 8413 0000 0000 1300 0000 0085 1300 0000
+00000a0: 0013 0000 0000 8613 0000 0000 1300 0000
+00000b0: 0087 1300 0000 0013 0000 0000 8812 0000
+00000c0: 0000 0000 0000 1200 0000 0000 0000 0097
+00000d0: 1200 0000 0000 0000 0012 0000 0000 0000
+00000e0: 0000 9812 0000 0000 0000 0000 1200 0000
+00000f0: 0000 0000 0099 1200 0000 0000 0000 0012
+0000100: 0000 0000 0000 0000 9a12 0000 0000 0000
+0000110: 0000 1200 0000 0000 0000 009b 1200 0000
+0000120: 0000 0000 0012 0000 0000 0000 0000 9c
;;; STDOUT ;;)
diff --git a/test/dump/const.txt b/test/dump/const.txt
index bbe39cb4..c8695fbf 100644
--- a/test/dump/const.txt
+++ b/test/dump/const.txt
@@ -44,131 +44,129 @@
(f64.const 0x1.921fb54442d18p+2)))
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
-0000004: 0a00 0000 ; WASM_BINARY_VERSION
-; section "signatures"
-0000008: 00 ; section size (guess)
-0000009: 0a ; string length
-000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
-0000014: 01 ; num signatures
-; signature 0
-0000015: 00 ; num params
-0000016: 00 ; result_type
-0000008: 0e ; FIXUP section size
-; section "function_signatures"
-0000017: 00 ; section size (guess)
-0000018: 13 ; string length
-0000019: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
-0000029: 7265 73 ; section id: "function_signatures"
-000002c: 01 ; num functions
-000002d: 00 ; function 0 signature index
-0000017: 16 ; FIXUP section size
-; section "function_bodies"
-000002e: 00 ; section size (guess)
-000002f: 0f ; string length
-0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
-000003f: 01 ; num functions
+0000004: 0b00 0000 ; WASM_BINARY_VERSION
+; section "type"
+0000008: 04 ; string length
+0000009: 7479 7065 ; section id: "type"
+000000d: 00 ; section size (guess)
+000000e: 01 ; num types
+; type 0
+000000f: 40 ; function form
+0000010: 00 ; num params
+0000011: 00 ; num results
+000000d: 04 ; FIXUP section size
+; section "function"
+0000012: 08 ; string length
+0000013: 6675 6e63 7469 6f6e ; section id: "function"
+000001b: 00 ; section size (guess)
+000001c: 01 ; num functions
+000001d: 00 ; function 0 signature index
+000001b: 02 ; FIXUP section size
+; section "code"
+000001e: 04 ; string length
+000001f: 636f 6465 ; section id: "code"
+0000023: 00 ; section size (guess)
+0000024: 01 ; num functions
; function body 0
-0000040: 00 ; func body size (guess)
-0000041: 00 ; local decl count
-0000042: 0a ; OPCODE_I32_CONST
-0000043: 00 ; i32 literal
-0000044: 0a ; OPCODE_I32_CONST
-0000045: 8080 8080 78 ; i32 literal
-000004a: 0a ; OPCODE_I32_CONST
-000004b: 7f ; i32 literal
-000004c: 0a ; OPCODE_I32_CONST
-000004d: 8080 8080 78 ; i32 literal
-0000052: 0a ; OPCODE_I32_CONST
-0000053: 7f ; i32 literal
-0000054: 0b ; OPCODE_I64_CONST
-0000055: 00 ; i64 literal
-0000056: 0b ; OPCODE_I64_CONST
-0000057: 8080 8080 8080 8080 807f ; i64 literal
-0000061: 0b ; OPCODE_I64_CONST
-0000062: 7f ; i64 literal
-0000063: 0b ; OPCODE_I64_CONST
-0000064: 8080 8080 8080 8080 807f ; i64 literal
-000006e: 0b ; OPCODE_I64_CONST
-000006f: 7f ; i64 literal
-0000070: 0d ; OPCODE_F32_CONST
-0000071: 0000 0000 ; f32 literal
-0000075: 0d ; OPCODE_F32_CONST
-0000076: 1668 a965 ; f32 literal
-000007a: 0d ; OPCODE_F32_CONST
-000007b: 4020 4f37 ; f32 literal
-000007f: 0d ; OPCODE_F32_CONST
-0000080: 0000 c07f ; f32 literal
-0000084: 0d ; OPCODE_F32_CONST
-0000085: 0000 c0ff ; f32 literal
-0000089: 0d ; OPCODE_F32_CONST
-000008a: 0000 c07f ; f32 literal
-000008e: 0d ; OPCODE_F32_CONST
-000008f: bc0a 807f ; f32 literal
-0000093: 0d ; OPCODE_F32_CONST
-0000094: bc0a 80ff ; f32 literal
-0000098: 0d ; OPCODE_F32_CONST
-0000099: bc0a 807f ; f32 literal
-000009d: 0d ; OPCODE_F32_CONST
-000009e: 0000 807f ; f32 literal
-00000a2: 0d ; OPCODE_F32_CONST
-00000a3: 0000 80ff ; f32 literal
-00000a7: 0d ; OPCODE_F32_CONST
-00000a8: 0000 807f ; f32 literal
-00000ac: 0d ; OPCODE_F32_CONST
-00000ad: 0000 00bf ; f32 literal
-00000b1: 0d ; OPCODE_F32_CONST
-00000b2: db0f c940 ; f32 literal
-00000b6: 0c ; OPCODE_F64_CONST
-00000b7: 0000 0000 0000 0000 ; f64 literal
-00000bf: 0c ; OPCODE_F64_CONST
-00000c0: b856 0e3c dd9a efbf ; f64 literal
-00000c8: 0c ; OPCODE_F64_CONST
-00000c9: 182d 4454 fb21 1940 ; f64 literal
-00000d1: 0c ; OPCODE_F64_CONST
-00000d2: 0000 0000 0000 f87f ; f64 literal
-00000da: 0c ; OPCODE_F64_CONST
-00000db: 0000 0000 0000 f8ff ; f64 literal
-00000e3: 0c ; OPCODE_F64_CONST
-00000e4: 0000 0000 0000 f87f ; f64 literal
-00000ec: 0c ; OPCODE_F64_CONST
-00000ed: bc0a 0000 0000 f07f ; f64 literal
-00000f5: 0c ; OPCODE_F64_CONST
-00000f6: bc0a 0000 0000 f0ff ; f64 literal
-00000fe: 0c ; OPCODE_F64_CONST
-00000ff: bc0a 0000 0000 f07f ; f64 literal
-0000107: 0c ; OPCODE_F64_CONST
-0000108: 0000 0000 0000 f07f ; f64 literal
-0000110: 0c ; OPCODE_F64_CONST
-0000111: 0000 0000 0000 f0ff ; f64 literal
-0000119: 0c ; OPCODE_F64_CONST
-000011a: 0000 0000 0000 f07f ; f64 literal
-0000122: 0c ; OPCODE_F64_CONST
-0000123: 0000 0000 0000 e0bf ; f64 literal
-000012b: 0c ; OPCODE_F64_CONST
-000012c: 182d 4454 fb21 1940 ; f64 literal
-; move data: [41, 134) -> [42, 135)
-0000040: f301 ; FIXUP func body size
-; move data: [2f, 135) -> [30, 136)
-000002e: 8602 ; FIXUP section size
+0000025: 00 ; func body size (guess)
+0000026: 00 ; local decl count
+0000027: 10 ; OPCODE_I32_CONST
+0000028: 00 ; i32 literal
+0000029: 10 ; OPCODE_I32_CONST
+000002a: 8080 8080 78 ; i32 literal
+000002f: 10 ; OPCODE_I32_CONST
+0000030: 7f ; i32 literal
+0000031: 10 ; OPCODE_I32_CONST
+0000032: 8080 8080 78 ; i32 literal
+0000037: 10 ; OPCODE_I32_CONST
+0000038: 7f ; i32 literal
+0000039: 11 ; OPCODE_I64_CONST
+000003a: 00 ; i64 literal
+000003b: 11 ; OPCODE_I64_CONST
+000003c: 8080 8080 8080 8080 807f ; i64 literal
+0000046: 11 ; OPCODE_I64_CONST
+0000047: 7f ; i64 literal
+0000048: 11 ; OPCODE_I64_CONST
+0000049: 8080 8080 8080 8080 807f ; i64 literal
+0000053: 11 ; OPCODE_I64_CONST
+0000054: 7f ; i64 literal
+0000055: 13 ; OPCODE_F32_CONST
+0000056: 0000 0000 ; f32 literal
+000005a: 13 ; OPCODE_F32_CONST
+000005b: 1668 a965 ; f32 literal
+000005f: 13 ; OPCODE_F32_CONST
+0000060: 4020 4f37 ; f32 literal
+0000064: 13 ; OPCODE_F32_CONST
+0000065: 0000 c07f ; f32 literal
+0000069: 13 ; OPCODE_F32_CONST
+000006a: 0000 c0ff ; f32 literal
+000006e: 13 ; OPCODE_F32_CONST
+000006f: 0000 c07f ; f32 literal
+0000073: 13 ; OPCODE_F32_CONST
+0000074: bc0a 807f ; f32 literal
+0000078: 13 ; OPCODE_F32_CONST
+0000079: bc0a 80ff ; f32 literal
+000007d: 13 ; OPCODE_F32_CONST
+000007e: bc0a 807f ; f32 literal
+0000082: 13 ; OPCODE_F32_CONST
+0000083: 0000 807f ; f32 literal
+0000087: 13 ; OPCODE_F32_CONST
+0000088: 0000 80ff ; f32 literal
+000008c: 13 ; OPCODE_F32_CONST
+000008d: 0000 807f ; f32 literal
+0000091: 13 ; OPCODE_F32_CONST
+0000092: 0000 00bf ; f32 literal
+0000096: 13 ; OPCODE_F32_CONST
+0000097: db0f c940 ; f32 literal
+000009b: 12 ; OPCODE_F64_CONST
+000009c: 0000 0000 0000 0000 ; f64 literal
+00000a4: 12 ; OPCODE_F64_CONST
+00000a5: b856 0e3c dd9a efbf ; f64 literal
+00000ad: 12 ; OPCODE_F64_CONST
+00000ae: 182d 4454 fb21 1940 ; f64 literal
+00000b6: 12 ; OPCODE_F64_CONST
+00000b7: 0000 0000 0000 f87f ; f64 literal
+00000bf: 12 ; OPCODE_F64_CONST
+00000c0: 0000 0000 0000 f8ff ; f64 literal
+00000c8: 12 ; OPCODE_F64_CONST
+00000c9: 0000 0000 0000 f87f ; f64 literal
+00000d1: 12 ; OPCODE_F64_CONST
+00000d2: bc0a 0000 0000 f07f ; f64 literal
+00000da: 12 ; OPCODE_F64_CONST
+00000db: bc0a 0000 0000 f0ff ; f64 literal
+00000e3: 12 ; OPCODE_F64_CONST
+00000e4: bc0a 0000 0000 f07f ; f64 literal
+00000ec: 12 ; OPCODE_F64_CONST
+00000ed: 0000 0000 0000 f07f ; f64 literal
+00000f5: 12 ; OPCODE_F64_CONST
+00000f6: 0000 0000 0000 f0ff ; f64 literal
+00000fe: 12 ; OPCODE_F64_CONST
+00000ff: 0000 0000 0000 f07f ; f64 literal
+0000107: 12 ; OPCODE_F64_CONST
+0000108: 0000 0000 0000 e0bf ; f64 literal
+0000110: 12 ; OPCODE_F64_CONST
+0000111: 182d 4454 fb21 1940 ; f64 literal
+; move data: [26, 119) -> [27, 11a)
+0000025: f301 ; FIXUP func body size
+; move data: [24, 11a) -> [25, 11b)
+0000023: f601 ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0e0a 7369 676e 6174
-0000010: 7572 6573 0100 0016 1366 756e 6374 696f
-0000020: 6e5f 7369 676e 6174 7572 6573 0100 8602
-0000030: 0f66 756e 6374 696f 6e5f 626f 6469 6573
-0000040: 01f3 0100 0a00 0a80 8080 8078 0a7f 0a80
-0000050: 8080 8078 0a7f 0b00 0b80 8080 8080 8080
-0000060: 8080 7f0b 7f0b 8080 8080 8080 8080 807f
-0000070: 0b7f 0d00 0000 000d 1668 a965 0d40 204f
-0000080: 370d 0000 c07f 0d00 00c0 ff0d 0000 c07f
-0000090: 0dbc 0a80 7f0d bc0a 80ff 0dbc 0a80 7f0d
-00000a0: 0000 807f 0d00 0080 ff0d 0000 807f 0d00
-00000b0: 0000 bf0d db0f c940 0c00 0000 0000 0000
-00000c0: 000c b856 0e3c dd9a efbf 0c18 2d44 54fb
-00000d0: 2119 400c 0000 0000 0000 f87f 0c00 0000
-00000e0: 0000 00f8 ff0c 0000 0000 0000 f87f 0cbc
-00000f0: 0a00 0000 00f0 7f0c bc0a 0000 0000 f0ff
-0000100: 0cbc 0a00 0000 00f0 7f0c 0000 0000 0000
-0000110: f07f 0c00 0000 0000 00f0 ff0c 0000 0000
-0000120: 0000 f07f 0c00 0000 0000 00e0 bf0c 182d
-0000130: 4454 fb21 1940
+0000000: 0061 736d 0b00 0000 0474 7970 6504 0140
+0000010: 0000 0866 756e 6374 696f 6e02 0100 0463
+0000020: 6f64 65f6 0101 f301 0010 0010 8080 8080
+0000030: 7810 7f10 8080 8080 7810 7f11 0011 8080
+0000040: 8080 8080 8080 807f 117f 1180 8080 8080
+0000050: 8080 8080 7f11 7f13 0000 0000 1316 68a9
+0000060: 6513 4020 4f37 1300 00c0 7f13 0000 c0ff
+0000070: 1300 00c0 7f13 bc0a 807f 13bc 0a80 ff13
+0000080: bc0a 807f 1300 0080 7f13 0000 80ff 1300
+0000090: 0080 7f13 0000 00bf 13db 0fc9 4012 0000
+00000a0: 0000 0000 0000 12b8 560e 3cdd 9aef bf12
+00000b0: 182d 4454 fb21 1940 1200 0000 0000 00f8
+00000c0: 7f12 0000 0000 0000 f8ff 1200 0000 0000
+00000d0: 00f8 7f12 bc0a 0000 0000 f07f 12bc 0a00
+00000e0: 0000 00f0 ff12 bc0a 0000 0000 f07f 1200
+00000f0: 0000 0000 00f0 7f12 0000 0000 0000 f0ff
+0000100: 1200 0000 0000 00f0 7f12 0000 0000 0000
+0000110: e0bf 1218 2d44 54fb 2119 40
;;; STDOUT ;;)
diff --git a/test/dump/convert.txt b/test/dump/convert.txt
index 0c996b8f..1e5fc0d2 100644
--- a/test/dump/convert.txt
+++ b/test/dump/convert.txt
@@ -26,66 +26,65 @@
(f64.promote/f32 (f32.const 0)))))
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
-0000004: 0a00 0000 ; WASM_BINARY_VERSION
-; section "signatures"
-0000008: 00 ; section size (guess)
-0000009: 0a ; string length
-000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
-0000014: 01 ; num signatures
-; signature 0
-0000015: 00 ; num params
-0000016: 00 ; result_type
-0000008: 0e ; FIXUP section size
-; section "function_signatures"
-0000017: 00 ; section size (guess)
-0000018: 13 ; string length
-0000019: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
-0000029: 7265 73 ; section id: "function_signatures"
-000002c: 01 ; num functions
-000002d: 00 ; function 0 signature index
-0000017: 16 ; FIXUP section size
-; section "function_bodies"
-000002e: 00 ; section size (guess)
-000002f: 0f ; string length
-0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
-000003f: 01 ; num functions
+0000004: 0b00 0000 ; WASM_BINARY_VERSION
+; section "type"
+0000008: 04 ; string length
+0000009: 7479 7065 ; section id: "type"
+000000d: 00 ; section size (guess)
+000000e: 01 ; num types
+; type 0
+000000f: 40 ; function form
+0000010: 00 ; num params
+0000011: 00 ; num results
+000000d: 04 ; FIXUP section size
+; section "function"
+0000012: 08 ; string length
+0000013: 6675 6e63 7469 6f6e ; section id: "function"
+000001b: 00 ; section size (guess)
+000001c: 01 ; num functions
+000001d: 00 ; function 0 signature index
+000001b: 02 ; FIXUP section size
+; section "code"
+000001e: 04 ; string length
+000001f: 636f 6465 ; section id: "code"
+0000023: 00 ; section size (guess)
+0000024: 01 ; num functions
; function body 0
-0000040: 00 ; func body size (guess)
-0000041: 00 ; local decl count
-0000042: a1 ; OPCODE_I32_WRAP_I64
-0000043: a7 ; OPCODE_I64_EXTEND_U_I32
-0000044: 9d ; OPCODE_I32_TRUNC_S_F32
-0000045: a8 ; OPCODE_F32_CONVERT_S_I32
-0000046: 9f ; OPCODE_I32_TRUNC_U_F32
-0000047: a9 ; OPCODE_F32_CONVERT_U_I32
-0000048: 9e ; OPCODE_I32_TRUNC_S_F64
-0000049: ae ; OPCODE_F64_CONVERT_S_I32
-000004a: a0 ; OPCODE_I32_TRUNC_U_F64
-000004b: af ; OPCODE_F64_CONVERT_U_I32
-000004c: 0a ; OPCODE_I32_CONST
-000004d: 00 ; i32 literal
-000004e: a2 ; OPCODE_I64_TRUNC_S_F32
-000004f: aa ; OPCODE_F32_CONVERT_S_I64
-0000050: a4 ; OPCODE_I64_TRUNC_U_F32
-0000051: ab ; OPCODE_F32_CONVERT_U_I64
-0000052: a3 ; OPCODE_I64_TRUNC_S_F64
-0000053: b0 ; OPCODE_F64_CONVERT_S_I64
-0000054: a5 ; OPCODE_I64_TRUNC_U_F64
-0000055: b1 ; OPCODE_F64_CONVERT_U_I64
-0000056: a6 ; OPCODE_I64_EXTEND_S_I32
-0000057: 0a ; OPCODE_I32_CONST
-0000058: 00 ; i32 literal
-0000059: ac ; OPCODE_F32_DEMOTE_F64
-000005a: b2 ; OPCODE_F64_PROMOTE_F32
-000005b: 0d ; OPCODE_F32_CONST
-000005c: 0000 0000 ; f32 literal
-0000040: 1f ; FIXUP func body size
-000002e: 31 ; FIXUP section size
+0000025: 00 ; func body size (guess)
+0000026: 00 ; local decl count
+0000027: 10 ; OPCODE_I32_CONST
+0000028: 00 ; i32 literal
+0000029: af ; OPCODE_F64_CONVERT_U_I32
+000002a: a0 ; OPCODE_I32_TRUNC_U_F64
+000002b: ae ; OPCODE_F64_CONVERT_S_I32
+000002c: 9e ; OPCODE_I32_TRUNC_S_F64
+000002d: a9 ; OPCODE_F32_CONVERT_U_I32
+000002e: 9f ; OPCODE_I32_TRUNC_U_F32
+000002f: a8 ; OPCODE_F32_CONVERT_S_I32
+0000030: 9d ; OPCODE_I32_TRUNC_S_F32
+0000031: a7 ; OPCODE_I64_EXTEND_U_I32
+0000032: a1 ; OPCODE_I32_WRAP_I64
+0000033: 10 ; OPCODE_I32_CONST
+0000034: 00 ; i32 literal
+0000035: a6 ; OPCODE_I64_EXTEND_S_I32
+0000036: b1 ; OPCODE_F64_CONVERT_U_I64
+0000037: a5 ; OPCODE_I64_TRUNC_U_F64
+0000038: b0 ; OPCODE_F64_CONVERT_S_I64
+0000039: a3 ; OPCODE_I64_TRUNC_S_F64
+000003a: ab ; OPCODE_F32_CONVERT_U_I64
+000003b: a4 ; OPCODE_I64_TRUNC_U_F32
+000003c: aa ; OPCODE_F32_CONVERT_S_I64
+000003d: a2 ; OPCODE_I64_TRUNC_S_F32
+000003e: 13 ; OPCODE_F32_CONST
+000003f: 0000 0000 ; f32 literal
+0000043: b2 ; OPCODE_F64_PROMOTE_F32
+0000044: ac ; OPCODE_F32_DEMOTE_F64
+0000025: 1f ; FIXUP func body size
+0000023: 21 ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0e0a 7369 676e 6174
-0000010: 7572 6573 0100 0016 1366 756e 6374 696f
-0000020: 6e5f 7369 676e 6174 7572 6573 0100 310f
-0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 7301
-0000040: 1f00 a1a7 9da8 9fa9 9eae a0af 0a00 a2aa
-0000050: a4ab a3b0 a5b1 a60a 00ac b20d 0000 0000
+0000000: 0061 736d 0b00 0000 0474 7970 6504 0140
+0000010: 0000 0866 756e 6374 696f 6e02 0100 0463
+0000020: 6f64 6521 011f 0010 00af a0ae 9ea9 9fa8
+0000030: 9da7 a110 00a6 b1a5 b0a3 aba4 aaa2 1300
+0000040: 0000 00b2 ac
;;; STDOUT ;;)
diff --git a/test/dump/debug-names-no-remap.txt b/test/dump/debug-names-no-remap.txt
index 656f9a70..87d8befb 100644
--- a/test/dump/debug-names-no-remap.txt
+++ b/test/dump/debug-names-no-remap.txt
@@ -12,86 +12,85 @@
(local $F2L3 i64)))
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
-0000004: 0a00 0000 ; WASM_BINARY_VERSION
-; section "signatures"
-0000008: 00 ; section size (guess)
-0000009: 0a ; string length
-000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
-0000014: 02 ; num signatures
-; signature 0
-0000015: 01 ; num params
-0000016: 00 ; result_type
-0000017: 01 ; param type
-; signature 1
-0000018: 01 ; num params
-0000019: 00 ; result_type
-000001a: 03 ; param type
-0000008: 12 ; FIXUP section size
-; section "function_signatures"
-000001b: 00 ; section size (guess)
-000001c: 13 ; string length
-000001d: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
-000002d: 7265 73 ; section id: "function_signatures"
-0000030: 02 ; num functions
-0000031: 00 ; function 0 signature index
-0000032: 01 ; function 1 signature index
-000001b: 17 ; FIXUP section size
-; section "function_bodies"
-0000033: 00 ; section size (guess)
-0000034: 0f ; string length
-0000035: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
-0000044: 02 ; num functions
+0000004: 0b00 0000 ; WASM_BINARY_VERSION
+; section "type"
+0000008: 04 ; string length
+0000009: 7479 7065 ; section id: "type"
+000000d: 00 ; section size (guess)
+000000e: 02 ; num types
+; type 0
+000000f: 40 ; function form
+0000010: 01 ; num params
+0000011: 01 ; param type
+0000012: 00 ; num results
+; type 1
+0000013: 40 ; function form
+0000014: 01 ; num params
+0000015: 03 ; param type
+0000016: 00 ; num results
+000000d: 09 ; FIXUP section size
+; section "function"
+0000017: 08 ; string length
+0000018: 6675 6e63 7469 6f6e ; section id: "function"
+0000020: 00 ; section size (guess)
+0000021: 02 ; num functions
+0000022: 00 ; function 0 signature index
+0000023: 01 ; function 1 signature index
+0000020: 03 ; FIXUP section size
+; section "code"
+0000024: 04 ; string length
+0000025: 636f 6465 ; section id: "code"
+0000029: 00 ; section size (guess)
+000002a: 02 ; num functions
; function body 0
-0000045: 00 ; func body size (guess)
-0000046: 02 ; local decl count
-0000047: 01 ; local type count
-0000048: 03 ; WASM_TYPE_F32
-0000049: 02 ; local type count
-000004a: 01 ; WASM_TYPE_I32
-0000045: 05 ; FIXUP func body size
+000002b: 00 ; func body size (guess)
+000002c: 02 ; local decl count
+000002d: 01 ; local type count
+000002e: 03 ; WASM_TYPE_F32
+000002f: 02 ; local type count
+0000030: 01 ; WASM_TYPE_I32
+000002b: 05 ; FIXUP func body size
; function body 1
-000004b: 00 ; func body size (guess)
-000004c: 02 ; local decl count
-000004d: 01 ; local type count
-000004e: 04 ; WASM_TYPE_F64
-000004f: 02 ; local type count
-0000050: 02 ; WASM_TYPE_I64
-000004b: 05 ; FIXUP func body size
-0000033: 1d ; FIXUP section size
-; section "names"
-0000051: 00 ; section size (guess)
-0000052: 05 ; string length
-0000053: 6e61 6d65 73 ; section id: "names"
-0000058: 02 ; num functions
-0000059: 03 ; string length
-000005a: 2446 31 $F1 ; func name 0
-000005d: 04 ; num locals
-000005e: 05 ; string length
-000005f: 2446 3150 30 $F1P0 ; remapped local name 0
-0000064: 05 ; string length
-0000065: 2446 314c 31 $F1L1 ; remapped local name 1
-000006a: 05 ; string length
-000006b: 2446 314c 32 $F1L2 ; remapped local name 2
-0000070: 00 ; string length
-0000071: 03 ; string length
-0000072: 2446 32 $F2 ; func name 1
-0000075: 04 ; num locals
-0000076: 05 ; string length
-0000077: 2446 3250 30 $F2P0 ; remapped local name 0
-000007c: 05 ; string length
-000007d: 2446 324c 31 $F2L1 ; remapped local name 1
-0000082: 00 ; string length
-0000083: 05 ; string length
-0000084: 2446 324c 33 $F2L3 ; remapped local name 3
-0000051: 37 ; FIXUP section size
+0000031: 00 ; func body size (guess)
+0000032: 02 ; local decl count
+0000033: 01 ; local type count
+0000034: 04 ; WASM_TYPE_F64
+0000035: 02 ; local type count
+0000036: 02 ; WASM_TYPE_I64
+0000031: 05 ; FIXUP func body size
+0000029: 0d ; FIXUP section size
+; section "name"
+0000037: 04 ; string length
+0000038: 6e61 6d65 ; section id: "name"
+000003c: 00 ; section size (guess)
+000003d: 02 ; num functions
+000003e: 03 ; string length
+000003f: 2446 31 $F1 ; func name 0
+0000042: 04 ; num locals
+0000043: 05 ; string length
+0000044: 2446 3150 30 $F1P0 ; remapped local name 0
+0000049: 05 ; string length
+000004a: 2446 314c 31 $F1L1 ; remapped local name 1
+000004f: 05 ; string length
+0000050: 2446 314c 32 $F1L2 ; remapped local name 2
+0000055: 00 ; string length
+0000056: 03 ; string length
+0000057: 2446 32 $F2 ; func name 1
+000005a: 04 ; num locals
+000005b: 05 ; string length
+000005c: 2446 3250 30 $F2P0 ; remapped local name 0
+0000061: 05 ; string length
+0000062: 2446 324c 31 $F2L1 ; remapped local name 1
+0000067: 00 ; string length
+0000068: 05 ; string length
+0000069: 2446 324c 33 $F2L3 ; remapped local name 3
+000003c: 31 ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 120a 7369 676e 6174
-0000010: 7572 6573 0201 0001 0100 0317 1366 756e
-0000020: 6374 696f 6e5f 7369 676e 6174 7572 6573
-0000030: 0200 011d 0f66 756e 6374 696f 6e5f 626f
-0000040: 6469 6573 0205 0201 0302 0105 0201 0402
-0000050: 0237 056e 616d 6573 0203 2446 3104 0524
-0000060: 4631 5030 0524 4631 4c31 0524 4631 4c32
-0000070: 0003 2446 3204 0524 4632 5030 0524 4632
-0000080: 4c31 0005 2446 324c 33
+0000000: 0061 736d 0b00 0000 0474 7970 6509 0240
+0000010: 0101 0040 0103 0008 6675 6e63 7469 6f6e
+0000020: 0302 0001 0463 6f64 650d 0205 0201 0302
+0000030: 0105 0201 0402 0204 6e61 6d65 3102 0324
+0000040: 4631 0405 2446 3150 3005 2446 314c 3105
+0000050: 2446 314c 3200 0324 4632 0405 2446 3250
+0000060: 3005 2446 324c 3100 0524 4632 4c33
;;; STDOUT ;;)
diff --git a/test/dump/debug-names.txt b/test/dump/debug-names.txt
index a6c83396..795a2425 100644
--- a/test/dump/debug-names.txt
+++ b/test/dump/debug-names.txt
@@ -11,86 +11,85 @@
(local $F2L3 i64)))
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
-0000004: 0a00 0000 ; WASM_BINARY_VERSION
-; section "signatures"
-0000008: 00 ; section size (guess)
-0000009: 0a ; string length
-000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
-0000014: 02 ; num signatures
-; signature 0
-0000015: 01 ; num params
-0000016: 00 ; result_type
-0000017: 01 ; param type
-; signature 1
-0000018: 01 ; num params
-0000019: 00 ; result_type
-000001a: 03 ; param type
-0000008: 12 ; FIXUP section size
-; section "function_signatures"
-000001b: 00 ; section size (guess)
-000001c: 13 ; string length
-000001d: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
-000002d: 7265 73 ; section id: "function_signatures"
-0000030: 02 ; num functions
-0000031: 00 ; function 0 signature index
-0000032: 01 ; function 1 signature index
-000001b: 17 ; FIXUP section size
-; section "function_bodies"
-0000033: 00 ; section size (guess)
-0000034: 0f ; string length
-0000035: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
-0000044: 02 ; num functions
+0000004: 0b00 0000 ; WASM_BINARY_VERSION
+; section "type"
+0000008: 04 ; string length
+0000009: 7479 7065 ; section id: "type"
+000000d: 00 ; section size (guess)
+000000e: 02 ; num types
+; type 0
+000000f: 40 ; function form
+0000010: 01 ; num params
+0000011: 01 ; param type
+0000012: 00 ; num results
+; type 1
+0000013: 40 ; function form
+0000014: 01 ; num params
+0000015: 03 ; param type
+0000016: 00 ; num results
+000000d: 09 ; FIXUP section size
+; section "function"
+0000017: 08 ; string length
+0000018: 6675 6e63 7469 6f6e ; section id: "function"
+0000020: 00 ; section size (guess)
+0000021: 02 ; num functions
+0000022: 00 ; function 0 signature index
+0000023: 01 ; function 1 signature index
+0000020: 03 ; FIXUP section size
+; section "code"
+0000024: 04 ; string length
+0000025: 636f 6465 ; section id: "code"
+0000029: 00 ; section size (guess)
+000002a: 02 ; num functions
; function body 0
-0000045: 00 ; func body size (guess)
-0000046: 02 ; local decl count
-0000047: 02 ; local type count
-0000048: 01 ; WASM_TYPE_I32
-0000049: 01 ; local type count
-000004a: 03 ; WASM_TYPE_F32
-0000045: 05 ; FIXUP func body size
+000002b: 00 ; func body size (guess)
+000002c: 02 ; local decl count
+000002d: 02 ; local type count
+000002e: 01 ; WASM_TYPE_I32
+000002f: 01 ; local type count
+0000030: 03 ; WASM_TYPE_F32
+000002b: 05 ; FIXUP func body size
; function body 1
-000004b: 00 ; func body size (guess)
-000004c: 02 ; local decl count
-000004d: 02 ; local type count
-000004e: 02 ; WASM_TYPE_I64
-000004f: 01 ; local type count
-0000050: 04 ; WASM_TYPE_F64
-000004b: 05 ; FIXUP func body size
-0000033: 1d ; FIXUP section size
-; section "names"
-0000051: 00 ; section size (guess)
-0000052: 05 ; string length
-0000053: 6e61 6d65 73 ; section id: "names"
-0000058: 02 ; num functions
-0000059: 03 ; string length
-000005a: 2446 31 $F1 ; func name 0
-000005d: 04 ; num locals
-000005e: 05 ; string length
-000005f: 2446 3150 30 $F1P0 ; remapped local name 0
-0000064: 05 ; string length
-0000065: 2446 314c 32 $F1L2 ; remapped local name 1
-000006a: 00 ; string length
-000006b: 05 ; string length
-000006c: 2446 314c 31 $F1L1 ; remapped local name 3
-0000071: 03 ; string length
-0000072: 2446 32 $F2 ; func name 1
-0000075: 04 ; num locals
-0000076: 05 ; string length
-0000077: 2446 3250 30 $F2P0 ; remapped local name 0
-000007c: 00 ; string length
-000007d: 05 ; string length
-000007e: 2446 324c 33 $F2L3 ; remapped local name 2
-0000083: 05 ; string length
-0000084: 2446 324c 31 $F2L1 ; remapped local name 3
-0000051: 37 ; FIXUP section size
+0000031: 00 ; func body size (guess)
+0000032: 02 ; local decl count
+0000033: 02 ; local type count
+0000034: 02 ; WASM_TYPE_I64
+0000035: 01 ; local type count
+0000036: 04 ; WASM_TYPE_F64
+0000031: 05 ; FIXUP func body size
+0000029: 0d ; FIXUP section size
+; section "name"
+0000037: 04 ; string length
+0000038: 6e61 6d65 ; section id: "name"
+000003c: 00 ; section size (guess)
+000003d: 02 ; num functions
+000003e: 03 ; string length
+000003f: 2446 31 $F1 ; func name 0
+0000042: 04 ; num locals
+0000043: 05 ; string length
+0000044: 2446 3150 30 $F1P0 ; remapped local name 0
+0000049: 05 ; string length
+000004a: 2446 314c 32 $F1L2 ; remapped local name 1
+000004f: 00 ; string length
+0000050: 05 ; string length
+0000051: 2446 314c 31 $F1L1 ; remapped local name 3
+0000056: 03 ; string length
+0000057: 2446 32 $F2 ; func name 1
+000005a: 04 ; num locals
+000005b: 05 ; string length
+000005c: 2446 3250 30 $F2P0 ; remapped local name 0
+0000061: 00 ; string length
+0000062: 05 ; string length
+0000063: 2446 324c 33 $F2L3 ; remapped local name 2
+0000068: 05 ; string length
+0000069: 2446 324c 31 $F2L1 ; remapped local name 3
+000003c: 31 ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 120a 7369 676e 6174
-0000010: 7572 6573 0201 0001 0100 0317 1366 756e
-0000020: 6374 696f 6e5f 7369 676e 6174 7572 6573
-0000030: 0200 011d 0f66 756e 6374 696f 6e5f 626f
-0000040: 6469 6573 0205 0202 0101 0305 0202 0201
-0000050: 0437 056e 616d 6573 0203 2446 3104 0524
-0000060: 4631 5030 0524 4631 4c32 0005 2446 314c
-0000070: 3103 2446 3204 0524 4632 5030 0005 2446
-0000080: 324c 3305 2446 324c 31
+0000000: 0061 736d 0b00 0000 0474 7970 6509 0240
+0000010: 0101 0040 0103 0008 6675 6e63 7469 6f6e
+0000020: 0302 0001 0463 6f64 650d 0205 0202 0101
+0000030: 0305 0202 0201 0404 6e61 6d65 3102 0324
+0000040: 4631 0405 2446 3150 3005 2446 314c 3200
+0000050: 0524 4631 4c31 0324 4632 0405 2446 3250
+0000060: 3000 0524 4632 4c33 0524 4632 4c31
;;; STDOUT ;;)
diff --git a/test/dump/dedupe-sig.txt b/test/dump/dedupe-sig.txt
index 3610d078..c8a50f92 100644
--- a/test/dump/dedupe-sig.txt
+++ b/test/dump/dedupe-sig.txt
@@ -5,54 +5,53 @@
(import "foo" "bar" (param i32) (result i64)))
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
-0000004: 0a00 0000 ; WASM_BINARY_VERSION
-; section "signatures"
-0000008: 00 ; section size (guess)
-0000009: 0a ; string length
-000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
-0000014: 01 ; num signatures
-; signature 0
-0000015: 01 ; num params
-0000016: 02 ; result_type
-0000017: 01 ; param type
-0000008: 0f ; FIXUP section size
-; section "import_table"
-0000018: 00 ; section size (guess)
-0000019: 0c ; string length
-000001a: 696d 706f 7274 5f74 6162 6c65 ; section id: "import_table"
-0000026: 01 ; num imports
+0000004: 0b00 0000 ; WASM_BINARY_VERSION
+; section "type"
+0000008: 04 ; string length
+0000009: 7479 7065 ; section id: "type"
+000000d: 00 ; section size (guess)
+000000e: 01 ; num types
+; type 0
+000000f: 40 ; function form
+0000010: 01 ; num params
+0000011: 01 ; param type
+0000012: 01 ; num results
+0000013: 02 ; result_type
+000000d: 06 ; FIXUP section size
+; section "import"
+0000014: 06 ; string length
+0000015: 696d 706f 7274 ; section id: "import"
+000001b: 00 ; section size (guess)
+000001c: 01 ; num imports
; import header 0
-0000027: 00 ; import signature index
-0000028: 03 ; string length
-0000029: 666f 6f foo ; import module name
-000002c: 03 ; string length
-000002d: 6261 72 bar ; import function name
-0000018: 17 ; FIXUP section size
-; section "function_signatures"
-0000030: 00 ; section size (guess)
-0000031: 13 ; string length
-0000032: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
-0000042: 7265 73 ; section id: "function_signatures"
-0000045: 01 ; num functions
-0000046: 00 ; function 0 signature index
-0000030: 16 ; FIXUP section size
-; section "function_bodies"
-0000047: 00 ; section size (guess)
-0000048: 0f ; string length
-0000049: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
-0000058: 01 ; num functions
+000001d: 00 ; import signature index
+000001e: 03 ; string length
+000001f: 666f 6f foo ; import module name
+0000022: 03 ; string length
+0000023: 6261 72 bar ; import function name
+000001b: 0a ; FIXUP section size
+; section "function"
+0000026: 08 ; string length
+0000027: 6675 6e63 7469 6f6e ; section id: "function"
+000002f: 00 ; section size (guess)
+0000030: 01 ; num functions
+0000031: 00 ; function 0 signature index
+000002f: 02 ; FIXUP section size
+; section "code"
+0000032: 04 ; string length
+0000033: 636f 6465 ; section id: "code"
+0000037: 00 ; section size (guess)
+0000038: 01 ; num functions
; function body 0
-0000059: 00 ; func body size (guess)
-000005a: 00 ; local decl count
-000005b: 0b ; OPCODE_I64_CONST
-000005c: 00 ; i64 literal
-0000059: 03 ; FIXUP func body size
-0000047: 15 ; FIXUP section size
+0000039: 00 ; func body size (guess)
+000003a: 00 ; local decl count
+000003b: 11 ; OPCODE_I64_CONST
+000003c: 00 ; i64 literal
+0000039: 03 ; FIXUP func body size
+0000037: 05 ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0f0a 7369 676e 6174
-0000010: 7572 6573 0101 0201 170c 696d 706f 7274
-0000020: 5f74 6162 6c65 0100 0366 6f6f 0362 6172
-0000030: 1613 6675 6e63 7469 6f6e 5f73 6967 6e61
-0000040: 7475 7265 7301 0015 0f66 756e 6374 696f
-0000050: 6e5f 626f 6469 6573 0103 000b 00
+0000000: 0061 736d 0b00 0000 0474 7970 6506 0140
+0000010: 0101 0102 0669 6d70 6f72 740a 0100 0366
+0000020: 6f6f 0362 6172 0866 756e 6374 696f 6e02
+0000030: 0100 0463 6f64 6505 0103 0011 00
;;; STDOUT ;;)
diff --git a/test/dump/export-multi.txt b/test/dump/export-multi.txt
index 497fb909..b77f3199 100644
--- a/test/dump/export-multi.txt
+++ b/test/dump/export-multi.txt
@@ -5,52 +5,50 @@
(export "b" 0))
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
-0000004: 0a00 0000 ; WASM_BINARY_VERSION
-; section "signatures"
-0000008: 00 ; section size (guess)
-0000009: 0a ; string length
-000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
-0000014: 01 ; num signatures
-; signature 0
-0000015: 00 ; num params
-0000016: 00 ; result_type
-0000008: 0e ; FIXUP section size
-; section "function_signatures"
-0000017: 00 ; section size (guess)
-0000018: 13 ; string length
-0000019: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
-0000029: 7265 73 ; section id: "function_signatures"
-000002c: 01 ; num functions
-000002d: 00 ; function 0 signature index
-0000017: 16 ; FIXUP section size
-; section "export_table"
-000002e: 00 ; section size (guess)
-000002f: 0c ; string length
-0000030: 6578 706f 7274 5f74 6162 6c65 ; section id: "export_table"
-000003c: 02 ; num exports
-000003d: 00 ; export func index
-000003e: 01 ; string length
-000003f: 61 a ; export name
-0000040: 00 ; export func index
-0000041: 01 ; string length
-0000042: 62 b ; export name
-000002e: 14 ; FIXUP section size
-; section "function_bodies"
-0000043: 00 ; section size (guess)
-0000044: 0f ; string length
-0000045: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
-0000054: 01 ; num functions
+0000004: 0b00 0000 ; WASM_BINARY_VERSION
+; section "type"
+0000008: 04 ; string length
+0000009: 7479 7065 ; section id: "type"
+000000d: 00 ; section size (guess)
+000000e: 01 ; num types
+; type 0
+000000f: 40 ; function form
+0000010: 00 ; num params
+0000011: 00 ; num results
+000000d: 04 ; FIXUP section size
+; section "function"
+0000012: 08 ; string length
+0000013: 6675 6e63 7469 6f6e ; section id: "function"
+000001b: 00 ; section size (guess)
+000001c: 01 ; num functions
+000001d: 00 ; function 0 signature index
+000001b: 02 ; FIXUP section size
+; section "export"
+000001e: 06 ; string length
+000001f: 6578 706f 7274 ; section id: "export"
+0000025: 00 ; section size (guess)
+0000026: 02 ; num exports
+0000027: 00 ; export func index
+0000028: 01 ; string length
+0000029: 61 a ; export name
+000002a: 00 ; export func index
+000002b: 01 ; string length
+000002c: 62 b ; export name
+0000025: 07 ; FIXUP section size
+; section "code"
+000002d: 04 ; string length
+000002e: 636f 6465 ; section id: "code"
+0000032: 00 ; section size (guess)
+0000033: 01 ; num functions
; function body 0
-0000055: 00 ; func body size (guess)
-0000056: 00 ; local decl count
-0000057: 00 ; OPCODE_NOP
-0000055: 02 ; FIXUP func body size
-0000043: 14 ; FIXUP section size
+0000034: 00 ; func body size (guess)
+0000035: 00 ; local decl count
+0000036: 00 ; OPCODE_NOP
+0000034: 02 ; FIXUP func body size
+0000032: 04 ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0e0a 7369 676e 6174
-0000010: 7572 6573 0100 0016 1366 756e 6374 696f
-0000020: 6e5f 7369 676e 6174 7572 6573 0100 140c
-0000030: 6578 706f 7274 5f74 6162 6c65 0200 0161
-0000040: 0001 6214 0f66 756e 6374 696f 6e5f 626f
-0000050: 6469 6573 0102 0000
+0000000: 0061 736d 0b00 0000 0474 7970 6504 0140
+0000010: 0000 0866 756e 6374 696f 6e02 0100 0665
+0000020: 7870 6f72 7407 0200 0161 0001 6204 636f
+0000030: 6465 0401 0200 00
;;; STDOUT ;;)
diff --git a/test/dump/expr-br.txt b/test/dump/expr-br.txt
index 893ec8e2..37382346 100644
--- a/test/dump/expr-br.txt
+++ b/test/dump/expr-br.txt
@@ -5,44 +5,43 @@
(br 0 (i32.const 1)))))
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
-0000004: 0a00 0000 ; WASM_BINARY_VERSION
-; section "signatures"
-0000008: 00 ; section size (guess)
-0000009: 0a ; string length
-000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
-0000014: 01 ; num signatures
-; signature 0
-0000015: 00 ; num params
-0000016: 01 ; result_type
-0000008: 0e ; FIXUP section size
-; section "function_signatures"
-0000017: 00 ; section size (guess)
-0000018: 13 ; string length
-0000019: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
-0000029: 7265 73 ; section id: "function_signatures"
-000002c: 01 ; num functions
-000002d: 00 ; function 0 signature index
-0000017: 16 ; FIXUP section size
-; section "function_bodies"
-000002e: 00 ; section size (guess)
-000002f: 0f ; string length
-0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
-000003f: 01 ; num functions
+0000004: 0b00 0000 ; WASM_BINARY_VERSION
+; section "type"
+0000008: 04 ; string length
+0000009: 7479 7065 ; section id: "type"
+000000d: 00 ; section size (guess)
+000000e: 01 ; num types
+; type 0
+000000f: 40 ; function form
+0000010: 00 ; num params
+0000011: 01 ; num results
+0000012: 01 ; result_type
+000000d: 05 ; FIXUP section size
+; section "function"
+0000013: 08 ; string length
+0000014: 6675 6e63 7469 6f6e ; section id: "function"
+000001c: 00 ; section size (guess)
+000001d: 01 ; num functions
+000001e: 00 ; function 0 signature index
+000001c: 02 ; FIXUP section size
+; section "code"
+000001f: 04 ; string length
+0000020: 636f 6465 ; section id: "code"
+0000024: 00 ; section size (guess)
+0000025: 01 ; num functions
; function body 0
-0000040: 00 ; func body size (guess)
-0000041: 00 ; local decl count
-0000042: 01 ; OPCODE_BLOCK
-0000043: 01 ; num expressions
-0000044: 06 ; OPCODE_BR
-0000045: 00 ; break depth
-0000046: 0a ; OPCODE_I32_CONST
-0000047: 01 ; i32 literal
-0000040: 07 ; FIXUP func body size
-000002e: 19 ; FIXUP section size
+0000026: 00 ; func body size (guess)
+0000027: 00 ; local decl count
+0000028: 01 ; OPCODE_BLOCK
+0000029: 10 ; OPCODE_I32_CONST
+000002a: 01 ; i32 literal
+000002b: 06 ; OPCODE_BR
+000002c: 00 ; break depth
+000002d: 0f ; OPCODE_END
+0000026: 07 ; FIXUP func body size
+0000024: 09 ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0e0a 7369 676e 6174
-0000010: 7572 6573 0100 0116 1366 756e 6374 696f
-0000020: 6e5f 7369 676e 6174 7572 6573 0100 190f
-0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 7301
-0000040: 0700 0101 0600 0a01
+0000000: 0061 736d 0b00 0000 0474 7970 6505 0140
+0000010: 0001 0108 6675 6e63 7469 6f6e 0201 0004
+0000020: 636f 6465 0901 0700 0110 0106 000f
;;; STDOUT ;;)
diff --git a/test/dump/expr-brif.txt b/test/dump/expr-brif.txt
index 392f2f5b..2ab4afc8 100644
--- a/test/dump/expr-brif.txt
+++ b/test/dump/expr-brif.txt
@@ -6,48 +6,48 @@
(i32.const 29))))
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
-0000004: 0a00 0000 ; WASM_BINARY_VERSION
-; section "signatures"
-0000008: 00 ; section size (guess)
-0000009: 0a ; string length
-000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
-0000014: 01 ; num signatures
-; signature 0
-0000015: 00 ; num params
-0000016: 01 ; result_type
-0000008: 0e ; FIXUP section size
-; section "function_signatures"
-0000017: 00 ; section size (guess)
-0000018: 13 ; string length
-0000019: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
-0000029: 7265 73 ; section id: "function_signatures"
-000002c: 01 ; num functions
-000002d: 00 ; function 0 signature index
-0000017: 16 ; FIXUP section size
-; section "function_bodies"
-000002e: 00 ; section size (guess)
-000002f: 0f ; string length
-0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
-000003f: 01 ; num functions
+0000004: 0b00 0000 ; WASM_BINARY_VERSION
+; section "type"
+0000008: 04 ; string length
+0000009: 7479 7065 ; section id: "type"
+000000d: 00 ; section size (guess)
+000000e: 01 ; num types
+; type 0
+000000f: 40 ; function form
+0000010: 00 ; num params
+0000011: 01 ; num results
+0000012: 01 ; result_type
+000000d: 05 ; FIXUP section size
+; section "function"
+0000013: 08 ; string length
+0000014: 6675 6e63 7469 6f6e ; section id: "function"
+000001c: 00 ; section size (guess)
+000001d: 01 ; num functions
+000001e: 00 ; function 0 signature index
+000001c: 02 ; FIXUP section size
+; section "code"
+000001f: 04 ; string length
+0000020: 636f 6465 ; section id: "code"
+0000024: 00 ; section size (guess)
+0000025: 01 ; num functions
; function body 0
-0000040: 00 ; func body size (guess)
-0000041: 00 ; local decl count
-0000042: 01 ; OPCODE_BLOCK
-0000043: 02 ; num expressions
-0000044: 07 ; OPCODE_BR_IF
-0000045: 00 ; break depth
-0000046: 0a ; OPCODE_I32_CONST
-0000047: 2a ; i32 literal
-0000048: 0a ; OPCODE_I32_CONST
-0000049: 00 ; i32 literal
-000004a: 0a ; OPCODE_I32_CONST
-000004b: 1d ; i32 literal
-0000040: 0b ; FIXUP func body size
-000002e: 1d ; FIXUP section size
+0000026: 00 ; func body size (guess)
+0000027: 00 ; local decl count
+0000028: 01 ; OPCODE_BLOCK
+0000029: 10 ; OPCODE_I32_CONST
+000002a: 2a ; i32 literal
+000002b: 10 ; OPCODE_I32_CONST
+000002c: 00 ; i32 literal
+000002d: 07 ; OPCODE_BR_IF
+000002e: 00 ; break depth
+000002f: 10 ; OPCODE_I32_CONST
+0000030: 1d ; i32 literal
+0000031: 0f ; OPCODE_END
+0000026: 0b ; FIXUP func body size
+0000024: 0d ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0e0a 7369 676e 6174
-0000010: 7572 6573 0100 0116 1366 756e 6374 696f
-0000020: 6e5f 7369 676e 6174 7572 6573 0100 1d0f
-0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 7301
-0000040: 0b00 0102 0700 0a2a 0a00 0a1d
+0000000: 0061 736d 0b00 0000 0474 7970 6505 0140
+0000010: 0001 0108 6675 6e63 7469 6f6e 0201 0004
+0000020: 636f 6465 0d01 0b00 0110 2a10 0007 0010
+0000030: 1d0f
;;; STDOUT ;;)
diff --git a/test/dump/func-exported.txt b/test/dump/func-exported.txt
index 17791ec7..1b6a6f10 100644
--- a/test/dump/func-exported.txt
+++ b/test/dump/func-exported.txt
@@ -4,48 +4,46 @@
(export "foo" 0))
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
-0000004: 0a00 0000 ; WASM_BINARY_VERSION
-; section "signatures"
-0000008: 00 ; section size (guess)
-0000009: 0a ; string length
-000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
-0000014: 01 ; num signatures
-; signature 0
-0000015: 00 ; num params
-0000016: 00 ; result_type
-0000008: 0e ; FIXUP section size
-; section "function_signatures"
-0000017: 00 ; section size (guess)
-0000018: 13 ; string length
-0000019: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
-0000029: 7265 73 ; section id: "function_signatures"
-000002c: 01 ; num functions
-000002d: 00 ; function 0 signature index
-0000017: 16 ; FIXUP section size
-; section "export_table"
-000002e: 00 ; section size (guess)
-000002f: 0c ; string length
-0000030: 6578 706f 7274 5f74 6162 6c65 ; section id: "export_table"
-000003c: 01 ; num exports
-000003d: 00 ; export func index
-000003e: 03 ; string length
-000003f: 666f 6f foo ; export name
-000002e: 13 ; FIXUP section size
-; section "function_bodies"
-0000042: 00 ; section size (guess)
-0000043: 0f ; string length
-0000044: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
-0000053: 01 ; num functions
+0000004: 0b00 0000 ; WASM_BINARY_VERSION
+; section "type"
+0000008: 04 ; string length
+0000009: 7479 7065 ; section id: "type"
+000000d: 00 ; section size (guess)
+000000e: 01 ; num types
+; type 0
+000000f: 40 ; function form
+0000010: 00 ; num params
+0000011: 00 ; num results
+000000d: 04 ; FIXUP section size
+; section "function"
+0000012: 08 ; string length
+0000013: 6675 6e63 7469 6f6e ; section id: "function"
+000001b: 00 ; section size (guess)
+000001c: 01 ; num functions
+000001d: 00 ; function 0 signature index
+000001b: 02 ; FIXUP section size
+; section "export"
+000001e: 06 ; string length
+000001f: 6578 706f 7274 ; section id: "export"
+0000025: 00 ; section size (guess)
+0000026: 01 ; num exports
+0000027: 00 ; export func index
+0000028: 03 ; string length
+0000029: 666f 6f foo ; export name
+0000025: 06 ; FIXUP section size
+; section "code"
+000002c: 04 ; string length
+000002d: 636f 6465 ; section id: "code"
+0000031: 00 ; section size (guess)
+0000032: 01 ; num functions
; function body 0
-0000054: 00 ; func body size (guess)
-0000055: 00 ; local decl count
-0000054: 01 ; FIXUP func body size
-0000042: 13 ; FIXUP section size
+0000033: 00 ; func body size (guess)
+0000034: 00 ; local decl count
+0000033: 01 ; FIXUP func body size
+0000031: 03 ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0e0a 7369 676e 6174
-0000010: 7572 6573 0100 0016 1366 756e 6374 696f
-0000020: 6e5f 7369 676e 6174 7572 6573 0100 130c
-0000030: 6578 706f 7274 5f74 6162 6c65 0100 0366
-0000040: 6f6f 130f 6675 6e63 7469 6f6e 5f62 6f64
-0000050: 6965 7301 0100
+0000000: 0061 736d 0b00 0000 0474 7970 6504 0140
+0000010: 0000 0866 756e 6374 696f 6e02 0100 0665
+0000020: 7870 6f72 7406 0100 0366 6f6f 0463 6f64
+0000030: 6503 0101 00
;;; STDOUT ;;)
diff --git a/test/dump/func-multi.txt b/test/dump/func-multi.txt
index 4f442376..c4731ca8 100644
--- a/test/dump/func-multi.txt
+++ b/test/dump/func-multi.txt
@@ -5,48 +5,46 @@
(func))
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
-0000004: 0a00 0000 ; WASM_BINARY_VERSION
-; section "signatures"
-0000008: 00 ; section size (guess)
-0000009: 0a ; string length
-000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
-0000014: 01 ; num signatures
-; signature 0
-0000015: 00 ; num params
-0000016: 00 ; result_type
-0000008: 0e ; FIXUP section size
-; section "function_signatures"
-0000017: 00 ; section size (guess)
-0000018: 13 ; string length
-0000019: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
-0000029: 7265 73 ; section id: "function_signatures"
-000002c: 03 ; num functions
-000002d: 00 ; function 0 signature index
-000002e: 00 ; function 1 signature index
-000002f: 00 ; function 2 signature index
-0000017: 18 ; FIXUP section size
-; section "function_bodies"
-0000030: 00 ; section size (guess)
-0000031: 0f ; string length
-0000032: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
-0000041: 03 ; num functions
+0000004: 0b00 0000 ; WASM_BINARY_VERSION
+; section "type"
+0000008: 04 ; string length
+0000009: 7479 7065 ; section id: "type"
+000000d: 00 ; section size (guess)
+000000e: 01 ; num types
+; type 0
+000000f: 40 ; function form
+0000010: 00 ; num params
+0000011: 00 ; num results
+000000d: 04 ; FIXUP section size
+; section "function"
+0000012: 08 ; string length
+0000013: 6675 6e63 7469 6f6e ; section id: "function"
+000001b: 00 ; section size (guess)
+000001c: 03 ; num functions
+000001d: 00 ; function 0 signature index
+000001e: 00 ; function 1 signature index
+000001f: 00 ; function 2 signature index
+000001b: 04 ; FIXUP section size
+; section "code"
+0000020: 04 ; string length
+0000021: 636f 6465 ; section id: "code"
+0000025: 00 ; section size (guess)
+0000026: 03 ; num functions
; function body 0
-0000042: 00 ; func body size (guess)
-0000043: 00 ; local decl count
-0000042: 01 ; FIXUP func body size
+0000027: 00 ; func body size (guess)
+0000028: 00 ; local decl count
+0000027: 01 ; FIXUP func body size
; function body 1
-0000044: 00 ; func body size (guess)
-0000045: 00 ; local decl count
-0000044: 01 ; FIXUP func body size
+0000029: 00 ; func body size (guess)
+000002a: 00 ; local decl count
+0000029: 01 ; FIXUP func body size
; function body 2
-0000046: 00 ; func body size (guess)
-0000047: 00 ; local decl count
-0000046: 01 ; FIXUP func body size
-0000030: 17 ; FIXUP section size
+000002b: 00 ; func body size (guess)
+000002c: 00 ; local decl count
+000002b: 01 ; FIXUP func body size
+0000025: 07 ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0e0a 7369 676e 6174
-0000010: 7572 6573 0100 0018 1366 756e 6374 696f
-0000020: 6e5f 7369 676e 6174 7572 6573 0300 0000
-0000030: 170f 6675 6e63 7469 6f6e 5f62 6f64 6965
-0000040: 7303 0100 0100 0100
+0000000: 0061 736d 0b00 0000 0474 7970 6504 0140
+0000010: 0000 0866 756e 6374 696f 6e04 0300 0000
+0000020: 0463 6f64 6507 0301 0001 0001 00
;;; STDOUT ;;)
diff --git a/test/dump/func-named.txt b/test/dump/func-named.txt
index 9c2ac11b..aece2867 100644
--- a/test/dump/func-named.txt
+++ b/test/dump/func-named.txt
@@ -3,38 +3,36 @@
(func $my-func))
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
-0000004: 0a00 0000 ; WASM_BINARY_VERSION
-; section "signatures"
-0000008: 00 ; section size (guess)
-0000009: 0a ; string length
-000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
-0000014: 01 ; num signatures
-; signature 0
-0000015: 00 ; num params
-0000016: 00 ; result_type
-0000008: 0e ; FIXUP section size
-; section "function_signatures"
-0000017: 00 ; section size (guess)
-0000018: 13 ; string length
-0000019: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
-0000029: 7265 73 ; section id: "function_signatures"
-000002c: 01 ; num functions
-000002d: 00 ; function 0 signature index
-0000017: 16 ; FIXUP section size
-; section "function_bodies"
-000002e: 00 ; section size (guess)
-000002f: 0f ; string length
-0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
-000003f: 01 ; num functions
+0000004: 0b00 0000 ; WASM_BINARY_VERSION
+; section "type"
+0000008: 04 ; string length
+0000009: 7479 7065 ; section id: "type"
+000000d: 00 ; section size (guess)
+000000e: 01 ; num types
+; type 0
+000000f: 40 ; function form
+0000010: 00 ; num params
+0000011: 00 ; num results
+000000d: 04 ; FIXUP section size
+; section "function"
+0000012: 08 ; string length
+0000013: 6675 6e63 7469 6f6e ; section id: "function"
+000001b: 00 ; section size (guess)
+000001c: 01 ; num functions
+000001d: 00 ; function 0 signature index
+000001b: 02 ; FIXUP section size
+; section "code"
+000001e: 04 ; string length
+000001f: 636f 6465 ; section id: "code"
+0000023: 00 ; section size (guess)
+0000024: 01 ; num functions
; function body 0
-0000040: 00 ; func body size (guess)
-0000041: 00 ; local decl count
-0000040: 01 ; FIXUP func body size
-000002e: 13 ; FIXUP section size
+0000025: 00 ; func body size (guess)
+0000026: 00 ; local decl count
+0000025: 01 ; FIXUP func body size
+0000023: 03 ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0e0a 7369 676e 6174
-0000010: 7572 6573 0100 0016 1366 756e 6374 696f
-0000020: 6e5f 7369 676e 6174 7572 6573 0100 130f
-0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 7301
-0000040: 0100
+0000000: 0061 736d 0b00 0000 0474 7970 6504 0140
+0000010: 0000 0866 756e 6374 696f 6e02 0100 0463
+0000020: 6f64 6503 0101 00
;;; STDOUT ;;)
diff --git a/test/dump/getlocal-param.txt b/test/dump/getlocal-param.txt
index 53e297f6..c993c293 100644
--- a/test/dump/getlocal-param.txt
+++ b/test/dump/getlocal-param.txt
@@ -14,59 +14,57 @@
(get_local 5)))
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
-0000004: 0a00 0000 ; WASM_BINARY_VERSION
-; section "signatures"
-0000008: 00 ; section size (guess)
-0000009: 0a ; string length
-000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
-0000014: 01 ; num signatures
-; signature 0
-0000015: 02 ; num params
-0000016: 00 ; result_type
-0000017: 01 ; param type
-0000018: 03 ; param type
-0000008: 10 ; FIXUP section size
-; section "function_signatures"
-0000019: 00 ; section size (guess)
-000001a: 13 ; string length
-000001b: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
-000002b: 7265 73 ; section id: "function_signatures"
-000002e: 01 ; num functions
-000002f: 00 ; function 0 signature index
-0000019: 16 ; FIXUP section size
-; section "function_bodies"
-0000030: 00 ; section size (guess)
-0000031: 0f ; string length
-0000032: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
-0000041: 01 ; num functions
+0000004: 0b00 0000 ; WASM_BINARY_VERSION
+; section "type"
+0000008: 04 ; string length
+0000009: 7479 7065 ; section id: "type"
+000000d: 00 ; section size (guess)
+000000e: 01 ; num types
+; type 0
+000000f: 40 ; function form
+0000010: 02 ; num params
+0000011: 01 ; param type
+0000012: 03 ; param type
+0000013: 00 ; num results
+000000d: 06 ; FIXUP section size
+; section "function"
+0000014: 08 ; string length
+0000015: 6675 6e63 7469 6f6e ; section id: "function"
+000001d: 00 ; section size (guess)
+000001e: 01 ; num functions
+000001f: 00 ; function 0 signature index
+000001d: 02 ; FIXUP section size
+; section "code"
+0000020: 04 ; string length
+0000021: 636f 6465 ; section id: "code"
+0000025: 00 ; section size (guess)
+0000026: 01 ; num functions
; function body 0
-0000042: 00 ; func body size (guess)
-0000043: 03 ; local decl count
-0000044: 01 ; local type count
-0000045: 01 ; WASM_TYPE_I32
-0000046: 01 ; local type count
-0000047: 02 ; WASM_TYPE_I64
-0000048: 02 ; local type count
-0000049: 03 ; WASM_TYPE_F32
-000004a: 0e ; OPCODE_GET_LOCAL
-000004b: 00 ; remapped local index
-000004c: 0e ; OPCODE_GET_LOCAL
-000004d: 01 ; remapped local index
-000004e: 0e ; OPCODE_GET_LOCAL
-000004f: 03 ; remapped local index
-0000050: 0e ; OPCODE_GET_LOCAL
-0000051: 04 ; remapped local index
-0000052: 0e ; OPCODE_GET_LOCAL
-0000053: 02 ; remapped local index
-0000054: 0e ; OPCODE_GET_LOCAL
-0000055: 05 ; remapped local index
-0000042: 13 ; FIXUP func body size
-0000030: 25 ; FIXUP section size
+0000027: 00 ; func body size (guess)
+0000028: 03 ; local decl count
+0000029: 01 ; local type count
+000002a: 01 ; WASM_TYPE_I32
+000002b: 01 ; local type count
+000002c: 02 ; WASM_TYPE_I64
+000002d: 02 ; local type count
+000002e: 03 ; WASM_TYPE_F32
+000002f: 14 ; OPCODE_GET_LOCAL
+0000030: 00 ; remapped local index
+0000031: 14 ; OPCODE_GET_LOCAL
+0000032: 01 ; remapped local index
+0000033: 14 ; OPCODE_GET_LOCAL
+0000034: 03 ; remapped local index
+0000035: 14 ; OPCODE_GET_LOCAL
+0000036: 04 ; remapped local index
+0000037: 14 ; OPCODE_GET_LOCAL
+0000038: 02 ; remapped local index
+0000039: 14 ; OPCODE_GET_LOCAL
+000003a: 05 ; remapped local index
+0000027: 13 ; FIXUP func body size
+0000025: 15 ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 100a 7369 676e 6174
-0000010: 7572 6573 0102 0001 0316 1366 756e 6374
-0000020: 696f 6e5f 7369 676e 6174 7572 6573 0100
-0000030: 250f 6675 6e63 7469 6f6e 5f62 6f64 6965
-0000040: 7301 1303 0101 0102 0203 0e00 0e01 0e03
-0000050: 0e04 0e02 0e05
+0000000: 0061 736d 0b00 0000 0474 7970 6506 0140
+0000010: 0201 0300 0866 756e 6374 696f 6e02 0100
+0000020: 0463 6f64 6515 0113 0301 0101 0202 0314
+0000030: 0014 0114 0314 0414 0214 05
;;; STDOUT ;;)
diff --git a/test/dump/getlocal.txt b/test/dump/getlocal.txt
index ee40f60e..dc47609f 100644
--- a/test/dump/getlocal.txt
+++ b/test/dump/getlocal.txt
@@ -16,63 +16,61 @@
(get_local 7)))
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
-0000004: 0a00 0000 ; WASM_BINARY_VERSION
-; section "signatures"
-0000008: 00 ; section size (guess)
-0000009: 0a ; string length
-000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
-0000014: 01 ; num signatures
-; signature 0
-0000015: 00 ; num params
-0000016: 00 ; result_type
-0000008: 0e ; FIXUP section size
-; section "function_signatures"
-0000017: 00 ; section size (guess)
-0000018: 13 ; string length
-0000019: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
-0000029: 7265 73 ; section id: "function_signatures"
-000002c: 01 ; num functions
-000002d: 00 ; function 0 signature index
-0000017: 16 ; FIXUP section size
-; section "function_bodies"
-000002e: 00 ; section size (guess)
-000002f: 0f ; string length
-0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
-000003f: 01 ; num functions
+0000004: 0b00 0000 ; WASM_BINARY_VERSION
+; section "type"
+0000008: 04 ; string length
+0000009: 7479 7065 ; section id: "type"
+000000d: 00 ; section size (guess)
+000000e: 01 ; num types
+; type 0
+000000f: 40 ; function form
+0000010: 00 ; num params
+0000011: 00 ; num results
+000000d: 04 ; FIXUP section size
+; section "function"
+0000012: 08 ; string length
+0000013: 6675 6e63 7469 6f6e ; section id: "function"
+000001b: 00 ; section size (guess)
+000001c: 01 ; num functions
+000001d: 00 ; function 0 signature index
+000001b: 02 ; FIXUP section size
+; section "code"
+000001e: 04 ; string length
+000001f: 636f 6465 ; section id: "code"
+0000023: 00 ; section size (guess)
+0000024: 01 ; num functions
; function body 0
-0000040: 00 ; func body size (guess)
-0000041: 04 ; local decl count
-0000042: 02 ; local type count
-0000043: 01 ; WASM_TYPE_I32
-0000044: 02 ; local type count
-0000045: 02 ; WASM_TYPE_I64
-0000046: 02 ; local type count
-0000047: 03 ; WASM_TYPE_F32
-0000048: 02 ; local type count
-0000049: 04 ; WASM_TYPE_F64
-000004a: 0e ; OPCODE_GET_LOCAL
-000004b: 06 ; remapped local index
-000004c: 0e ; OPCODE_GET_LOCAL
-000004d: 04 ; remapped local index
-000004e: 0e ; OPCODE_GET_LOCAL
-000004f: 02 ; remapped local index
-0000050: 0e ; OPCODE_GET_LOCAL
-0000051: 00 ; remapped local index
-0000052: 0e ; OPCODE_GET_LOCAL
-0000053: 01 ; remapped local index
-0000054: 0e ; OPCODE_GET_LOCAL
-0000055: 05 ; remapped local index
-0000056: 0e ; OPCODE_GET_LOCAL
-0000057: 07 ; remapped local index
-0000058: 0e ; OPCODE_GET_LOCAL
-0000059: 03 ; remapped local index
-0000040: 19 ; FIXUP func body size
-000002e: 2b ; FIXUP section size
+0000025: 00 ; func body size (guess)
+0000026: 04 ; local decl count
+0000027: 02 ; local type count
+0000028: 01 ; WASM_TYPE_I32
+0000029: 02 ; local type count
+000002a: 02 ; WASM_TYPE_I64
+000002b: 02 ; local type count
+000002c: 03 ; WASM_TYPE_F32
+000002d: 02 ; local type count
+000002e: 04 ; WASM_TYPE_F64
+000002f: 14 ; OPCODE_GET_LOCAL
+0000030: 06 ; remapped local index
+0000031: 14 ; OPCODE_GET_LOCAL
+0000032: 04 ; remapped local index
+0000033: 14 ; OPCODE_GET_LOCAL
+0000034: 02 ; remapped local index
+0000035: 14 ; OPCODE_GET_LOCAL
+0000036: 00 ; remapped local index
+0000037: 14 ; OPCODE_GET_LOCAL
+0000038: 01 ; remapped local index
+0000039: 14 ; OPCODE_GET_LOCAL
+000003a: 05 ; remapped local index
+000003b: 14 ; OPCODE_GET_LOCAL
+000003c: 07 ; remapped local index
+000003d: 14 ; OPCODE_GET_LOCAL
+000003e: 03 ; remapped local index
+0000025: 19 ; FIXUP func body size
+0000023: 1b ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0e0a 7369 676e 6174
-0000010: 7572 6573 0100 0016 1366 756e 6374 696f
-0000020: 6e5f 7369 676e 6174 7572 6573 0100 2b0f
-0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 7301
-0000040: 1904 0201 0202 0203 0204 0e06 0e04 0e02
-0000050: 0e00 0e01 0e05 0e07 0e03
+0000000: 0061 736d 0b00 0000 0474 7970 6504 0140
+0000010: 0000 0866 756e 6374 696f 6e02 0100 0463
+0000020: 6f64 651b 0119 0402 0102 0202 0302 0414
+0000030: 0614 0414 0214 0014 0114 0514 0714 03
;;; STDOUT ;;)
diff --git a/test/dump/grow-memory.txt b/test/dump/grow-memory.txt
index 26f550dd..45486c93 100644
--- a/test/dump/grow-memory.txt
+++ b/test/dump/grow-memory.txt
@@ -5,51 +5,49 @@
(grow_memory (get_local 0))))
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
-0000004: 0a00 0000 ; WASM_BINARY_VERSION
-; section "signatures"
-0000008: 00 ; section size (guess)
-0000009: 0a ; string length
-000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
-0000014: 01 ; num signatures
-; signature 0
-0000015: 01 ; num params
-0000016: 00 ; result_type
-0000017: 01 ; param type
-0000008: 0f ; FIXUP section size
-; section "function_signatures"
-0000018: 00 ; section size (guess)
-0000019: 13 ; string length
-000001a: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
-000002a: 7265 73 ; section id: "function_signatures"
-000002d: 01 ; num functions
-000002e: 00 ; function 0 signature index
-0000018: 16 ; FIXUP section size
+0000004: 0b00 0000 ; WASM_BINARY_VERSION
+; section "type"
+0000008: 04 ; string length
+0000009: 7479 7065 ; section id: "type"
+000000d: 00 ; section size (guess)
+000000e: 01 ; num types
+; type 0
+000000f: 40 ; function form
+0000010: 01 ; num params
+0000011: 01 ; param type
+0000012: 00 ; num results
+000000d: 05 ; FIXUP section size
+; section "function"
+0000013: 08 ; string length
+0000014: 6675 6e63 7469 6f6e ; section id: "function"
+000001c: 00 ; section size (guess)
+000001d: 01 ; num functions
+000001e: 00 ; function 0 signature index
+000001c: 02 ; FIXUP section size
; section "memory"
+000001f: 06 ; string length
+0000020: 6d65 6d6f 7279 ; section id: "memory"
+0000026: 00 ; section size (guess)
+0000027: 01 ; min mem pages
+0000028: 02 ; max mem pages
+0000029: 00 ; export mem
+0000026: 03 ; FIXUP section size
+; section "code"
+000002a: 04 ; string length
+000002b: 636f 6465 ; section id: "code"
000002f: 00 ; section size (guess)
-0000030: 06 ; string length
-0000031: 6d65 6d6f 7279 ; section id: "memory"
-0000037: 01 ; min mem pages
-0000038: 02 ; max mem pages
-0000039: 00 ; export mem
-000002f: 0a ; FIXUP section size
-; section "function_bodies"
-000003a: 00 ; section size (guess)
-000003b: 0f ; string length
-000003c: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
-000004b: 01 ; num functions
+0000030: 01 ; num functions
; function body 0
-000004c: 00 ; func body size (guess)
-000004d: 00 ; local decl count
-000004e: 39 ; OPCODE_GROW_MEMORY
-000004f: 0e ; OPCODE_GET_LOCAL
-0000050: 00 ; remapped local index
-000004c: 04 ; FIXUP func body size
-000003a: 16 ; FIXUP section size
+0000031: 00 ; func body size (guess)
+0000032: 00 ; local decl count
+0000033: 14 ; OPCODE_GET_LOCAL
+0000034: 00 ; remapped local index
+0000035: 39 ; OPCODE_GROW_MEMORY
+0000031: 04 ; FIXUP func body size
+000002f: 06 ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0f0a 7369 676e 6174
-0000010: 7572 6573 0101 0001 1613 6675 6e63 7469
-0000020: 6f6e 5f73 6967 6e61 7475 7265 7301 000a
-0000030: 066d 656d 6f72 7901 0200 160f 6675 6e63
-0000040: 7469 6f6e 5f62 6f64 6965 7301 0400 390e
-0000050: 00
+0000000: 0061 736d 0b00 0000 0474 7970 6505 0140
+0000010: 0101 0008 6675 6e63 7469 6f6e 0201 0006
+0000020: 6d65 6d6f 7279 0301 0200 0463 6f64 6506
+0000030: 0104 0014 0039
;;; STDOUT ;;)
diff --git a/test/dump/hexfloat_f32.txt b/test/dump/hexfloat_f32.txt
index 8f01ef80..d196354b 100644
--- a/test/dump/hexfloat_f32.txt
+++ b/test/dump/hexfloat_f32.txt
@@ -22,77 +22,75 @@
)
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
-0000004: 0a00 0000 ; WASM_BINARY_VERSION
-; section "signatures"
-0000008: 00 ; section size (guess)
-0000009: 0a ; string length
-000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
-0000014: 01 ; num signatures
-; signature 0
-0000015: 00 ; num params
-0000016: 00 ; result_type
-0000008: 0e ; FIXUP section size
-; section "function_signatures"
-0000017: 00 ; section size (guess)
-0000018: 13 ; string length
-0000019: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
-0000029: 7265 73 ; section id: "function_signatures"
-000002c: 01 ; num functions
-000002d: 00 ; function 0 signature index
-0000017: 16 ; FIXUP section size
-; section "function_bodies"
-000002e: 00 ; section size (guess)
-000002f: 0f ; string length
-0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
-000003f: 01 ; num functions
+0000004: 0b00 0000 ; WASM_BINARY_VERSION
+; section "type"
+0000008: 04 ; string length
+0000009: 7479 7065 ; section id: "type"
+000000d: 00 ; section size (guess)
+000000e: 01 ; num types
+; type 0
+000000f: 40 ; function form
+0000010: 00 ; num params
+0000011: 00 ; num results
+000000d: 04 ; FIXUP section size
+; section "function"
+0000012: 08 ; string length
+0000013: 6675 6e63 7469 6f6e ; section id: "function"
+000001b: 00 ; section size (guess)
+000001c: 01 ; num functions
+000001d: 00 ; function 0 signature index
+000001b: 02 ; FIXUP section size
+; section "code"
+000001e: 04 ; string length
+000001f: 636f 6465 ; section id: "code"
+0000023: 00 ; section size (guess)
+0000024: 01 ; num functions
; function body 0
-0000040: 00 ; func body size (guess)
-0000041: 00 ; local decl count
-0000042: 0d ; OPCODE_F32_CONST
-0000043: 0000 0000 ; f32 literal
-0000047: 0d ; OPCODE_F32_CONST
-0000048: 80a2 9148 ; f32 literal
-000004c: 0d ; OPCODE_F32_CONST
-000004d: 0000 8059 ; f32 literal
-0000051: 0d ; OPCODE_F32_CONST
-0000052: 0000 007f ; f32 literal
-0000056: 0d ; OPCODE_F32_CONST
-0000057: 0000 807c ; f32 literal
-000005b: 0d ; OPCODE_F32_CONST
-000005c: 0080 917d ; f32 literal
-0000060: 0d ; OPCODE_F32_CONST
-0000061: f0ff ff7e ; f32 literal
-0000065: 0d ; OPCODE_F32_CONST
-0000066: feff 7f7e ; f32 literal
-000006a: 0d ; OPCODE_F32_CONST
-000006b: 0000 807f ; f32 literal
-000006f: 0d ; OPCODE_F32_CONST
-0000070: c4ff 7f7f ; f32 literal
-0000074: 0d ; OPCODE_F32_CONST
-0000075: f8ff 7f7f ; f32 literal
-0000079: 0d ; OPCODE_F32_CONST
-000007a: faff ff0a ; f32 literal
-000007e: 0d ; OPCODE_F32_CONST
-000007f: f8ff ff0a ; f32 literal
-0000083: 0d ; OPCODE_F32_CONST
-0000084: 0000 0004 ; f32 literal
-0000088: 0d ; OPCODE_F32_CONST
-0000089: 0000 883f ; f32 literal
-000008d: 0d ; OPCODE_F32_CONST
-000008e: 0000 8053 ; f32 literal
-0000092: 0d ; OPCODE_F32_CONST
-0000093: 8080 7fc0 ; f32 literal
-0000040: 56 ; FIXUP func body size
-000002e: 68 ; FIXUP section size
+0000025: 00 ; func body size (guess)
+0000026: 00 ; local decl count
+0000027: 13 ; OPCODE_F32_CONST
+0000028: 0000 0000 ; f32 literal
+000002c: 13 ; OPCODE_F32_CONST
+000002d: 80a2 9148 ; f32 literal
+0000031: 13 ; OPCODE_F32_CONST
+0000032: 0000 8059 ; f32 literal
+0000036: 13 ; OPCODE_F32_CONST
+0000037: 0000 007f ; f32 literal
+000003b: 13 ; OPCODE_F32_CONST
+000003c: 0000 807c ; f32 literal
+0000040: 13 ; OPCODE_F32_CONST
+0000041: 0080 917d ; f32 literal
+0000045: 13 ; OPCODE_F32_CONST
+0000046: f0ff ff7e ; f32 literal
+000004a: 13 ; OPCODE_F32_CONST
+000004b: feff 7f7e ; f32 literal
+000004f: 13 ; OPCODE_F32_CONST
+0000050: 0000 807f ; f32 literal
+0000054: 13 ; OPCODE_F32_CONST
+0000055: c4ff 7f7f ; f32 literal
+0000059: 13 ; OPCODE_F32_CONST
+000005a: f8ff 7f7f ; f32 literal
+000005e: 13 ; OPCODE_F32_CONST
+000005f: faff ff0a ; f32 literal
+0000063: 13 ; OPCODE_F32_CONST
+0000064: f8ff ff0a ; f32 literal
+0000068: 13 ; OPCODE_F32_CONST
+0000069: 0000 0004 ; f32 literal
+000006d: 13 ; OPCODE_F32_CONST
+000006e: 0000 883f ; f32 literal
+0000072: 13 ; OPCODE_F32_CONST
+0000073: 0000 8053 ; f32 literal
+0000077: 13 ; OPCODE_F32_CONST
+0000078: 8080 7fc0 ; f32 literal
+0000025: 56 ; FIXUP func body size
+0000023: 58 ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0e0a 7369 676e 6174
-0000010: 7572 6573 0100 0016 1366 756e 6374 696f
-0000020: 6e5f 7369 676e 6174 7572 6573 0100 680f
-0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 7301
-0000040: 5600 0d00 0000 000d 80a2 9148 0d00 0080
-0000050: 590d 0000 007f 0d00 0080 7c0d 0080 917d
-0000060: 0df0 ffff 7e0d feff 7f7e 0d00 0080 7f0d
-0000070: c4ff 7f7f 0df8 ff7f 7f0d faff ff0a 0df8
-0000080: ffff 0a0d 0000 0004 0d00 0088 3f0d 0000
-0000090: 8053 0d80 807f c0
+0000000: 0061 736d 0b00 0000 0474 7970 6504 0140
+0000010: 0000 0866 756e 6374 696f 6e02 0100 0463
+0000020: 6f64 6558 0156 0013 0000 0000 1380 a291
+0000030: 4813 0000 8059 1300 0000 7f13 0000 807c
+0000040: 1300 8091 7d13 f0ff ff7e 13fe ff7f 7e13
+0000050: 0000 807f 13c4 ff7f 7f13 f8ff 7f7f 13fa
+0000060: ffff 0a13 f8ff ff0a 1300 0000 0413 0000
+0000070: 883f 1300 0080 5313 8080 7fc0
;;; STDOUT ;;)
diff --git a/test/dump/hexfloat_f64.txt b/test/dump/hexfloat_f64.txt
index 1361f933..1cce0266 100644
--- a/test/dump/hexfloat_f64.txt
+++ b/test/dump/hexfloat_f64.txt
@@ -22,83 +22,82 @@
)
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
-0000004: 0a00 0000 ; WASM_BINARY_VERSION
-; section "signatures"
-0000008: 00 ; section size (guess)
-0000009: 0a ; string length
-000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
-0000014: 01 ; num signatures
-; signature 0
-0000015: 00 ; num params
-0000016: 00 ; result_type
-0000008: 0e ; FIXUP section size
-; section "function_signatures"
-0000017: 00 ; section size (guess)
-0000018: 13 ; string length
-0000019: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
-0000029: 7265 73 ; section id: "function_signatures"
-000002c: 01 ; num functions
-000002d: 00 ; function 0 signature index
-0000017: 16 ; FIXUP section size
-; section "function_bodies"
-000002e: 00 ; section size (guess)
-000002f: 0f ; string length
-0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
-000003f: 01 ; num functions
+0000004: 0b00 0000 ; WASM_BINARY_VERSION
+; section "type"
+0000008: 04 ; string length
+0000009: 7479 7065 ; section id: "type"
+000000d: 00 ; section size (guess)
+000000e: 01 ; num types
+; type 0
+000000f: 40 ; function form
+0000010: 00 ; num params
+0000011: 00 ; num results
+000000d: 04 ; FIXUP section size
+; section "function"
+0000012: 08 ; string length
+0000013: 6675 6e63 7469 6f6e ; section id: "function"
+000001b: 00 ; section size (guess)
+000001c: 01 ; num functions
+000001d: 00 ; function 0 signature index
+000001b: 02 ; FIXUP section size
+; section "code"
+000001e: 04 ; string length
+000001f: 636f 6465 ; section id: "code"
+0000023: 00 ; section size (guess)
+0000024: 01 ; num functions
; function body 0
-0000040: 00 ; func body size (guess)
-0000041: 00 ; local decl count
-0000042: 0c ; OPCODE_F64_CONST
-0000043: 0000 0000 0000 0000 ; f64 literal
-000004b: 0c ; OPCODE_F64_CONST
-000004c: 0000 0000 5034 1241 ; f64 literal
-0000054: 0c ; OPCODE_F64_CONST
-0000055: 0000 0000 0000 3045 ; f64 literal
-000005d: 0c ; OPCODE_F64_CONST
-000005e: 0000 0000 0000 e07f ; f64 literal
-0000066: 0c ; OPCODE_F64_CONST
-0000067: 0000 0000 0000 907f ; f64 literal
-000006f: 0c ; OPCODE_F64_CONST
-0000070: 0000 0000 0030 c27f ; f64 literal
-0000078: 0c ; OPCODE_F64_CONST
-0000079: 00e0 ffff ffff df7f ; f64 literal
-0000081: 0c ; OPCODE_F64_CONST
-0000082: c0ff ffff ffff cf7f ; f64 literal
-000008a: 0c ; OPCODE_F64_CONST
-000008b: 0000 0000 0000 f07f ; f64 literal
-0000093: 0c ; OPCODE_F64_CONST
-0000094: fcff ffff ffff ef7f ; f64 literal
-000009c: 0c ; OPCODE_F64_CONST
-000009d: feff ffff ffff ef7f ; f64 literal
-00000a5: 0c ; OPCODE_F64_CONST
-00000a6: f1ff ffff ffff df02 ; f64 literal
-00000ae: 0c ; OPCODE_F64_CONST
-00000af: f3ff ffff ffff df02 ; f64 literal
-00000b7: 0c ; OPCODE_F64_CONST
-00000b8: 0000 0000 0000 8001 ; f64 literal
-00000c0: 0c ; OPCODE_F64_CONST
-00000c1: 0000 0000 0000 f13f ; f64 literal
-00000c9: 0c ; OPCODE_F64_CONST
-00000ca: 0000 0000 0000 7042 ; f64 literal
-00000d2: 0c ; OPCODE_F64_CONST
-00000d3: 0000 0000 10f0 0fc0 ; f64 literal
-; move data: [41, db) -> [42, dc)
-0000040: 9a01 ; FIXUP func body size
-; move data: [2f, dc) -> [30, dd)
-000002e: ad01 ; FIXUP section size
+0000025: 00 ; func body size (guess)
+0000026: 00 ; local decl count
+0000027: 12 ; OPCODE_F64_CONST
+0000028: 0000 0000 0000 0000 ; f64 literal
+0000030: 12 ; OPCODE_F64_CONST
+0000031: 0000 0000 5034 1241 ; f64 literal
+0000039: 12 ; OPCODE_F64_CONST
+000003a: 0000 0000 0000 3045 ; f64 literal
+0000042: 12 ; OPCODE_F64_CONST
+0000043: 0000 0000 0000 e07f ; f64 literal
+000004b: 12 ; OPCODE_F64_CONST
+000004c: 0000 0000 0000 907f ; f64 literal
+0000054: 12 ; OPCODE_F64_CONST
+0000055: 0000 0000 0030 c27f ; f64 literal
+000005d: 12 ; OPCODE_F64_CONST
+000005e: 00e0 ffff ffff df7f ; f64 literal
+0000066: 12 ; OPCODE_F64_CONST
+0000067: c0ff ffff ffff cf7f ; f64 literal
+000006f: 12 ; OPCODE_F64_CONST
+0000070: 0000 0000 0000 f07f ; f64 literal
+0000078: 12 ; OPCODE_F64_CONST
+0000079: fcff ffff ffff ef7f ; f64 literal
+0000081: 12 ; OPCODE_F64_CONST
+0000082: feff ffff ffff ef7f ; f64 literal
+000008a: 12 ; OPCODE_F64_CONST
+000008b: f1ff ffff ffff df02 ; f64 literal
+0000093: 12 ; OPCODE_F64_CONST
+0000094: f3ff ffff ffff df02 ; f64 literal
+000009c: 12 ; OPCODE_F64_CONST
+000009d: 0000 0000 0000 8001 ; f64 literal
+00000a5: 12 ; OPCODE_F64_CONST
+00000a6: 0000 0000 0000 f13f ; f64 literal
+00000ae: 12 ; OPCODE_F64_CONST
+00000af: 0000 0000 0000 7042 ; f64 literal
+00000b7: 12 ; OPCODE_F64_CONST
+00000b8: 0000 0000 10f0 0fc0 ; f64 literal
+; move data: [26, c0) -> [27, c1)
+0000025: 9a01 ; FIXUP func body size
+; move data: [24, c1) -> [25, c2)
+0000023: 9d01 ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0e0a 7369 676e 6174
-0000010: 7572 6573 0100 0016 1366 756e 6374 696f
-0000020: 6e5f 7369 676e 6174 7572 6573 0100 ad01
-0000030: 0f66 756e 6374 696f 6e5f 626f 6469 6573
-0000040: 019a 0100 0c00 0000 0000 0000 000c 0000
-0000050: 0000 5034 1241 0c00 0000 0000 0030 450c
-0000060: 0000 0000 0000 e07f 0c00 0000 0000 0090
-0000070: 7f0c 0000 0000 0030 c27f 0c00 e0ff ffff
-0000080: ffdf 7f0c c0ff ffff ffff cf7f 0c00 0000
-0000090: 0000 00f0 7f0c fcff ffff ffff ef7f 0cfe
-00000a0: ffff ffff ffef 7f0c f1ff ffff ffff df02
-00000b0: 0cf3 ffff ffff ffdf 020c 0000 0000 0000
-00000c0: 8001 0c00 0000 0000 00f1 3f0c 0000 0000
-00000d0: 0000 7042 0c00 0000 0010 f00f c0
+0000000: 0061 736d 0b00 0000 0474 7970 6504 0140
+0000010: 0000 0866 756e 6374 696f 6e02 0100 0463
+0000020: 6f64 659d 0101 9a01 0012 0000 0000 0000
+0000030: 0000 1200 0000 0050 3412 4112 0000 0000
+0000040: 0000 3045 1200 0000 0000 00e0 7f12 0000
+0000050: 0000 0000 907f 1200 0000 0000 30c2 7f12
+0000060: 00e0 ffff ffff df7f 12c0 ffff ffff ffcf
+0000070: 7f12 0000 0000 0000 f07f 12fc ffff ffff
+0000080: ffef 7f12 feff ffff ffff ef7f 12f1 ffff
+0000090: ffff ffdf 0212 f3ff ffff ffff df02 1200
+00000a0: 0000 0000 0080 0112 0000 0000 0000 f13f
+00000b0: 1200 0000 0000 0070 4212 0000 0000 10f0
+00000c0: 0fc0
;;; STDOUT ;;)
diff --git a/test/dump/if-then-else-list.txt b/test/dump/if-then-else-list.txt
index 929f6ba3..56cf697f 100644
--- a/test/dump/if-then-else-list.txt
+++ b/test/dump/if-then-else-list.txt
@@ -6,54 +6,50 @@
(else (i32.const 4) (i32.const 5)))))
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
-0000004: 0a00 0000 ; WASM_BINARY_VERSION
-; section "signatures"
-0000008: 00 ; section size (guess)
-0000009: 0a ; string length
-000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
-0000014: 01 ; num signatures
-; signature 0
-0000015: 00 ; num params
-0000016: 00 ; result_type
-0000008: 0e ; FIXUP section size
-; section "function_signatures"
-0000017: 00 ; section size (guess)
-0000018: 13 ; string length
-0000019: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
-0000029: 7265 73 ; section id: "function_signatures"
-000002c: 01 ; num functions
-000002d: 00 ; function 0 signature index
-0000017: 16 ; FIXUP section size
-; section "function_bodies"
-000002e: 00 ; section size (guess)
-000002f: 0f ; string length
-0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
-000003f: 01 ; num functions
+0000004: 0b00 0000 ; WASM_BINARY_VERSION
+; section "type"
+0000008: 04 ; string length
+0000009: 7479 7065 ; section id: "type"
+000000d: 00 ; section size (guess)
+000000e: 01 ; num types
+; type 0
+000000f: 40 ; function form
+0000010: 00 ; num params
+0000011: 00 ; num results
+000000d: 04 ; FIXUP section size
+; section "function"
+0000012: 08 ; string length
+0000013: 6675 6e63 7469 6f6e ; section id: "function"
+000001b: 00 ; section size (guess)
+000001c: 01 ; num functions
+000001d: 00 ; function 0 signature index
+000001b: 02 ; FIXUP section size
+; section "code"
+000001e: 04 ; string length
+000001f: 636f 6465 ; section id: "code"
+0000023: 00 ; section size (guess)
+0000024: 01 ; num functions
; function body 0
-0000040: 00 ; func body size (guess)
-0000041: 00 ; local decl count
-0000042: 04 ; OPCODE_IF_ELSE
-0000043: 0a ; OPCODE_I32_CONST
-0000044: 01 ; i32 literal
-0000045: 01 ; OPCODE_BLOCK
-0000046: 02 ; num expressions
-0000047: 0a ; OPCODE_I32_CONST
-0000048: 02 ; i32 literal
-0000049: 0a ; OPCODE_I32_CONST
-000004a: 03 ; i32 literal
-000004b: 01 ; OPCODE_BLOCK
-000004c: 02 ; num expressions
-000004d: 0a ; OPCODE_I32_CONST
-000004e: 04 ; i32 literal
-000004f: 0a ; OPCODE_I32_CONST
-0000050: 05 ; i32 literal
-0000040: 10 ; FIXUP func body size
-000002e: 22 ; FIXUP section size
+0000025: 00 ; func body size (guess)
+0000026: 00 ; local decl count
+0000027: 10 ; OPCODE_I32_CONST
+0000028: 01 ; i32 literal
+0000029: 03 ; OPCODE_IF
+000002a: 10 ; OPCODE_I32_CONST
+000002b: 02 ; i32 literal
+000002c: 10 ; OPCODE_I32_CONST
+000002d: 03 ; i32 literal
+000002e: 04 ; OPCODE_ELSE
+000002f: 10 ; OPCODE_I32_CONST
+0000030: 04 ; i32 literal
+0000031: 10 ; OPCODE_I32_CONST
+0000032: 05 ; i32 literal
+0000033: 0f ; OPCODE_END
+0000025: 0e ; FIXUP func body size
+0000023: 10 ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0e0a 7369 676e 6174
-0000010: 7572 6573 0100 0016 1366 756e 6374 696f
-0000020: 6e5f 7369 676e 6174 7572 6573 0100 220f
-0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 7301
-0000040: 1000 040a 0101 020a 020a 0301 020a 040a
-0000050: 05
+0000000: 0061 736d 0b00 0000 0474 7970 6504 0140
+0000010: 0000 0866 756e 6374 696f 6e02 0100 0463
+0000020: 6f64 6510 010e 0010 0103 1002 1003 0410
+0000030: 0410 050f
;;; STDOUT ;;)
diff --git a/test/dump/if-then-list.txt b/test/dump/if-then-list.txt
index 4fb59e76..9732bc05 100644
--- a/test/dump/if-then-list.txt
+++ b/test/dump/if-then-list.txt
@@ -5,45 +5,42 @@
(then (nop) (nop)))))
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
-0000004: 0a00 0000 ; WASM_BINARY_VERSION
-; section "signatures"
-0000008: 00 ; section size (guess)
-0000009: 0a ; string length
-000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
-0000014: 01 ; num signatures
-; signature 0
-0000015: 00 ; num params
-0000016: 00 ; result_type
-0000008: 0e ; FIXUP section size
-; section "function_signatures"
-0000017: 00 ; section size (guess)
-0000018: 13 ; string length
-0000019: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
-0000029: 7265 73 ; section id: "function_signatures"
-000002c: 01 ; num functions
-000002d: 00 ; function 0 signature index
-0000017: 16 ; FIXUP section size
-; section "function_bodies"
-000002e: 00 ; section size (guess)
-000002f: 0f ; string length
-0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
-000003f: 01 ; num functions
+0000004: 0b00 0000 ; WASM_BINARY_VERSION
+; section "type"
+0000008: 04 ; string length
+0000009: 7479 7065 ; section id: "type"
+000000d: 00 ; section size (guess)
+000000e: 01 ; num types
+; type 0
+000000f: 40 ; function form
+0000010: 00 ; num params
+0000011: 00 ; num results
+000000d: 04 ; FIXUP section size
+; section "function"
+0000012: 08 ; string length
+0000013: 6675 6e63 7469 6f6e ; section id: "function"
+000001b: 00 ; section size (guess)
+000001c: 01 ; num functions
+000001d: 00 ; function 0 signature index
+000001b: 02 ; FIXUP section size
+; section "code"
+000001e: 04 ; string length
+000001f: 636f 6465 ; section id: "code"
+0000023: 00 ; section size (guess)
+0000024: 01 ; num functions
; function body 0
-0000040: 00 ; func body size (guess)
-0000041: 00 ; local decl count
-0000042: 03 ; OPCODE_IF
-0000043: 0a ; OPCODE_I32_CONST
-0000044: 01 ; i32 literal
-0000045: 01 ; OPCODE_BLOCK
-0000046: 02 ; num expressions
-0000047: 00 ; OPCODE_NOP
-0000048: 00 ; OPCODE_NOP
-0000040: 08 ; FIXUP func body size
-000002e: 1a ; FIXUP section size
+0000025: 00 ; func body size (guess)
+0000026: 00 ; local decl count
+0000027: 10 ; OPCODE_I32_CONST
+0000028: 01 ; i32 literal
+0000029: 03 ; OPCODE_IF
+000002a: 00 ; OPCODE_NOP
+000002b: 00 ; OPCODE_NOP
+000002c: 0f ; OPCODE_END
+0000025: 07 ; FIXUP func body size
+0000023: 09 ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0e0a 7369 676e 6174
-0000010: 7572 6573 0100 0016 1366 756e 6374 696f
-0000020: 6e5f 7369 676e 6174 7572 6573 0100 1a0f
-0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 7301
-0000040: 0800 030a 0101 0200 00
+0000000: 0061 736d 0b00 0000 0474 7970 6504 0140
+0000010: 0000 0866 756e 6374 696f 6e02 0100 0463
+0000020: 6f64 6509 0107 0010 0103 0000 0f
;;; STDOUT ;;)
diff --git a/test/dump/if.txt b/test/dump/if.txt
index ca02979a..e0e448a7 100644
--- a/test/dump/if.txt
+++ b/test/dump/if.txt
@@ -7,60 +7,64 @@
(if (i32.const 1) (return) (return))))
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
-0000004: 0a00 0000 ; WASM_BINARY_VERSION
-; section "signatures"
-0000008: 00 ; section size (guess)
-0000009: 0a ; string length
-000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
-0000014: 01 ; num signatures
-; signature 0
-0000015: 00 ; num params
-0000016: 00 ; result_type
-0000008: 0e ; FIXUP section size
-; section "function_signatures"
-0000017: 00 ; section size (guess)
-0000018: 13 ; string length
-0000019: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
-0000029: 7265 73 ; section id: "function_signatures"
-000002c: 02 ; num functions
-000002d: 00 ; function 0 signature index
-000002e: 00 ; function 1 signature index
-0000017: 17 ; FIXUP section size
-; section "function_bodies"
-000002f: 00 ; section size (guess)
-0000030: 0f ; string length
-0000031: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
-0000040: 02 ; num functions
+0000004: 0b00 0000 ; WASM_BINARY_VERSION
+; section "type"
+0000008: 04 ; string length
+0000009: 7479 7065 ; section id: "type"
+000000d: 00 ; section size (guess)
+000000e: 01 ; num types
+; type 0
+000000f: 40 ; function form
+0000010: 00 ; num params
+0000011: 00 ; num results
+000000d: 04 ; FIXUP section size
+; section "function"
+0000012: 08 ; string length
+0000013: 6675 6e63 7469 6f6e ; section id: "function"
+000001b: 00 ; section size (guess)
+000001c: 02 ; num functions
+000001d: 00 ; function 0 signature index
+000001e: 00 ; function 1 signature index
+000001b: 03 ; FIXUP section size
+; section "code"
+000001f: 04 ; string length
+0000020: 636f 6465 ; section id: "code"
+0000024: 00 ; section size (guess)
+0000025: 02 ; num functions
; function body 0
-0000041: 00 ; func body size (guess)
-0000042: 00 ; local decl count
-0000043: 03 ; OPCODE_IF
-0000044: 0a ; OPCODE_I32_CONST
-0000045: 01 ; i32 literal
-0000046: 00 ; OPCODE_NOP
-0000047: 04 ; OPCODE_IF_ELSE
-0000048: 0a ; OPCODE_I32_CONST
-0000049: 00 ; i32 literal
-000004a: 0d ; OPCODE_F32_CONST
-000004b: 0000 803f ; f32 literal
-000004f: 0d ; OPCODE_F32_CONST
-0000050: 0000 0040 ; f32 literal
-0000041: 12 ; FIXUP func body size
+0000026: 00 ; func body size (guess)
+0000027: 00 ; local decl count
+0000028: 10 ; OPCODE_I32_CONST
+0000029: 01 ; i32 literal
+000002a: 03 ; OPCODE_IF
+000002b: 00 ; OPCODE_NOP
+000002c: 0f ; OPCODE_END
+000002d: 10 ; OPCODE_I32_CONST
+000002e: 00 ; i32 literal
+000002f: 03 ; OPCODE_IF
+0000030: 13 ; OPCODE_F32_CONST
+0000031: 0000 803f ; f32 literal
+0000035: 04 ; OPCODE_ELSE
+0000036: 13 ; OPCODE_F32_CONST
+0000037: 0000 0040 ; f32 literal
+000003b: 0f ; OPCODE_END
+0000026: 15 ; FIXUP func body size
; function body 1
-0000054: 00 ; func body size (guess)
-0000055: 00 ; local decl count
-0000056: 04 ; OPCODE_IF_ELSE
-0000057: 0a ; OPCODE_I32_CONST
-0000058: 01 ; i32 literal
-0000059: 14 ; OPCODE_RETURN
-000005a: 14 ; OPCODE_RETURN
-0000054: 06 ; FIXUP func body size
-000002f: 2b ; FIXUP section size
+000003c: 00 ; func body size (guess)
+000003d: 00 ; local decl count
+000003e: 10 ; OPCODE_I32_CONST
+000003f: 01 ; i32 literal
+0000040: 03 ; OPCODE_IF
+0000041: 09 ; OPCODE_RETURN
+0000042: 04 ; OPCODE_ELSE
+0000043: 09 ; OPCODE_RETURN
+0000044: 0f ; OPCODE_END
+000003c: 08 ; FIXUP func body size
+0000024: 20 ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0e0a 7369 676e 6174
-0000010: 7572 6573 0100 0017 1366 756e 6374 696f
-0000020: 6e5f 7369 676e 6174 7572 6573 0200 002b
-0000030: 0f66 756e 6374 696f 6e5f 626f 6469 6573
-0000040: 0212 0003 0a01 0004 0a00 0d00 0080 3f0d
-0000050: 0000 0040 0600 040a 0114 14
+0000000: 0061 736d 0b00 0000 0474 7970 6504 0140
+0000010: 0000 0866 756e 6374 696f 6e03 0200 0004
+0000020: 636f 6465 2002 1500 1001 0300 0f10 0003
+0000030: 1300 0080 3f04 1300 0000 400f 0800 1001
+0000040: 0309 0409 0f
;;; STDOUT ;;)
diff --git a/test/dump/import.txt b/test/dump/import.txt
index d9bf0b10..777af92a 100644
--- a/test/dump/import.txt
+++ b/test/dump/import.txt
@@ -6,46 +6,49 @@
(import "ignored" "test2" (param i32) (result i32)))
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
-0000004: 0a00 0000 ; WASM_BINARY_VERSION
-; section "signatures"
-0000008: 00 ; section size (guess)
-0000009: 0a ; string length
-000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
-0000014: 02 ; num signatures
-; signature 0
-0000015: 04 ; num params
-0000016: 00 ; result_type
-0000017: 01 ; param type
-0000018: 02 ; param type
-0000019: 03 ; param type
-000001a: 04 ; param type
-; signature 1
-000001b: 01 ; num params
-000001c: 01 ; result_type
-000001d: 01 ; param type
-0000008: 15 ; FIXUP section size
-; section "import_table"
-000001e: 00 ; section size (guess)
-000001f: 0c ; string length
-0000020: 696d 706f 7274 5f74 6162 6c65 ; section id: "import_table"
-000002c: 02 ; num imports
+0000004: 0b00 0000 ; WASM_BINARY_VERSION
+; section "type"
+0000008: 04 ; string length
+0000009: 7479 7065 ; section id: "type"
+000000d: 00 ; section size (guess)
+000000e: 02 ; num types
+; type 0
+000000f: 40 ; function form
+0000010: 04 ; num params
+0000011: 01 ; param type
+0000012: 02 ; param type
+0000013: 03 ; param type
+0000014: 04 ; param type
+0000015: 00 ; num results
+; type 1
+0000016: 40 ; function form
+0000017: 01 ; num params
+0000018: 01 ; param type
+0000019: 01 ; num results
+000001a: 01 ; result_type
+000000d: 0d ; FIXUP section size
+; section "import"
+000001b: 06 ; string length
+000001c: 696d 706f 7274 ; section id: "import"
+0000022: 00 ; section size (guess)
+0000023: 02 ; num imports
; import header 0
-000002d: 00 ; import signature index
-000002e: 07 ; string length
-000002f: 6967 6e6f 7265 64 ignored ; import module name
-0000036: 04 ; string length
-0000037: 7465 7374 test ; import function name
+0000024: 00 ; import signature index
+0000025: 07 ; string length
+0000026: 6967 6e6f 7265 64 ignored ; import module name
+000002d: 04 ; string length
+000002e: 7465 7374 test ; import function name
; import header 1
-000003b: 01 ; import signature index
-000003c: 07 ; string length
-000003d: 6967 6e6f 7265 64 ignored ; import module name
-0000044: 05 ; string length
-0000045: 7465 7374 32 test2 ; import function name
-000001e: 2b ; FIXUP section size
+0000032: 01 ; import signature index
+0000033: 07 ; string length
+0000034: 6967 6e6f 7265 64 ignored ; import module name
+000003b: 05 ; string length
+000003c: 7465 7374 32 test2 ; import function name
+0000022: 1e ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 150a 7369 676e 6174
-0000010: 7572 6573 0204 0001 0203 0401 0101 2b0c
-0000020: 696d 706f 7274 5f74 6162 6c65 0200 0769
-0000030: 676e 6f72 6564 0474 6573 7401 0769 676e
-0000040: 6f72 6564 0574 6573 7432
+0000000: 0061 736d 0b00 0000 0474 7970 650d 0240
+0000010: 0401 0203 0400 4001 0101 0106 696d 706f
+0000020: 7274 1e02 0007 6967 6e6f 7265 6404 7465
+0000030: 7374 0107 6967 6e6f 7265 6405 7465 7374
+0000040: 32
;;; STDOUT ;;)
diff --git a/test/dump/load-aligned.txt b/test/dump/load-aligned.txt
index 6dfd6e13..6bf9b54a 100644
--- a/test/dump/load-aligned.txt
+++ b/test/dump/load-aligned.txt
@@ -37,188 +37,187 @@
(i64.load32_s align=8 (i32.const 0))))
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
-0000004: 0a00 0000 ; WASM_BINARY_VERSION
-; section "signatures"
-0000008: 00 ; section size (guess)
-0000009: 0a ; string length
-000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
-0000014: 01 ; num signatures
-; signature 0
-0000015: 00 ; num params
-0000016: 00 ; result_type
-0000008: 0e ; FIXUP section size
-; section "function_signatures"
-0000017: 00 ; section size (guess)
-0000018: 13 ; string length
-0000019: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
-0000029: 7265 73 ; section id: "function_signatures"
-000002c: 01 ; num functions
-000002d: 00 ; function 0 signature index
-0000017: 16 ; FIXUP section size
-; section "function_bodies"
-000002e: 00 ; section size (guess)
-000002f: 0f ; string length
-0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
-000003f: 01 ; num functions
+0000004: 0b00 0000 ; WASM_BINARY_VERSION
+; section "type"
+0000008: 04 ; string length
+0000009: 7479 7065 ; section id: "type"
+000000d: 00 ; section size (guess)
+000000e: 01 ; num types
+; type 0
+000000f: 40 ; function form
+0000010: 00 ; num params
+0000011: 00 ; num results
+000000d: 04 ; FIXUP section size
+; section "function"
+0000012: 08 ; string length
+0000013: 6675 6e63 7469 6f6e ; section id: "function"
+000001b: 00 ; section size (guess)
+000001c: 01 ; num functions
+000001d: 00 ; function 0 signature index
+000001b: 02 ; FIXUP section size
+; section "code"
+000001e: 04 ; string length
+000001f: 636f 6465 ; section id: "code"
+0000023: 00 ; section size (guess)
+0000024: 01 ; num functions
; function body 0
-0000040: 00 ; func body size (guess)
-0000041: 00 ; local decl count
-0000042: 20 ; OPCODE_I32_LOAD8_S
-0000043: 00 ; alignment
+0000025: 00 ; func body size (guess)
+0000026: 00 ; local decl count
+0000027: 10 ; OPCODE_I32_CONST
+0000028: 00 ; i32 literal
+0000029: 20 ; OPCODE_I32_LOAD8_S
+000002a: 00 ; alignment
+000002b: 00 ; load offset
+000002c: 10 ; OPCODE_I32_CONST
+000002d: 00 ; i32 literal
+000002e: 20 ; OPCODE_I32_LOAD8_S
+000002f: 01 ; alignment
+0000030: 00 ; load offset
+0000031: 10 ; OPCODE_I32_CONST
+0000032: 00 ; i32 literal
+0000033: 20 ; OPCODE_I32_LOAD8_S
+0000034: 02 ; alignment
+0000035: 00 ; load offset
+0000036: 10 ; OPCODE_I32_CONST
+0000037: 00 ; i32 literal
+0000038: 20 ; OPCODE_I32_LOAD8_S
+0000039: 03 ; alignment
+000003a: 00 ; load offset
+000003b: 10 ; OPCODE_I32_CONST
+000003c: 00 ; i32 literal
+000003d: 22 ; OPCODE_I32_LOAD16_S
+000003e: 00 ; alignment
+000003f: 00 ; load offset
+0000040: 10 ; OPCODE_I32_CONST
+0000041: 00 ; i32 literal
+0000042: 22 ; OPCODE_I32_LOAD16_S
+0000043: 01 ; alignment
0000044: 00 ; load offset
-0000045: 0a ; OPCODE_I32_CONST
+0000045: 10 ; OPCODE_I32_CONST
0000046: 00 ; i32 literal
-0000047: 20 ; OPCODE_I32_LOAD8_S
-0000048: 01 ; alignment
+0000047: 22 ; OPCODE_I32_LOAD16_S
+0000048: 02 ; alignment
0000049: 00 ; load offset
-000004a: 0a ; OPCODE_I32_CONST
+000004a: 10 ; OPCODE_I32_CONST
000004b: 00 ; i32 literal
-000004c: 20 ; OPCODE_I32_LOAD8_S
-000004d: 02 ; alignment
+000004c: 22 ; OPCODE_I32_LOAD16_S
+000004d: 03 ; alignment
000004e: 00 ; load offset
-000004f: 0a ; OPCODE_I32_CONST
+000004f: 10 ; OPCODE_I32_CONST
0000050: 00 ; i32 literal
-0000051: 20 ; OPCODE_I32_LOAD8_S
-0000052: 03 ; alignment
+0000051: 2a ; OPCODE_I32_LOAD
+0000052: 00 ; alignment
0000053: 00 ; load offset
-0000054: 0a ; OPCODE_I32_CONST
+0000054: 10 ; OPCODE_I32_CONST
0000055: 00 ; i32 literal
-0000056: 22 ; OPCODE_I32_LOAD16_S
-0000057: 00 ; alignment
+0000056: 2a ; OPCODE_I32_LOAD
+0000057: 01 ; alignment
0000058: 00 ; load offset
-0000059: 0a ; OPCODE_I32_CONST
+0000059: 10 ; OPCODE_I32_CONST
000005a: 00 ; i32 literal
-000005b: 22 ; OPCODE_I32_LOAD16_S
-000005c: 01 ; alignment
+000005b: 2a ; OPCODE_I32_LOAD
+000005c: 02 ; alignment
000005d: 00 ; load offset
-000005e: 0a ; OPCODE_I32_CONST
+000005e: 10 ; OPCODE_I32_CONST
000005f: 00 ; i32 literal
-0000060: 22 ; OPCODE_I32_LOAD16_S
-0000061: 02 ; alignment
+0000060: 2a ; OPCODE_I32_LOAD
+0000061: 03 ; alignment
0000062: 00 ; load offset
-0000063: 0a ; OPCODE_I32_CONST
+0000063: 10 ; OPCODE_I32_CONST
0000064: 00 ; i32 literal
-0000065: 22 ; OPCODE_I32_LOAD16_S
-0000066: 03 ; alignment
+0000065: 2b ; OPCODE_I64_LOAD
+0000066: 00 ; alignment
0000067: 00 ; load offset
-0000068: 0a ; OPCODE_I32_CONST
+0000068: 10 ; OPCODE_I32_CONST
0000069: 00 ; i32 literal
-000006a: 2a ; OPCODE_I32_LOAD
-000006b: 00 ; alignment
+000006a: 2b ; OPCODE_I64_LOAD
+000006b: 01 ; alignment
000006c: 00 ; load offset
-000006d: 0a ; OPCODE_I32_CONST
+000006d: 10 ; OPCODE_I32_CONST
000006e: 00 ; i32 literal
-000006f: 2a ; OPCODE_I32_LOAD
-0000070: 01 ; alignment
+000006f: 2b ; OPCODE_I64_LOAD
+0000070: 02 ; alignment
0000071: 00 ; load offset
-0000072: 0a ; OPCODE_I32_CONST
+0000072: 10 ; OPCODE_I32_CONST
0000073: 00 ; i32 literal
-0000074: 2a ; OPCODE_I32_LOAD
-0000075: 02 ; alignment
+0000074: 2b ; OPCODE_I64_LOAD
+0000075: 03 ; alignment
0000076: 00 ; load offset
-0000077: 0a ; OPCODE_I32_CONST
+0000077: 10 ; OPCODE_I32_CONST
0000078: 00 ; i32 literal
-0000079: 2a ; OPCODE_I32_LOAD
-000007a: 03 ; alignment
+0000079: 24 ; OPCODE_I64_LOAD8_S
+000007a: 00 ; alignment
000007b: 00 ; load offset
-000007c: 0a ; OPCODE_I32_CONST
+000007c: 10 ; OPCODE_I32_CONST
000007d: 00 ; i32 literal
-000007e: 2b ; OPCODE_I64_LOAD
-000007f: 00 ; alignment
+000007e: 24 ; OPCODE_I64_LOAD8_S
+000007f: 01 ; alignment
0000080: 00 ; load offset
-0000081: 0a ; OPCODE_I32_CONST
+0000081: 10 ; OPCODE_I32_CONST
0000082: 00 ; i32 literal
-0000083: 2b ; OPCODE_I64_LOAD
-0000084: 01 ; alignment
+0000083: 24 ; OPCODE_I64_LOAD8_S
+0000084: 02 ; alignment
0000085: 00 ; load offset
-0000086: 0a ; OPCODE_I32_CONST
+0000086: 10 ; OPCODE_I32_CONST
0000087: 00 ; i32 literal
-0000088: 2b ; OPCODE_I64_LOAD
-0000089: 02 ; alignment
+0000088: 24 ; OPCODE_I64_LOAD8_S
+0000089: 03 ; alignment
000008a: 00 ; load offset
-000008b: 0a ; OPCODE_I32_CONST
+000008b: 10 ; OPCODE_I32_CONST
000008c: 00 ; i32 literal
-000008d: 2b ; OPCODE_I64_LOAD
-000008e: 03 ; alignment
+000008d: 26 ; OPCODE_I64_LOAD16_S
+000008e: 00 ; alignment
000008f: 00 ; load offset
-0000090: 0a ; OPCODE_I32_CONST
+0000090: 10 ; OPCODE_I32_CONST
0000091: 00 ; i32 literal
-0000092: 24 ; OPCODE_I64_LOAD8_S
-0000093: 00 ; alignment
+0000092: 26 ; OPCODE_I64_LOAD16_S
+0000093: 01 ; alignment
0000094: 00 ; load offset
-0000095: 0a ; OPCODE_I32_CONST
+0000095: 10 ; OPCODE_I32_CONST
0000096: 00 ; i32 literal
-0000097: 24 ; OPCODE_I64_LOAD8_S
-0000098: 01 ; alignment
+0000097: 26 ; OPCODE_I64_LOAD16_S
+0000098: 02 ; alignment
0000099: 00 ; load offset
-000009a: 0a ; OPCODE_I32_CONST
+000009a: 10 ; OPCODE_I32_CONST
000009b: 00 ; i32 literal
-000009c: 24 ; OPCODE_I64_LOAD8_S
-000009d: 02 ; alignment
+000009c: 26 ; OPCODE_I64_LOAD16_S
+000009d: 03 ; alignment
000009e: 00 ; load offset
-000009f: 0a ; OPCODE_I32_CONST
+000009f: 10 ; OPCODE_I32_CONST
00000a0: 00 ; i32 literal
-00000a1: 24 ; OPCODE_I64_LOAD8_S
-00000a2: 03 ; alignment
+00000a1: 28 ; OPCODE_I64_LOAD32_S
+00000a2: 00 ; alignment
00000a3: 00 ; load offset
-00000a4: 0a ; OPCODE_I32_CONST
+00000a4: 10 ; OPCODE_I32_CONST
00000a5: 00 ; i32 literal
-00000a6: 26 ; OPCODE_I64_LOAD16_S
-00000a7: 00 ; alignment
+00000a6: 28 ; OPCODE_I64_LOAD32_S
+00000a7: 01 ; alignment
00000a8: 00 ; load offset
-00000a9: 0a ; OPCODE_I32_CONST
+00000a9: 10 ; OPCODE_I32_CONST
00000aa: 00 ; i32 literal
-00000ab: 26 ; OPCODE_I64_LOAD16_S
-00000ac: 01 ; alignment
+00000ab: 28 ; OPCODE_I64_LOAD32_S
+00000ac: 02 ; alignment
00000ad: 00 ; load offset
-00000ae: 0a ; OPCODE_I32_CONST
+00000ae: 10 ; OPCODE_I32_CONST
00000af: 00 ; i32 literal
-00000b0: 26 ; OPCODE_I64_LOAD16_S
-00000b1: 02 ; alignment
+00000b0: 28 ; OPCODE_I64_LOAD32_S
+00000b1: 03 ; alignment
00000b2: 00 ; load offset
-00000b3: 0a ; OPCODE_I32_CONST
-00000b4: 00 ; i32 literal
-00000b5: 26 ; OPCODE_I64_LOAD16_S
-00000b6: 03 ; alignment
-00000b7: 00 ; load offset
-00000b8: 0a ; OPCODE_I32_CONST
-00000b9: 00 ; i32 literal
-00000ba: 28 ; OPCODE_I64_LOAD32_S
-00000bb: 00 ; alignment
-00000bc: 00 ; load offset
-00000bd: 0a ; OPCODE_I32_CONST
-00000be: 00 ; i32 literal
-00000bf: 28 ; OPCODE_I64_LOAD32_S
-00000c0: 01 ; alignment
-00000c1: 00 ; load offset
-00000c2: 0a ; OPCODE_I32_CONST
-00000c3: 00 ; i32 literal
-00000c4: 28 ; OPCODE_I64_LOAD32_S
-00000c5: 02 ; alignment
-00000c6: 00 ; load offset
-00000c7: 0a ; OPCODE_I32_CONST
-00000c8: 00 ; i32 literal
-00000c9: 28 ; OPCODE_I64_LOAD32_S
-00000ca: 03 ; alignment
-00000cb: 00 ; load offset
-00000cc: 0a ; OPCODE_I32_CONST
-00000cd: 00 ; i32 literal
-; move data: [41, ce) -> [42, cf)
-0000040: 8d01 ; FIXUP func body size
-; move data: [2f, cf) -> [30, d0)
-000002e: a001 ; FIXUP section size
+; move data: [26, b3) -> [27, b4)
+0000025: 8d01 ; FIXUP func body size
+; move data: [24, b4) -> [25, b5)
+0000023: 9001 ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0e0a 7369 676e 6174
-0000010: 7572 6573 0100 0016 1366 756e 6374 696f
-0000020: 6e5f 7369 676e 6174 7572 6573 0100 a001
-0000030: 0f66 756e 6374 696f 6e5f 626f 6469 6573
-0000040: 018d 0100 2000 000a 0020 0100 0a00 2002
-0000050: 000a 0020 0300 0a00 2200 000a 0022 0100
-0000060: 0a00 2202 000a 0022 0300 0a00 2a00 000a
-0000070: 002a 0100 0a00 2a02 000a 002a 0300 0a00
-0000080: 2b00 000a 002b 0100 0a00 2b02 000a 002b
-0000090: 0300 0a00 2400 000a 0024 0100 0a00 2402
-00000a0: 000a 0024 0300 0a00 2600 000a 0026 0100
-00000b0: 0a00 2602 000a 0026 0300 0a00 2800 000a
-00000c0: 0028 0100 0a00 2802 000a 0028 0300 0a00
+0000000: 0061 736d 0b00 0000 0474 7970 6504 0140
+0000010: 0000 0866 756e 6374 696f 6e02 0100 0463
+0000020: 6f64 6590 0101 8d01 0010 0020 0000 1000
+0000030: 2001 0010 0020 0200 1000 2003 0010 0022
+0000040: 0000 1000 2201 0010 0022 0200 1000 2203
+0000050: 0010 002a 0000 1000 2a01 0010 002a 0200
+0000060: 1000 2a03 0010 002b 0000 1000 2b01 0010
+0000070: 002b 0200 1000 2b03 0010 0024 0000 1000
+0000080: 2401 0010 0024 0200 1000 2403 0010 0026
+0000090: 0000 1000 2601 0010 0026 0200 1000 2603
+00000a0: 0010 0028 0000 1000 2801 0010 0028 0200
+00000b0: 1000 2803 00
;;; STDOUT ;;)
diff --git a/test/dump/load.txt b/test/dump/load.txt
index c8a58e25..017502a3 100644
--- a/test/dump/load.txt
+++ b/test/dump/load.txt
@@ -17,112 +17,110 @@
(f64.load (i32.const 0))))
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
-0000004: 0a00 0000 ; WASM_BINARY_VERSION
-; section "signatures"
-0000008: 00 ; section size (guess)
-0000009: 0a ; string length
-000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
-0000014: 01 ; num signatures
-; signature 0
-0000015: 00 ; num params
-0000016: 00 ; result_type
-0000008: 0e ; FIXUP section size
-; section "function_signatures"
-0000017: 00 ; section size (guess)
-0000018: 13 ; string length
-0000019: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
-0000029: 7265 73 ; section id: "function_signatures"
-000002c: 01 ; num functions
-000002d: 00 ; function 0 signature index
-0000017: 16 ; FIXUP section size
-; section "function_bodies"
-000002e: 00 ; section size (guess)
-000002f: 0f ; string length
-0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
-000003f: 01 ; num functions
+0000004: 0b00 0000 ; WASM_BINARY_VERSION
+; section "type"
+0000008: 04 ; string length
+0000009: 7479 7065 ; section id: "type"
+000000d: 00 ; section size (guess)
+000000e: 01 ; num types
+; type 0
+000000f: 40 ; function form
+0000010: 00 ; num params
+0000011: 00 ; num results
+000000d: 04 ; FIXUP section size
+; section "function"
+0000012: 08 ; string length
+0000013: 6675 6e63 7469 6f6e ; section id: "function"
+000001b: 00 ; section size (guess)
+000001c: 01 ; num functions
+000001d: 00 ; function 0 signature index
+000001b: 02 ; FIXUP section size
+; section "code"
+000001e: 04 ; string length
+000001f: 636f 6465 ; section id: "code"
+0000023: 00 ; section size (guess)
+0000024: 01 ; num functions
; function body 0
-0000040: 00 ; func body size (guess)
-0000041: 00 ; local decl count
-0000042: 2a ; OPCODE_I32_LOAD
-0000043: 02 ; alignment
+0000025: 00 ; func body size (guess)
+0000026: 00 ; local decl count
+0000027: 10 ; OPCODE_I32_CONST
+0000028: 00 ; i32 literal
+0000029: 2a ; OPCODE_I32_LOAD
+000002a: 02 ; alignment
+000002b: 00 ; load offset
+000002c: 10 ; OPCODE_I32_CONST
+000002d: 00 ; i32 literal
+000002e: 20 ; OPCODE_I32_LOAD8_S
+000002f: 00 ; alignment
+0000030: 00 ; load offset
+0000031: 10 ; OPCODE_I32_CONST
+0000032: 00 ; i32 literal
+0000033: 22 ; OPCODE_I32_LOAD16_S
+0000034: 01 ; alignment
+0000035: 00 ; load offset
+0000036: 10 ; OPCODE_I32_CONST
+0000037: 00 ; i32 literal
+0000038: 21 ; OPCODE_I32_LOAD8_U
+0000039: 00 ; alignment
+000003a: 00 ; load offset
+000003b: 10 ; OPCODE_I32_CONST
+000003c: 00 ; i32 literal
+000003d: 23 ; OPCODE_I32_LOAD16_U
+000003e: 01 ; alignment
+000003f: 00 ; load offset
+0000040: 10 ; OPCODE_I32_CONST
+0000041: 00 ; i32 literal
+0000042: 2b ; OPCODE_I64_LOAD
+0000043: 03 ; alignment
0000044: 00 ; load offset
-0000045: 0a ; OPCODE_I32_CONST
+0000045: 10 ; OPCODE_I32_CONST
0000046: 00 ; i32 literal
-0000047: 20 ; OPCODE_I32_LOAD8_S
+0000047: 24 ; OPCODE_I64_LOAD8_S
0000048: 00 ; alignment
0000049: 00 ; load offset
-000004a: 0a ; OPCODE_I32_CONST
+000004a: 10 ; OPCODE_I32_CONST
000004b: 00 ; i32 literal
-000004c: 22 ; OPCODE_I32_LOAD16_S
+000004c: 26 ; OPCODE_I64_LOAD16_S
000004d: 01 ; alignment
000004e: 00 ; load offset
-000004f: 0a ; OPCODE_I32_CONST
+000004f: 10 ; OPCODE_I32_CONST
0000050: 00 ; i32 literal
-0000051: 21 ; OPCODE_I32_LOAD8_U
-0000052: 00 ; alignment
+0000051: 28 ; OPCODE_I64_LOAD32_S
+0000052: 02 ; alignment
0000053: 00 ; load offset
-0000054: 0a ; OPCODE_I32_CONST
+0000054: 10 ; OPCODE_I32_CONST
0000055: 00 ; i32 literal
-0000056: 23 ; OPCODE_I32_LOAD16_U
-0000057: 01 ; alignment
+0000056: 25 ; OPCODE_I64_LOAD8_U
+0000057: 00 ; alignment
0000058: 00 ; load offset
-0000059: 0a ; OPCODE_I32_CONST
+0000059: 10 ; OPCODE_I32_CONST
000005a: 00 ; i32 literal
-000005b: 2b ; OPCODE_I64_LOAD
-000005c: 03 ; alignment
+000005b: 27 ; OPCODE_I64_LOAD16_U
+000005c: 01 ; alignment
000005d: 00 ; load offset
-000005e: 0a ; OPCODE_I32_CONST
+000005e: 10 ; OPCODE_I32_CONST
000005f: 00 ; i32 literal
-0000060: 24 ; OPCODE_I64_LOAD8_S
-0000061: 00 ; alignment
+0000060: 29 ; OPCODE_I64_LOAD32_U
+0000061: 02 ; alignment
0000062: 00 ; load offset
-0000063: 0a ; OPCODE_I32_CONST
+0000063: 10 ; OPCODE_I32_CONST
0000064: 00 ; i32 literal
-0000065: 26 ; OPCODE_I64_LOAD16_S
-0000066: 01 ; alignment
+0000065: 2c ; OPCODE_F32_LOAD
+0000066: 02 ; alignment
0000067: 00 ; load offset
-0000068: 0a ; OPCODE_I32_CONST
+0000068: 10 ; OPCODE_I32_CONST
0000069: 00 ; i32 literal
-000006a: 28 ; OPCODE_I64_LOAD32_S
-000006b: 02 ; alignment
+000006a: 2d ; OPCODE_F64_LOAD
+000006b: 03 ; alignment
000006c: 00 ; load offset
-000006d: 0a ; OPCODE_I32_CONST
-000006e: 00 ; i32 literal
-000006f: 25 ; OPCODE_I64_LOAD8_U
-0000070: 00 ; alignment
-0000071: 00 ; load offset
-0000072: 0a ; OPCODE_I32_CONST
-0000073: 00 ; i32 literal
-0000074: 27 ; OPCODE_I64_LOAD16_U
-0000075: 01 ; alignment
-0000076: 00 ; load offset
-0000077: 0a ; OPCODE_I32_CONST
-0000078: 00 ; i32 literal
-0000079: 29 ; OPCODE_I64_LOAD32_U
-000007a: 02 ; alignment
-000007b: 00 ; load offset
-000007c: 0a ; OPCODE_I32_CONST
-000007d: 00 ; i32 literal
-000007e: 2c ; OPCODE_F32_LOAD
-000007f: 02 ; alignment
-0000080: 00 ; load offset
-0000081: 0a ; OPCODE_I32_CONST
-0000082: 00 ; i32 literal
-0000083: 2d ; OPCODE_F64_LOAD
-0000084: 03 ; alignment
-0000085: 00 ; load offset
-0000086: 0a ; OPCODE_I32_CONST
-0000087: 00 ; i32 literal
-0000040: 47 ; FIXUP func body size
-000002e: 59 ; FIXUP section size
+0000025: 47 ; FIXUP func body size
+0000023: 49 ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0e0a 7369 676e 6174
-0000010: 7572 6573 0100 0016 1366 756e 6374 696f
-0000020: 6e5f 7369 676e 6174 7572 6573 0100 590f
-0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 7301
-0000040: 4700 2a02 000a 0020 0000 0a00 2201 000a
-0000050: 0021 0000 0a00 2301 000a 002b 0300 0a00
-0000060: 2400 000a 0026 0100 0a00 2802 000a 0025
-0000070: 0000 0a00 2701 000a 0029 0200 0a00 2c02
-0000080: 000a 002d 0300 0a00
+0000000: 0061 736d 0b00 0000 0474 7970 6504 0140
+0000010: 0000 0866 756e 6374 696f 6e02 0100 0463
+0000020: 6f64 6549 0147 0010 002a 0200 1000 2000
+0000030: 0010 0022 0100 1000 2100 0010 0023 0100
+0000040: 1000 2b03 0010 0024 0000 1000 2601 0010
+0000050: 0028 0200 1000 2500 0010 0027 0100 1000
+0000060: 2902 0010 002c 0200 1000 2d03 00
;;; STDOUT ;;)
diff --git a/test/dump/locals.txt b/test/dump/locals.txt
index 101ce385..70d3d688 100644
--- a/test/dump/locals.txt
+++ b/test/dump/locals.txt
@@ -3,46 +3,44 @@
(func (local i32 i64 i64 f32 f32 f32 f64 f64 f64 f64)))
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
-0000004: 0a00 0000 ; WASM_BINARY_VERSION
-; section "signatures"
-0000008: 00 ; section size (guess)
-0000009: 0a ; string length
-000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
-0000014: 01 ; num signatures
-; signature 0
-0000015: 00 ; num params
-0000016: 00 ; result_type
-0000008: 0e ; FIXUP section size
-; section "function_signatures"
-0000017: 00 ; section size (guess)
-0000018: 13 ; string length
-0000019: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
-0000029: 7265 73 ; section id: "function_signatures"
-000002c: 01 ; num functions
-000002d: 00 ; function 0 signature index
-0000017: 16 ; FIXUP section size
-; section "function_bodies"
-000002e: 00 ; section size (guess)
-000002f: 0f ; string length
-0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
-000003f: 01 ; num functions
+0000004: 0b00 0000 ; WASM_BINARY_VERSION
+; section "type"
+0000008: 04 ; string length
+0000009: 7479 7065 ; section id: "type"
+000000d: 00 ; section size (guess)
+000000e: 01 ; num types
+; type 0
+000000f: 40 ; function form
+0000010: 00 ; num params
+0000011: 00 ; num results
+000000d: 04 ; FIXUP section size
+; section "function"
+0000012: 08 ; string length
+0000013: 6675 6e63 7469 6f6e ; section id: "function"
+000001b: 00 ; section size (guess)
+000001c: 01 ; num functions
+000001d: 00 ; function 0 signature index
+000001b: 02 ; FIXUP section size
+; section "code"
+000001e: 04 ; string length
+000001f: 636f 6465 ; section id: "code"
+0000023: 00 ; section size (guess)
+0000024: 01 ; num functions
; function body 0
-0000040: 00 ; func body size (guess)
-0000041: 04 ; local decl count
-0000042: 01 ; local type count
-0000043: 01 ; WASM_TYPE_I32
-0000044: 02 ; local type count
-0000045: 02 ; WASM_TYPE_I64
-0000046: 03 ; local type count
-0000047: 03 ; WASM_TYPE_F32
-0000048: 04 ; local type count
-0000049: 04 ; WASM_TYPE_F64
-0000040: 09 ; FIXUP func body size
-000002e: 1b ; FIXUP section size
+0000025: 00 ; func body size (guess)
+0000026: 04 ; local decl count
+0000027: 01 ; local type count
+0000028: 01 ; WASM_TYPE_I32
+0000029: 02 ; local type count
+000002a: 02 ; WASM_TYPE_I64
+000002b: 03 ; local type count
+000002c: 03 ; WASM_TYPE_F32
+000002d: 04 ; local type count
+000002e: 04 ; WASM_TYPE_F64
+0000025: 09 ; FIXUP func body size
+0000023: 0b ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0e0a 7369 676e 6174
-0000010: 7572 6573 0100 0016 1366 756e 6374 696f
-0000020: 6e5f 7369 676e 6174 7572 6573 0100 1b0f
-0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 7301
-0000040: 0904 0101 0202 0303 0404
+0000000: 0061 736d 0b00 0000 0474 7970 6504 0140
+0000010: 0000 0866 756e 6374 696f 6e02 0100 0463
+0000020: 6f64 650b 0109 0401 0102 0203 0304 04
;;; STDOUT ;;)
diff --git a/test/dump/loop-257-exprs-br.txt b/test/dump/loop-257-exprs-br.txt
index 214d0163..d0515bce 100644
--- a/test/dump/loop-257-exprs-br.txt
+++ b/test/dump/loop-257-exprs-br.txt
@@ -50,34 +50,62 @@
)))
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
-0000004: 0a00 0000 ; WASM_BINARY_VERSION
-; section "signatures"
-0000008: 00 ; section size (guess)
-0000009: 0a ; string length
-000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
-0000014: 01 ; num signatures
-; signature 0
-0000015: 00 ; num params
-0000016: 00 ; result_type
-0000008: 0e ; FIXUP section size
-; section "function_signatures"
-0000017: 00 ; section size (guess)
-0000018: 13 ; string length
-0000019: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
-0000029: 7265 73 ; section id: "function_signatures"
-000002c: 01 ; num functions
-000002d: 00 ; function 0 signature index
-0000017: 16 ; FIXUP section size
-; section "function_bodies"
-000002e: 00 ; section size (guess)
-000002f: 0f ; string length
-0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
-000003f: 01 ; num functions
+0000004: 0b00 0000 ; WASM_BINARY_VERSION
+; section "type"
+0000008: 04 ; string length
+0000009: 7479 7065 ; section id: "type"
+000000d: 00 ; section size (guess)
+000000e: 01 ; num types
+; type 0
+000000f: 40 ; function form
+0000010: 00 ; num params
+0000011: 00 ; num results
+000000d: 04 ; FIXUP section size
+; section "function"
+0000012: 08 ; string length
+0000013: 6675 6e63 7469 6f6e ; section id: "function"
+000001b: 00 ; section size (guess)
+000001c: 01 ; num functions
+000001d: 00 ; function 0 signature index
+000001b: 02 ; FIXUP section size
+; section "code"
+000001e: 04 ; string length
+000001f: 636f 6465 ; section id: "code"
+0000023: 00 ; section size (guess)
+0000024: 01 ; num functions
; function body 0
-0000040: 00 ; func body size (guess)
-0000041: 00 ; local decl count
-0000042: 02 ; OPCODE_LOOP
-0000043: 8402 ; num expressions
+0000025: 00 ; func body size (guess)
+0000026: 00 ; local decl count
+0000027: 02 ; OPCODE_LOOP
+0000028: 00 ; OPCODE_NOP
+0000029: 00 ; OPCODE_NOP
+000002a: 00 ; OPCODE_NOP
+000002b: 00 ; OPCODE_NOP
+000002c: 00 ; OPCODE_NOP
+000002d: 00 ; OPCODE_NOP
+000002e: 00 ; OPCODE_NOP
+000002f: 00 ; OPCODE_NOP
+0000030: 00 ; OPCODE_NOP
+0000031: 00 ; OPCODE_NOP
+0000032: 00 ; OPCODE_NOP
+0000033: 00 ; OPCODE_NOP
+0000034: 00 ; OPCODE_NOP
+0000035: 00 ; OPCODE_NOP
+0000036: 00 ; OPCODE_NOP
+0000037: 00 ; OPCODE_NOP
+0000038: 00 ; OPCODE_NOP
+0000039: 00 ; OPCODE_NOP
+000003a: 00 ; OPCODE_NOP
+000003b: 00 ; OPCODE_NOP
+000003c: 00 ; OPCODE_NOP
+000003d: 00 ; OPCODE_NOP
+000003e: 00 ; OPCODE_NOP
+000003f: 00 ; OPCODE_NOP
+0000040: 00 ; OPCODE_NOP
+0000041: 00 ; OPCODE_NOP
+0000042: 00 ; OPCODE_NOP
+0000043: 00 ; OPCODE_NOP
+0000044: 00 ; OPCODE_NOP
0000045: 00 ; OPCODE_NOP
0000046: 00 ; OPCODE_NOP
0000047: 00 ; OPCODE_NOP
@@ -306,56 +334,28 @@
0000126: 00 ; OPCODE_NOP
0000127: 00 ; OPCODE_NOP
0000128: 00 ; OPCODE_NOP
-0000129: 00 ; OPCODE_NOP
-000012a: 00 ; OPCODE_NOP
+0000129: 06 ; OPCODE_BR
+000012a: 01 ; break depth
000012b: 00 ; OPCODE_NOP
-000012c: 00 ; OPCODE_NOP
-000012d: 00 ; OPCODE_NOP
+000012c: 06 ; OPCODE_BR
+000012d: 00 ; break depth
000012e: 00 ; OPCODE_NOP
-000012f: 00 ; OPCODE_NOP
-0000130: 00 ; OPCODE_NOP
+000012f: 06 ; OPCODE_BR
+0000130: 01 ; break depth
0000131: 00 ; OPCODE_NOP
-0000132: 00 ; OPCODE_NOP
-0000133: 00 ; OPCODE_NOP
-0000134: 00 ; OPCODE_NOP
-0000135: 00 ; OPCODE_NOP
-0000136: 00 ; OPCODE_NOP
-0000137: 00 ; OPCODE_NOP
-0000138: 00 ; OPCODE_NOP
-0000139: 00 ; OPCODE_NOP
-000013a: 00 ; OPCODE_NOP
-000013b: 00 ; OPCODE_NOP
-000013c: 00 ; OPCODE_NOP
-000013d: 00 ; OPCODE_NOP
-000013e: 00 ; OPCODE_NOP
-000013f: 00 ; OPCODE_NOP
-0000140: 00 ; OPCODE_NOP
-0000141: 00 ; OPCODE_NOP
-0000142: 00 ; OPCODE_NOP
-0000143: 00 ; OPCODE_NOP
-0000144: 00 ; OPCODE_NOP
-0000145: 06 ; OPCODE_BR
-0000146: 01 ; break depth
-0000147: 00 ; OPCODE_NOP
-0000148: 06 ; OPCODE_BR
-0000149: 00 ; break depth
-000014a: 00 ; OPCODE_NOP
-000014b: 06 ; OPCODE_BR
-000014c: 01 ; break depth
-000014d: 00 ; OPCODE_NOP
-000014e: 06 ; OPCODE_BR
-000014f: 00 ; break depth
-0000150: 00 ; OPCODE_NOP
-; move data: [41, 151) -> [42, 152)
-0000040: 9002 ; FIXUP func body size
-; move data: [2f, 152) -> [30, 153)
-000002e: a302 ; FIXUP section size
+0000132: 06 ; OPCODE_BR
+0000133: 00 ; break depth
+0000134: 0f ; OPCODE_END
+; move data: [26, 135) -> [27, 136)
+0000025: 8f02 ; FIXUP func body size
+; move data: [24, 136) -> [25, 137)
+0000023: 9202 ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0e0a 7369 676e 6174
-0000010: 7572 6573 0100 0016 1366 756e 6374 696f
-0000020: 6e5f 7369 676e 6174 7572 6573 0100 a302
-0000030: 0f66 756e 6374 696f 6e5f 626f 6469 6573
-0000040: 0190 0200 0284 0200 0000 0000 0000 0000
+0000000: 0061 736d 0b00 0000 0474 7970 6504 0140
+0000010: 0000 0866 756e 6374 696f 6e02 0100 0463
+0000020: 6f64 6592 0201 8f02 0002 0000 0000 0000
+0000030: 0000 0000 0000 0000 0000 0000 0000 0000
+0000040: 0000 0000 0000 0000 0000 0000 0000 0000
0000050: 0000 0000 0000 0000 0000 0000 0000 0000
0000060: 0000 0000 0000 0000 0000 0000 0000 0000
0000070: 0000 0000 0000 0000 0000 0000 0000 0000
@@ -369,8 +369,6 @@
00000f0: 0000 0000 0000 0000 0000 0000 0000 0000
0000100: 0000 0000 0000 0000 0000 0000 0000 0000
0000110: 0000 0000 0000 0000 0000 0000 0000 0000
-0000120: 0000 0000 0000 0000 0000 0000 0000 0000
-0000130: 0000 0000 0000 0000 0000 0000 0000 0000
-0000140: 0000 0000 0000 0006 0100 0600 0006 0100
-0000150: 0600 00
+0000120: 0000 0000 0000 0000 0000 0006 0100 0600
+0000130: 0006 0100 0600 0f
;;; STDOUT ;;)
diff --git a/test/dump/loop-257-exprs.txt b/test/dump/loop-257-exprs.txt
index 78da519b..ff83bda4 100644
--- a/test/dump/loop-257-exprs.txt
+++ b/test/dump/loop-257-exprs.txt
@@ -46,34 +46,62 @@
(nop))))
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
-0000004: 0a00 0000 ; WASM_BINARY_VERSION
-; section "signatures"
-0000008: 00 ; section size (guess)
-0000009: 0a ; string length
-000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
-0000014: 01 ; num signatures
-; signature 0
-0000015: 00 ; num params
-0000016: 00 ; result_type
-0000008: 0e ; FIXUP section size
-; section "function_signatures"
-0000017: 00 ; section size (guess)
-0000018: 13 ; string length
-0000019: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
-0000029: 7265 73 ; section id: "function_signatures"
-000002c: 01 ; num functions
-000002d: 00 ; function 0 signature index
-0000017: 16 ; FIXUP section size
-; section "function_bodies"
-000002e: 00 ; section size (guess)
-000002f: 0f ; string length
-0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
-000003f: 01 ; num functions
+0000004: 0b00 0000 ; WASM_BINARY_VERSION
+; section "type"
+0000008: 04 ; string length
+0000009: 7479 7065 ; section id: "type"
+000000d: 00 ; section size (guess)
+000000e: 01 ; num types
+; type 0
+000000f: 40 ; function form
+0000010: 00 ; num params
+0000011: 00 ; num results
+000000d: 04 ; FIXUP section size
+; section "function"
+0000012: 08 ; string length
+0000013: 6675 6e63 7469 6f6e ; section id: "function"
+000001b: 00 ; section size (guess)
+000001c: 01 ; num functions
+000001d: 00 ; function 0 signature index
+000001b: 02 ; FIXUP section size
+; section "code"
+000001e: 04 ; string length
+000001f: 636f 6465 ; section id: "code"
+0000023: 00 ; section size (guess)
+0000024: 01 ; num functions
; function body 0
-0000040: 00 ; func body size (guess)
-0000041: 00 ; local decl count
-0000042: 02 ; OPCODE_LOOP
-0000043: 8102 ; num expressions
+0000025: 00 ; func body size (guess)
+0000026: 00 ; local decl count
+0000027: 02 ; OPCODE_LOOP
+0000028: 00 ; OPCODE_NOP
+0000029: 00 ; OPCODE_NOP
+000002a: 00 ; OPCODE_NOP
+000002b: 00 ; OPCODE_NOP
+000002c: 00 ; OPCODE_NOP
+000002d: 00 ; OPCODE_NOP
+000002e: 00 ; OPCODE_NOP
+000002f: 00 ; OPCODE_NOP
+0000030: 00 ; OPCODE_NOP
+0000031: 00 ; OPCODE_NOP
+0000032: 00 ; OPCODE_NOP
+0000033: 00 ; OPCODE_NOP
+0000034: 00 ; OPCODE_NOP
+0000035: 00 ; OPCODE_NOP
+0000036: 00 ; OPCODE_NOP
+0000037: 00 ; OPCODE_NOP
+0000038: 00 ; OPCODE_NOP
+0000039: 00 ; OPCODE_NOP
+000003a: 00 ; OPCODE_NOP
+000003b: 00 ; OPCODE_NOP
+000003c: 00 ; OPCODE_NOP
+000003d: 00 ; OPCODE_NOP
+000003e: 00 ; OPCODE_NOP
+000003f: 00 ; OPCODE_NOP
+0000040: 00 ; OPCODE_NOP
+0000041: 00 ; OPCODE_NOP
+0000042: 00 ; OPCODE_NOP
+0000043: 00 ; OPCODE_NOP
+0000044: 00 ; OPCODE_NOP
0000045: 00 ; OPCODE_NOP
0000046: 00 ; OPCODE_NOP
0000047: 00 ; OPCODE_NOP
@@ -302,45 +330,17 @@
0000126: 00 ; OPCODE_NOP
0000127: 00 ; OPCODE_NOP
0000128: 00 ; OPCODE_NOP
-0000129: 00 ; OPCODE_NOP
-000012a: 00 ; OPCODE_NOP
-000012b: 00 ; OPCODE_NOP
-000012c: 00 ; OPCODE_NOP
-000012d: 00 ; OPCODE_NOP
-000012e: 00 ; OPCODE_NOP
-000012f: 00 ; OPCODE_NOP
-0000130: 00 ; OPCODE_NOP
-0000131: 00 ; OPCODE_NOP
-0000132: 00 ; OPCODE_NOP
-0000133: 00 ; OPCODE_NOP
-0000134: 00 ; OPCODE_NOP
-0000135: 00 ; OPCODE_NOP
-0000136: 00 ; OPCODE_NOP
-0000137: 00 ; OPCODE_NOP
-0000138: 00 ; OPCODE_NOP
-0000139: 00 ; OPCODE_NOP
-000013a: 00 ; OPCODE_NOP
-000013b: 00 ; OPCODE_NOP
-000013c: 00 ; OPCODE_NOP
-000013d: 00 ; OPCODE_NOP
-000013e: 00 ; OPCODE_NOP
-000013f: 00 ; OPCODE_NOP
-0000140: 00 ; OPCODE_NOP
-0000141: 00 ; OPCODE_NOP
-0000142: 00 ; OPCODE_NOP
-0000143: 00 ; OPCODE_NOP
-0000144: 00 ; OPCODE_NOP
-0000145: 00 ; OPCODE_NOP
-; move data: [41, 146) -> [42, 147)
-0000040: 8502 ; FIXUP func body size
-; move data: [2f, 147) -> [30, 148)
-000002e: 9802 ; FIXUP section size
+0000129: 0f ; OPCODE_END
+; move data: [26, 12a) -> [27, 12b)
+0000025: 8402 ; FIXUP func body size
+; move data: [24, 12b) -> [25, 12c)
+0000023: 8702 ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0e0a 7369 676e 6174
-0000010: 7572 6573 0100 0016 1366 756e 6374 696f
-0000020: 6e5f 7369 676e 6174 7572 6573 0100 9802
-0000030: 0f66 756e 6374 696f 6e5f 626f 6469 6573
-0000040: 0185 0200 0281 0200 0000 0000 0000 0000
+0000000: 0061 736d 0b00 0000 0474 7970 6504 0140
+0000010: 0000 0866 756e 6374 696f 6e02 0100 0463
+0000020: 6f64 6587 0201 8402 0002 0000 0000 0000
+0000030: 0000 0000 0000 0000 0000 0000 0000 0000
+0000040: 0000 0000 0000 0000 0000 0000 0000 0000
0000050: 0000 0000 0000 0000 0000 0000 0000 0000
0000060: 0000 0000 0000 0000 0000 0000 0000 0000
0000070: 0000 0000 0000 0000 0000 0000 0000 0000
@@ -354,7 +354,5 @@
00000f0: 0000 0000 0000 0000 0000 0000 0000 0000
0000100: 0000 0000 0000 0000 0000 0000 0000 0000
0000110: 0000 0000 0000 0000 0000 0000 0000 0000
-0000120: 0000 0000 0000 0000 0000 0000 0000 0000
-0000130: 0000 0000 0000 0000 0000 0000 0000 0000
-0000140: 0000 0000 0000 0000
+0000120: 0000 0000 0000 0000 0000 000f
;;; STDOUT ;;)
diff --git a/test/dump/loop.txt b/test/dump/loop.txt
index 7e5287e1..77f6c1fc 100644
--- a/test/dump/loop.txt
+++ b/test/dump/loop.txt
@@ -6,42 +6,40 @@
(nop))))
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
-0000004: 0a00 0000 ; WASM_BINARY_VERSION
-; section "signatures"
-0000008: 00 ; section size (guess)
-0000009: 0a ; string length
-000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
-0000014: 01 ; num signatures
-; signature 0
-0000015: 00 ; num params
-0000016: 00 ; result_type
-0000008: 0e ; FIXUP section size
-; section "function_signatures"
-0000017: 00 ; section size (guess)
-0000018: 13 ; string length
-0000019: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
-0000029: 7265 73 ; section id: "function_signatures"
-000002c: 01 ; num functions
-000002d: 00 ; function 0 signature index
-0000017: 16 ; FIXUP section size
-; section "function_bodies"
-000002e: 00 ; section size (guess)
-000002f: 0f ; string length
-0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
-000003f: 01 ; num functions
+0000004: 0b00 0000 ; WASM_BINARY_VERSION
+; section "type"
+0000008: 04 ; string length
+0000009: 7479 7065 ; section id: "type"
+000000d: 00 ; section size (guess)
+000000e: 01 ; num types
+; type 0
+000000f: 40 ; function form
+0000010: 00 ; num params
+0000011: 00 ; num results
+000000d: 04 ; FIXUP section size
+; section "function"
+0000012: 08 ; string length
+0000013: 6675 6e63 7469 6f6e ; section id: "function"
+000001b: 00 ; section size (guess)
+000001c: 01 ; num functions
+000001d: 00 ; function 0 signature index
+000001b: 02 ; FIXUP section size
+; section "code"
+000001e: 04 ; string length
+000001f: 636f 6465 ; section id: "code"
+0000023: 00 ; section size (guess)
+0000024: 01 ; num functions
; function body 0
-0000040: 00 ; func body size (guess)
-0000041: 00 ; local decl count
-0000042: 02 ; OPCODE_LOOP
-0000043: 02 ; num expressions
-0000044: 00 ; OPCODE_NOP
-0000045: 00 ; OPCODE_NOP
-0000040: 05 ; FIXUP func body size
-000002e: 17 ; FIXUP section size
+0000025: 00 ; func body size (guess)
+0000026: 00 ; local decl count
+0000027: 02 ; OPCODE_LOOP
+0000028: 00 ; OPCODE_NOP
+0000029: 00 ; OPCODE_NOP
+000002a: 0f ; OPCODE_END
+0000025: 05 ; FIXUP func body size
+0000023: 07 ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0e0a 7369 676e 6174
-0000010: 7572 6573 0100 0016 1366 756e 6374 696f
-0000020: 6e5f 7369 676e 6174 7572 6573 0100 170f
-0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 7301
-0000040: 0500 0202 0000
+0000000: 0061 736d 0b00 0000 0474 7970 6504 0140
+0000010: 0000 0866 756e 6374 696f 6e02 0100 0463
+0000020: 6f64 6507 0105 0002 0000 0f
;;; STDOUT ;;)
diff --git a/test/dump/memory-1-byte.txt b/test/dump/memory-1-byte.txt
index 2eab2a30..26f96328 100644
--- a/test/dump/memory-1-byte.txt
+++ b/test/dump/memory-1-byte.txt
@@ -2,16 +2,16 @@
(module (memory 1))
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
-0000004: 0a00 0000 ; WASM_BINARY_VERSION
+0000004: 0b00 0000 ; WASM_BINARY_VERSION
; section "memory"
-0000008: 00 ; section size (guess)
-0000009: 06 ; string length
-000000a: 6d65 6d6f 7279 ; section id: "memory"
+0000008: 06 ; string length
+0000009: 6d65 6d6f 7279 ; section id: "memory"
+000000f: 00 ; section size (guess)
0000010: 01 ; min mem pages
0000011: 01 ; max mem pages
0000012: 00 ; export mem
-0000008: 0a ; FIXUP section size
+000000f: 03 ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0a06 6d65 6d6f 7279
+0000000: 0061 736d 0b00 0000 066d 656d 6f72 7903
0000010: 0101 00
;;; STDOUT ;;)
diff --git a/test/dump/memory-data-size.txt b/test/dump/memory-data-size.txt
index 8d61d3a2..70b5c056 100644
--- a/test/dump/memory-data-size.txt
+++ b/test/dump/memory-data-size.txt
@@ -5,43 +5,43 @@
(module (memory 5))
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
-0000004: 0a00 0000 ; WASM_BINARY_VERSION
+0000004: 0b00 0000 ; WASM_BINARY_VERSION
; section "memory"
-0000008: 00 ; section size (guess)
-0000009: 06 ; string length
-000000a: 6d65 6d6f 7279 ; section id: "memory"
+0000008: 06 ; string length
+0000009: 6d65 6d6f 7279 ; section id: "memory"
+000000f: 00 ; section size (guess)
0000010: 01 ; min mem pages
0000011: 01 ; max mem pages
0000012: 00 ; export mem
-0000008: 0a ; FIXUP section size
+000000f: 03 ; FIXUP section size
0000000: 0061 736d ; WASM_BINARY_MAGIC
-0000004: 0a00 0000 ; WASM_BINARY_VERSION
+0000004: 0b00 0000 ; WASM_BINARY_VERSION
; section "memory"
-0000008: 00 ; section size (guess)
-0000009: 06 ; string length
-000000a: 6d65 6d6f 7279 ; section id: "memory"
+0000008: 06 ; string length
+0000009: 6d65 6d6f 7279 ; section id: "memory"
+000000f: 00 ; section size (guess)
0000010: 02 ; min mem pages
0000011: 02 ; max mem pages
0000012: 00 ; export mem
-0000008: 0a ; FIXUP section size
+000000f: 03 ; FIXUP section size
0000000: 0061 736d ; WASM_BINARY_MAGIC
-0000004: 0a00 0000 ; WASM_BINARY_VERSION
+0000004: 0b00 0000 ; WASM_BINARY_VERSION
; section "memory"
-0000008: 00 ; section size (guess)
-0000009: 06 ; string length
-000000a: 6d65 6d6f 7279 ; section id: "memory"
+0000008: 06 ; string length
+0000009: 6d65 6d6f 7279 ; section id: "memory"
+000000f: 00 ; section size (guess)
0000010: 04 ; min mem pages
0000011: 04 ; max mem pages
0000012: 00 ; export mem
-0000008: 0a ; FIXUP section size
+000000f: 03 ; FIXUP section size
0000000: 0061 736d ; WASM_BINARY_MAGIC
-0000004: 0a00 0000 ; WASM_BINARY_VERSION
+0000004: 0b00 0000 ; WASM_BINARY_VERSION
; section "memory"
-0000008: 00 ; section size (guess)
-0000009: 06 ; string length
-000000a: 6d65 6d6f 7279 ; section id: "memory"
+0000008: 06 ; string length
+0000009: 6d65 6d6f 7279 ; section id: "memory"
+000000f: 00 ; section size (guess)
0000010: 05 ; min mem pages
0000011: 05 ; max mem pages
0000012: 00 ; export mem
-0000008: 0a ; FIXUP section size
+000000f: 03 ; FIXUP section size
;;; STDOUT ;;)
diff --git a/test/dump/memory-hex.txt b/test/dump/memory-hex.txt
index e5356ca0..2ddada02 100644
--- a/test/dump/memory-hex.txt
+++ b/test/dump/memory-hex.txt
@@ -4,28 +4,28 @@
(segment 0 "\00\01\02\03\04\05\06\07\08\09\0a")))
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
-0000004: 0a00 0000 ; WASM_BINARY_VERSION
+0000004: 0b00 0000 ; WASM_BINARY_VERSION
; section "memory"
-0000008: 00 ; section size (guess)
-0000009: 06 ; string length
-000000a: 6d65 6d6f 7279 ; section id: "memory"
+0000008: 06 ; string length
+0000009: 6d65 6d6f 7279 ; section id: "memory"
+000000f: 00 ; section size (guess)
0000010: 01 ; min mem pages
0000011: 01 ; max mem pages
0000012: 00 ; export mem
-0000008: 0a ; FIXUP section size
-; section "data_segments"
-0000013: 00 ; section size (guess)
-0000014: 0d ; string length
-0000015: 6461 7461 5f73 6567 6d65 6e74 73 ; section id: "data_segments"
-0000022: 01 ; num data segments
+000000f: 03 ; FIXUP section size
+; section "data"
+0000013: 04 ; string length
+0000014: 6461 7461 ; section id: "data"
+0000018: 00 ; section size (guess)
+0000019: 01 ; num data segments
; segment header 0
-0000023: 00 ; segment address
-0000024: 0b ; segment size
+000001a: 00 ; segment address
+000001b: 0b ; segment size
; segment data 0
-0000025: 0001 0203 0405 0607 0809 0a ; segment data
-0000013: 1c ; FIXUP section size
+000001c: 0001 0203 0405 0607 0809 0a ; segment data
+0000018: 0e ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0a06 6d65 6d6f 7279
-0000010: 0101 001c 0d64 6174 615f 7365 676d 656e
-0000020: 7473 0100 0b00 0102 0304 0506 0708 090a
+0000000: 0061 736d 0b00 0000 066d 656d 6f72 7903
+0000010: 0101 0004 6461 7461 0e01 000b 0001 0203
+0000020: 0405 0607 0809 0a
;;; STDOUT ;;)
diff --git a/test/dump/memory-size.txt b/test/dump/memory-size.txt
index cb2356d3..2cbb1fe7 100644
--- a/test/dump/memory-size.txt
+++ b/test/dump/memory-size.txt
@@ -5,47 +5,47 @@
(memory_size)))
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
-0000004: 0a00 0000 ; WASM_BINARY_VERSION
-; section "signatures"
-0000008: 00 ; section size (guess)
-0000009: 0a ; string length
-000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
-0000014: 01 ; num signatures
-; signature 0
-0000015: 00 ; num params
-0000016: 01 ; result_type
-0000008: 0e ; FIXUP section size
-; section "function_signatures"
-0000017: 00 ; section size (guess)
-0000018: 13 ; string length
-0000019: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
-0000029: 7265 73 ; section id: "function_signatures"
-000002c: 01 ; num functions
-000002d: 00 ; function 0 signature index
-0000017: 16 ; FIXUP section size
+0000004: 0b00 0000 ; WASM_BINARY_VERSION
+; section "type"
+0000008: 04 ; string length
+0000009: 7479 7065 ; section id: "type"
+000000d: 00 ; section size (guess)
+000000e: 01 ; num types
+; type 0
+000000f: 40 ; function form
+0000010: 00 ; num params
+0000011: 01 ; num results
+0000012: 01 ; result_type
+000000d: 05 ; FIXUP section size
+; section "function"
+0000013: 08 ; string length
+0000014: 6675 6e63 7469 6f6e ; section id: "function"
+000001c: 00 ; section size (guess)
+000001d: 01 ; num functions
+000001e: 00 ; function 0 signature index
+000001c: 02 ; FIXUP section size
; section "memory"
-000002e: 00 ; section size (guess)
-000002f: 06 ; string length
-0000030: 6d65 6d6f 7279 ; section id: "memory"
-0000036: 01 ; min mem pages
-0000037: 01 ; max mem pages
-0000038: 00 ; export mem
-000002e: 0a ; FIXUP section size
-; section "function_bodies"
-0000039: 00 ; section size (guess)
-000003a: 0f ; string length
-000003b: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
-000004a: 01 ; num functions
+000001f: 06 ; string length
+0000020: 6d65 6d6f 7279 ; section id: "memory"
+0000026: 00 ; section size (guess)
+0000027: 01 ; min mem pages
+0000028: 01 ; max mem pages
+0000029: 00 ; export mem
+0000026: 03 ; FIXUP section size
+; section "code"
+000002a: 04 ; string length
+000002b: 636f 6465 ; section id: "code"
+000002f: 00 ; section size (guess)
+0000030: 01 ; num functions
; function body 0
-000004b: 00 ; func body size (guess)
-000004c: 00 ; local decl count
-000004d: 3b ; OPCODE_MEMORY_SIZE
-000004b: 02 ; FIXUP func body size
-0000039: 14 ; FIXUP section size
+0000031: 00 ; func body size (guess)
+0000032: 00 ; local decl count
+0000033: 3b ; OPCODE_MEMORY_SIZE
+0000031: 02 ; FIXUP func body size
+000002f: 04 ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0e0a 7369 676e 6174
-0000010: 7572 6573 0100 0116 1366 756e 6374 696f
-0000020: 6e5f 7369 676e 6174 7572 6573 0100 0a06
-0000030: 6d65 6d6f 7279 0101 0014 0f66 756e 6374
-0000040: 696f 6e5f 626f 6469 6573 0102 003b
+0000000: 0061 736d 0b00 0000 0474 7970 6505 0140
+0000010: 0001 0108 6675 6e63 7469 6f6e 0201 0006
+0000020: 6d65 6d6f 7279 0301 0100 0463 6f64 6504
+0000030: 0102 003b
;;; STDOUT ;;)
diff --git a/test/dump/memory.txt b/test/dump/memory.txt
index 69015837..9e996e68 100644
--- a/test/dump/memory.txt
+++ b/test/dump/memory.txt
@@ -3,34 +3,33 @@
(memory 1 (segment 10 "hello") (segment 20 "goodbye")))
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
-0000004: 0a00 0000 ; WASM_BINARY_VERSION
+0000004: 0b00 0000 ; WASM_BINARY_VERSION
; section "memory"
-0000008: 00 ; section size (guess)
-0000009: 06 ; string length
-000000a: 6d65 6d6f 7279 ; section id: "memory"
+0000008: 06 ; string length
+0000009: 6d65 6d6f 7279 ; section id: "memory"
+000000f: 00 ; section size (guess)
0000010: 01 ; min mem pages
0000011: 01 ; max mem pages
0000012: 00 ; export mem
-0000008: 0a ; FIXUP section size
-; section "data_segments"
-0000013: 00 ; section size (guess)
-0000014: 0d ; string length
-0000015: 6461 7461 5f73 6567 6d65 6e74 73 ; section id: "data_segments"
-0000022: 02 ; num data segments
+000000f: 03 ; FIXUP section size
+; section "data"
+0000013: 04 ; string length
+0000014: 6461 7461 ; section id: "data"
+0000018: 00 ; section size (guess)
+0000019: 02 ; num data segments
; segment header 0
-0000023: 0a ; segment address
-0000024: 05 ; segment size
+000001a: 0a ; segment address
+000001b: 05 ; segment size
; segment data 0
-0000025: 6865 6c6c 6f ; segment data
+000001c: 6865 6c6c 6f ; segment data
; segment header 1
-000002a: 14 ; segment address
-000002b: 07 ; segment size
+0000021: 14 ; segment address
+0000022: 07 ; segment size
; segment data 1
-000002c: 676f 6f64 6279 65 ; segment data
-0000013: 1f ; FIXUP section size
+0000023: 676f 6f64 6279 65 ; segment data
+0000018: 11 ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0a06 6d65 6d6f 7279
-0000010: 0101 001f 0d64 6174 615f 7365 676d 656e
-0000020: 7473 020a 0568 656c 6c6f 1407 676f 6f64
-0000030: 6279 65
+0000000: 0061 736d 0b00 0000 066d 656d 6f72 7903
+0000010: 0101 0004 6461 7461 1102 0a05 6865 6c6c
+0000020: 6f14 0767 6f6f 6462 7965
;;; STDOUT ;;)
diff --git a/test/dump/no-canonicalize.txt b/test/dump/no-canonicalize.txt
index 731324eb..8ca9364e 100644
--- a/test/dump/no-canonicalize.txt
+++ b/test/dump/no-canonicalize.txt
@@ -10,120 +10,120 @@
(func $f3 (param i32) (i32.mul (get_local 0) (i32.const 2))))
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
-0000004: 0a00 0000 ; WASM_BINARY_VERSION
-; section "signatures"
-0000008: 0000 0000 00 ; section size (guess)
-000000d: 0a ; string length
-000000e: 7369 676e 6174 7572 6573 ; section id: "signatures"
-0000018: 03 ; num signatures
-; signature 0
+0000004: 0b00 0000 ; WASM_BINARY_VERSION
+; section "type"
+0000008: 04 ; string length
+0000009: 7479 7065 ; section id: "type"
+000000d: 0000 0000 00 ; section size (guess)
+0000012: 03 ; num types
+; type 0
+0000013: 40 ; function form
+0000014: 01 ; num params
+0000015: 01 ; param type
+0000016: 01 ; num results
+0000017: 01 ; result_type
+; type 1
+0000018: 40 ; function form
0000019: 01 ; num params
-000001a: 01 ; result_type
-000001b: 01 ; param type
-; signature 1
-000001c: 01 ; num params
-000001d: 00 ; result_type
+000001a: 01 ; param type
+000001b: 00 ; num results
+; type 2
+000001c: 40 ; function form
+000001d: 02 ; num params
000001e: 01 ; param type
-; signature 2
-000001f: 02 ; num params
-0000020: 00 ; result_type
-0000021: 01 ; param type
-0000022: 01 ; param type
-0000008: 9680 8080 00 ; FIXUP section size
-; section "import_table"
-0000023: 0000 0000 00 ; section size (guess)
-0000028: 0c ; string length
-0000029: 696d 706f 7274 5f74 6162 6c65 ; section id: "import_table"
-0000035: 01 ; num imports
+000001f: 01 ; param type
+0000020: 00 ; num results
+000000d: 8f80 8080 00 ; FIXUP section size
+; section "import"
+0000021: 06 ; string length
+0000022: 696d 706f 7274 ; section id: "import"
+0000028: 0000 0000 00 ; section size (guess)
+000002d: 01 ; num imports
; import header 0
-0000036: 01 ; import signature index
-0000037: 05 ; string length
-0000038: 7374 6469 6f stdio ; import module name
-000003d: 05 ; string length
-000003e: 7072 696e 74 print ; import function name
-0000023: 9b80 8080 00 ; FIXUP section size
-; section "function_signatures"
-0000043: 0000 0000 00 ; section size (guess)
-0000048: 13 ; string length
-0000049: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
-0000059: 7265 73 ; section id: "function_signatures"
-000005c: 03 ; num functions
-000005d: 02 ; function 0 signature index
-000005e: 01 ; function 1 signature index
-000005f: 01 ; function 2 signature index
-0000043: 9880 8080 00 ; FIXUP section size
-; section "function_table"
-0000060: 0000 0000 00 ; section size (guess)
-0000065: 0e ; string length
-0000066: 6675 6e63 7469 6f6e 5f74 6162 6c65 ; section id: "function_table"
-0000074: 02 ; num function table entries
-0000075: 01 ; function table entry
-0000076: 02 ; function table entry
-0000060: 9280 8080 00 ; FIXUP section size
+000002e: 01 ; import signature index
+000002f: 05 ; string length
+0000030: 7374 6469 6f stdio ; import module name
+0000035: 05 ; string length
+0000036: 7072 696e 74 print ; import function name
+0000028: 8e80 8080 00 ; FIXUP section size
+; section "function"
+000003b: 08 ; string length
+000003c: 6675 6e63 7469 6f6e ; section id: "function"
+0000044: 0000 0000 00 ; section size (guess)
+0000049: 03 ; num functions
+000004a: 02 ; function 0 signature index
+000004b: 01 ; function 1 signature index
+000004c: 01 ; function 2 signature index
+0000044: 8480 8080 00 ; FIXUP section size
+; section "table"
+000004d: 05 ; string length
+000004e: 7461 626c 65 ; section id: "table"
+0000053: 0000 0000 00 ; section size (guess)
+0000058: 02 ; num function table entries
+0000059: 01 ; function table entry
+000005a: 02 ; function table entry
+0000053: 8380 8080 00 ; FIXUP section size
; section "memory"
-0000077: 0000 0000 00 ; section size (guess)
-000007c: 06 ; string length
-000007d: 6d65 6d6f 7279 ; section id: "memory"
-0000083: 64 ; min mem pages
-0000084: 64 ; max mem pages
-0000085: 00 ; export mem
-0000077: 8a80 8080 00 ; FIXUP section size
-; section "export_table"
-0000086: 0000 0000 00 ; section size (guess)
-000008b: 0c ; string length
-000008c: 6578 706f 7274 5f74 6162 6c65 ; section id: "export_table"
-0000098: 01 ; num exports
-0000099: 00 ; export func index
-000009a: 02 ; string length
-000009b: 6631 f1 ; export name
-0000086: 9280 8080 00 ; FIXUP section size
-; section "function_bodies"
-000009d: 0000 0000 00 ; section size (guess)
-00000a2: 0f ; string length
-00000a3: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
-00000b2: 03 ; num functions
+000005b: 06 ; string length
+000005c: 6d65 6d6f 7279 ; section id: "memory"
+0000062: 0000 0000 00 ; section size (guess)
+0000067: 64 ; min mem pages
+0000068: 64 ; max mem pages
+0000069: 00 ; export mem
+0000062: 8380 8080 00 ; FIXUP section size
+; section "export"
+000006a: 06 ; string length
+000006b: 6578 706f 7274 ; section id: "export"
+0000071: 0000 0000 00 ; section size (guess)
+0000076: 01 ; num exports
+0000077: 00 ; export func index
+0000078: 02 ; string length
+0000079: 6631 f1 ; export name
+0000071: 8580 8080 00 ; FIXUP section size
+; section "code"
+000007b: 04 ; string length
+000007c: 636f 6465 ; section id: "code"
+0000080: 0000 0000 00 ; section size (guess)
+0000085: 03 ; num functions
; function body 0
-00000b3: 0000 0000 00 ; func body size (guess)
-00000b8: 00 ; local decl count
-00000b9: 13 ; OPCODE_CALL_INDIRECT
-00000ba: 00 ; signature index
-00000bb: 0e ; OPCODE_GET_LOCAL
-00000bc: 00 ; remapped local index
-00000bd: 0e ; OPCODE_GET_LOCAL
-00000be: 01 ; remapped local index
-00000b3: 8780 8080 00 ; FIXUP func body size
+0000086: 0000 0000 00 ; func body size (guess)
+000008b: 00 ; local decl count
+000008c: 14 ; OPCODE_GET_LOCAL
+000008d: 00 ; remapped local index
+000008e: 14 ; OPCODE_GET_LOCAL
+000008f: 01 ; remapped local index
+0000090: 17 ; OPCODE_CALL_INDIRECT
+0000091: 00 ; signature index
+0000086: 8780 8080 00 ; FIXUP func body size
; function body 1
-00000bf: 0000 0000 00 ; func body size (guess)
-00000c4: 00 ; local decl count
-00000c5: 40 ; OPCODE_I32_ADD
-00000c6: 0e ; OPCODE_GET_LOCAL
-00000c7: 00 ; remapped local index
-00000c8: 0a ; OPCODE_I32_CONST
-00000c9: 01 ; i32 literal
-00000bf: 8680 8080 00 ; FIXUP func body size
+0000092: 0000 0000 00 ; func body size (guess)
+0000097: 00 ; local decl count
+0000098: 14 ; OPCODE_GET_LOCAL
+0000099: 00 ; remapped local index
+000009a: 10 ; OPCODE_I32_CONST
+000009b: 01 ; i32 literal
+000009c: 40 ; OPCODE_I32_ADD
+0000092: 8680 8080 00 ; FIXUP func body size
; function body 2
-00000ca: 0000 0000 00 ; func body size (guess)
-00000cf: 00 ; local decl count
-00000d0: 42 ; OPCODE_I32_MUL
-00000d1: 0e ; OPCODE_GET_LOCAL
-00000d2: 00 ; remapped local index
-00000d3: 0a ; OPCODE_I32_CONST
-00000d4: 02 ; i32 literal
-00000ca: 8680 8080 00 ; FIXUP func body size
-000009d: b380 8080 00 ; FIXUP section size
+000009d: 0000 0000 00 ; func body size (guess)
+00000a2: 00 ; local decl count
+00000a3: 14 ; OPCODE_GET_LOCAL
+00000a4: 00 ; remapped local index
+00000a5: 10 ; OPCODE_I32_CONST
+00000a6: 02 ; i32 literal
+00000a7: 42 ; OPCODE_I32_MUL
+000009d: 8680 8080 00 ; FIXUP func body size
+0000080: a380 8080 00 ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 9680 8080 000a 7369
-0000010: 676e 6174 7572 6573 0301 0101 0100 0102
-0000020: 0001 019b 8080 8000 0c69 6d70 6f72 745f
-0000030: 7461 626c 6501 0105 7374 6469 6f05 7072
-0000040: 696e 7498 8080 8000 1366 756e 6374 696f
-0000050: 6e5f 7369 676e 6174 7572 6573 0302 0101
-0000060: 9280 8080 000e 6675 6e63 7469 6f6e 5f74
-0000070: 6162 6c65 0201 028a 8080 8000 066d 656d
-0000080: 6f72 7964 6400 9280 8080 000c 6578 706f
-0000090: 7274 5f74 6162 6c65 0100 0266 31b3 8080
-00000a0: 8000 0f66 756e 6374 696f 6e5f 626f 6469
-00000b0: 6573 0387 8080 8000 0013 000e 000e 0186
-00000c0: 8080 8000 0040 0e00 0a01 8680 8080 0000
-00000d0: 420e 000a 02
+0000000: 0061 736d 0b00 0000 0474 7970 658f 8080
+0000010: 8000 0340 0101 0101 4001 0100 4002 0101
+0000020: 0006 696d 706f 7274 8e80 8080 0001 0105
+0000030: 7374 6469 6f05 7072 696e 7408 6675 6e63
+0000040: 7469 6f6e 8480 8080 0003 0201 0105 7461
+0000050: 626c 6583 8080 8000 0201 0206 6d65 6d6f
+0000060: 7279 8380 8080 0064 6400 0665 7870 6f72
+0000070: 7485 8080 8000 0100 0266 3104 636f 6465
+0000080: a380 8080 0003 8780 8080 0000 1400 1401
+0000090: 1700 8680 8080 0000 1400 1001 4086 8080
+00000a0: 8000 0014 0010 0242
;;; STDOUT ;;)
diff --git a/test/dump/no-remap-locals.txt b/test/dump/no-remap-locals.txt
index 8682eb45..32931c9e 100644
--- a/test/dump/no-remap-locals.txt
+++ b/test/dump/no-remap-locals.txt
@@ -13,69 +13,68 @@
(get_local 7)))
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
-0000004: 0a00 0000 ; WASM_BINARY_VERSION
-; section "signatures"
-0000008: 00 ; section size (guess)
-0000009: 0a ; string length
-000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
-0000014: 01 ; num signatures
-; signature 0
-0000015: 00 ; num params
-0000016: 00 ; result_type
-0000008: 0e ; FIXUP section size
-; section "function_signatures"
-0000017: 00 ; section size (guess)
-0000018: 13 ; string length
-0000019: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
-0000029: 7265 73 ; section id: "function_signatures"
-000002c: 01 ; num functions
-000002d: 00 ; function 0 signature index
-0000017: 16 ; FIXUP section size
-; section "function_bodies"
-000002e: 00 ; section size (guess)
-000002f: 0f ; string length
-0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
-000003f: 01 ; num functions
+0000004: 0b00 0000 ; WASM_BINARY_VERSION
+; section "type"
+0000008: 04 ; string length
+0000009: 7479 7065 ; section id: "type"
+000000d: 00 ; section size (guess)
+000000e: 01 ; num types
+; type 0
+000000f: 40 ; function form
+0000010: 00 ; num params
+0000011: 00 ; num results
+000000d: 04 ; FIXUP section size
+; section "function"
+0000012: 08 ; string length
+0000013: 6675 6e63 7469 6f6e ; section id: "function"
+000001b: 00 ; section size (guess)
+000001c: 01 ; num functions
+000001d: 00 ; function 0 signature index
+000001b: 02 ; FIXUP section size
+; section "code"
+000001e: 04 ; string length
+000001f: 636f 6465 ; section id: "code"
+0000023: 00 ; section size (guess)
+0000024: 01 ; num functions
; function body 0
-0000040: 00 ; func body size (guess)
-0000041: 07 ; local decl count
-0000042: 01 ; local type count
-0000043: 04 ; WASM_TYPE_F64
-0000044: 01 ; local type count
-0000045: 03 ; WASM_TYPE_F32
-0000046: 01 ; local type count
-0000047: 02 ; WASM_TYPE_I64
-0000048: 02 ; local type count
-0000049: 01 ; WASM_TYPE_I32
-000004a: 01 ; local type count
-000004b: 03 ; WASM_TYPE_F32
-000004c: 01 ; local type count
-000004d: 04 ; WASM_TYPE_F64
-000004e: 01 ; local type count
-000004f: 02 ; WASM_TYPE_I64
-0000050: 0e ; OPCODE_GET_LOCAL
-0000051: 00 ; remapped local index
-0000052: 0e ; OPCODE_GET_LOCAL
-0000053: 01 ; remapped local index
-0000054: 0e ; OPCODE_GET_LOCAL
-0000055: 02 ; remapped local index
-0000056: 0e ; OPCODE_GET_LOCAL
-0000057: 03 ; remapped local index
-0000058: 0e ; OPCODE_GET_LOCAL
-0000059: 04 ; remapped local index
-000005a: 0e ; OPCODE_GET_LOCAL
-000005b: 05 ; remapped local index
-000005c: 0e ; OPCODE_GET_LOCAL
-000005d: 06 ; remapped local index
-000005e: 0e ; OPCODE_GET_LOCAL
-000005f: 07 ; remapped local index
-0000040: 1f ; FIXUP func body size
-000002e: 31 ; FIXUP section size
+0000025: 00 ; func body size (guess)
+0000026: 07 ; local decl count
+0000027: 01 ; local type count
+0000028: 04 ; WASM_TYPE_F64
+0000029: 01 ; local type count
+000002a: 03 ; WASM_TYPE_F32
+000002b: 01 ; local type count
+000002c: 02 ; WASM_TYPE_I64
+000002d: 02 ; local type count
+000002e: 01 ; WASM_TYPE_I32
+000002f: 01 ; local type count
+0000030: 03 ; WASM_TYPE_F32
+0000031: 01 ; local type count
+0000032: 04 ; WASM_TYPE_F64
+0000033: 01 ; local type count
+0000034: 02 ; WASM_TYPE_I64
+0000035: 14 ; OPCODE_GET_LOCAL
+0000036: 00 ; remapped local index
+0000037: 14 ; OPCODE_GET_LOCAL
+0000038: 01 ; remapped local index
+0000039: 14 ; OPCODE_GET_LOCAL
+000003a: 02 ; remapped local index
+000003b: 14 ; OPCODE_GET_LOCAL
+000003c: 03 ; remapped local index
+000003d: 14 ; OPCODE_GET_LOCAL
+000003e: 04 ; remapped local index
+000003f: 14 ; OPCODE_GET_LOCAL
+0000040: 05 ; remapped local index
+0000041: 14 ; OPCODE_GET_LOCAL
+0000042: 06 ; remapped local index
+0000043: 14 ; OPCODE_GET_LOCAL
+0000044: 07 ; remapped local index
+0000025: 1f ; FIXUP func body size
+0000023: 21 ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0e0a 7369 676e 6174
-0000010: 7572 6573 0100 0016 1366 756e 6374 696f
-0000020: 6e5f 7369 676e 6174 7572 6573 0100 310f
-0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 7301
-0000040: 1f07 0104 0103 0102 0201 0103 0104 0102
-0000050: 0e00 0e01 0e02 0e03 0e04 0e05 0e06 0e07
+0000000: 0061 736d 0b00 0000 0474 7970 6504 0140
+0000010: 0000 0866 756e 6374 696f 6e02 0100 0463
+0000020: 6f64 6521 011f 0701 0401 0301 0202 0101
+0000030: 0301 0401 0214 0014 0114 0214 0314 0414
+0000040: 0514 0614 07
;;; STDOUT ;;)
diff --git a/test/dump/nop.txt b/test/dump/nop.txt
index 841b78b9..14765704 100644
--- a/test/dump/nop.txt
+++ b/test/dump/nop.txt
@@ -3,39 +3,37 @@
(func (nop)))
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
-0000004: 0a00 0000 ; WASM_BINARY_VERSION
-; section "signatures"
-0000008: 00 ; section size (guess)
-0000009: 0a ; string length
-000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
-0000014: 01 ; num signatures
-; signature 0
-0000015: 00 ; num params
-0000016: 00 ; result_type
-0000008: 0e ; FIXUP section size
-; section "function_signatures"
-0000017: 00 ; section size (guess)
-0000018: 13 ; string length
-0000019: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
-0000029: 7265 73 ; section id: "function_signatures"
-000002c: 01 ; num functions
-000002d: 00 ; function 0 signature index
-0000017: 16 ; FIXUP section size
-; section "function_bodies"
-000002e: 00 ; section size (guess)
-000002f: 0f ; string length
-0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
-000003f: 01 ; num functions
+0000004: 0b00 0000 ; WASM_BINARY_VERSION
+; section "type"
+0000008: 04 ; string length
+0000009: 7479 7065 ; section id: "type"
+000000d: 00 ; section size (guess)
+000000e: 01 ; num types
+; type 0
+000000f: 40 ; function form
+0000010: 00 ; num params
+0000011: 00 ; num results
+000000d: 04 ; FIXUP section size
+; section "function"
+0000012: 08 ; string length
+0000013: 6675 6e63 7469 6f6e ; section id: "function"
+000001b: 00 ; section size (guess)
+000001c: 01 ; num functions
+000001d: 00 ; function 0 signature index
+000001b: 02 ; FIXUP section size
+; section "code"
+000001e: 04 ; string length
+000001f: 636f 6465 ; section id: "code"
+0000023: 00 ; section size (guess)
+0000024: 01 ; num functions
; function body 0
-0000040: 00 ; func body size (guess)
-0000041: 00 ; local decl count
-0000042: 00 ; OPCODE_NOP
-0000040: 02 ; FIXUP func body size
-000002e: 14 ; FIXUP section size
+0000025: 00 ; func body size (guess)
+0000026: 00 ; local decl count
+0000027: 00 ; OPCODE_NOP
+0000025: 02 ; FIXUP func body size
+0000023: 04 ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0e0a 7369 676e 6174
-0000010: 7572 6573 0100 0016 1366 756e 6374 696f
-0000020: 6e5f 7369 676e 6174 7572 6573 0100 140f
-0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 7301
-0000040: 0200 00
+0000000: 0061 736d 0b00 0000 0474 7970 6504 0140
+0000010: 0000 0866 756e 6374 696f 6e02 0100 0463
+0000020: 6f64 6504 0102 0000
;;; STDOUT ;;)
diff --git a/test/dump/param-multi.txt b/test/dump/param-multi.txt
index 4a7fc4df..fe3b42cb 100644
--- a/test/dump/param-multi.txt
+++ b/test/dump/param-multi.txt
@@ -3,42 +3,40 @@
(func (param i32 i64 f32 f64)))
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
-0000004: 0a00 0000 ; WASM_BINARY_VERSION
-; section "signatures"
-0000008: 00 ; section size (guess)
-0000009: 0a ; string length
-000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
-0000014: 01 ; num signatures
-; signature 0
-0000015: 04 ; num params
-0000016: 00 ; result_type
-0000017: 01 ; param type
-0000018: 02 ; param type
-0000019: 03 ; param type
-000001a: 04 ; param type
-0000008: 12 ; FIXUP section size
-; section "function_signatures"
-000001b: 00 ; section size (guess)
-000001c: 13 ; string length
-000001d: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
-000002d: 7265 73 ; section id: "function_signatures"
-0000030: 01 ; num functions
-0000031: 00 ; function 0 signature index
-000001b: 16 ; FIXUP section size
-; section "function_bodies"
-0000032: 00 ; section size (guess)
-0000033: 0f ; string length
-0000034: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
-0000043: 01 ; num functions
+0000004: 0b00 0000 ; WASM_BINARY_VERSION
+; section "type"
+0000008: 04 ; string length
+0000009: 7479 7065 ; section id: "type"
+000000d: 00 ; section size (guess)
+000000e: 01 ; num types
+; type 0
+000000f: 40 ; function form
+0000010: 04 ; num params
+0000011: 01 ; param type
+0000012: 02 ; param type
+0000013: 03 ; param type
+0000014: 04 ; param type
+0000015: 00 ; num results
+000000d: 08 ; FIXUP section size
+; section "function"
+0000016: 08 ; string length
+0000017: 6675 6e63 7469 6f6e ; section id: "function"
+000001f: 00 ; section size (guess)
+0000020: 01 ; num functions
+0000021: 00 ; function 0 signature index
+000001f: 02 ; FIXUP section size
+; section "code"
+0000022: 04 ; string length
+0000023: 636f 6465 ; section id: "code"
+0000027: 00 ; section size (guess)
+0000028: 01 ; num functions
; function body 0
-0000044: 00 ; func body size (guess)
-0000045: 00 ; local decl count
-0000044: 01 ; FIXUP func body size
-0000032: 13 ; FIXUP section size
+0000029: 00 ; func body size (guess)
+000002a: 00 ; local decl count
+0000029: 01 ; FIXUP func body size
+0000027: 03 ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 120a 7369 676e 6174
-0000010: 7572 6573 0104 0001 0203 0416 1366 756e
-0000020: 6374 696f 6e5f 7369 676e 6174 7572 6573
-0000030: 0100 130f 6675 6e63 7469 6f6e 5f62 6f64
-0000040: 6965 7301 0100
+0000000: 0061 736d 0b00 0000 0474 7970 6508 0140
+0000010: 0401 0203 0400 0866 756e 6374 696f 6e02
+0000020: 0100 0463 6f64 6503 0101 00
;;; STDOUT ;;)
diff --git a/test/dump/result.txt b/test/dump/result.txt
index b6b63309..b6c7b2aa 100644
--- a/test/dump/result.txt
+++ b/test/dump/result.txt
@@ -6,72 +6,77 @@
(func (result f64) (f64.const 0)))
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
-0000004: 0a00 0000 ; WASM_BINARY_VERSION
-; section "signatures"
-0000008: 00 ; section size (guess)
-0000009: 0a ; string length
-000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
-0000014: 04 ; num signatures
-; signature 0
-0000015: 00 ; num params
-0000016: 01 ; result_type
-; signature 1
-0000017: 00 ; num params
-0000018: 02 ; result_type
-; signature 2
-0000019: 00 ; num params
+0000004: 0b00 0000 ; WASM_BINARY_VERSION
+; section "type"
+0000008: 04 ; string length
+0000009: 7479 7065 ; section id: "type"
+000000d: 00 ; section size (guess)
+000000e: 04 ; num types
+; type 0
+000000f: 40 ; function form
+0000010: 00 ; num params
+0000011: 01 ; num results
+0000012: 01 ; result_type
+; type 1
+0000013: 40 ; function form
+0000014: 00 ; num params
+0000015: 01 ; num results
+0000016: 02 ; result_type
+; type 2
+0000017: 40 ; function form
+0000018: 00 ; num params
+0000019: 01 ; num results
000001a: 03 ; result_type
-; signature 3
-000001b: 00 ; num params
-000001c: 04 ; result_type
-0000008: 14 ; FIXUP section size
-; section "function_signatures"
-000001d: 00 ; section size (guess)
-000001e: 13 ; string length
-000001f: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
-000002f: 7265 73 ; section id: "function_signatures"
-0000032: 04 ; num functions
-0000033: 00 ; function 0 signature index
-0000034: 01 ; function 1 signature index
-0000035: 02 ; function 2 signature index
-0000036: 03 ; function 3 signature index
-000001d: 19 ; FIXUP section size
-; section "function_bodies"
-0000037: 00 ; section size (guess)
-0000038: 0f ; string length
-0000039: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
-0000048: 04 ; num functions
+; type 3
+000001b: 40 ; function form
+000001c: 00 ; num params
+000001d: 01 ; num results
+000001e: 04 ; result_type
+000000d: 11 ; FIXUP section size
+; section "function"
+000001f: 08 ; string length
+0000020: 6675 6e63 7469 6f6e ; section id: "function"
+0000028: 00 ; section size (guess)
+0000029: 04 ; num functions
+000002a: 00 ; function 0 signature index
+000002b: 01 ; function 1 signature index
+000002c: 02 ; function 2 signature index
+000002d: 03 ; function 3 signature index
+0000028: 05 ; FIXUP section size
+; section "code"
+000002e: 04 ; string length
+000002f: 636f 6465 ; section id: "code"
+0000033: 00 ; section size (guess)
+0000034: 04 ; num functions
; function body 0
-0000049: 00 ; func body size (guess)
-000004a: 00 ; local decl count
-000004b: 0a ; OPCODE_I32_CONST
-000004c: 00 ; i32 literal
-0000049: 03 ; FIXUP func body size
+0000035: 00 ; func body size (guess)
+0000036: 00 ; local decl count
+0000037: 10 ; OPCODE_I32_CONST
+0000038: 00 ; i32 literal
+0000035: 03 ; FIXUP func body size
; function body 1
-000004d: 00 ; func body size (guess)
-000004e: 00 ; local decl count
-000004f: 0b ; OPCODE_I64_CONST
-0000050: 00 ; i64 literal
-000004d: 03 ; FIXUP func body size
+0000039: 00 ; func body size (guess)
+000003a: 00 ; local decl count
+000003b: 11 ; OPCODE_I64_CONST
+000003c: 00 ; i64 literal
+0000039: 03 ; FIXUP func body size
; function body 2
-0000051: 00 ; func body size (guess)
-0000052: 00 ; local decl count
-0000053: 0d ; OPCODE_F32_CONST
-0000054: 0000 0000 ; f32 literal
-0000051: 06 ; FIXUP func body size
+000003d: 00 ; func body size (guess)
+000003e: 00 ; local decl count
+000003f: 13 ; OPCODE_F32_CONST
+0000040: 0000 0000 ; f32 literal
+000003d: 06 ; FIXUP func body size
; function body 3
-0000058: 00 ; func body size (guess)
-0000059: 00 ; local decl count
-000005a: 0c ; OPCODE_F64_CONST
-000005b: 0000 0000 0000 0000 ; f64 literal
-0000058: 0a ; FIXUP func body size
-0000037: 2b ; FIXUP section size
+0000044: 00 ; func body size (guess)
+0000045: 00 ; local decl count
+0000046: 12 ; OPCODE_F64_CONST
+0000047: 0000 0000 0000 0000 ; f64 literal
+0000044: 0a ; FIXUP func body size
+0000033: 1b ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 140a 7369 676e 6174
-0000010: 7572 6573 0400 0100 0200 0300 0419 1366
-0000020: 756e 6374 696f 6e5f 7369 676e 6174 7572
-0000030: 6573 0400 0102 032b 0f66 756e 6374 696f
-0000040: 6e5f 626f 6469 6573 0403 000a 0003 000b
-0000050: 0006 000d 0000 0000 0a00 0c00 0000 0000
-0000060: 0000 00
+0000000: 0061 736d 0b00 0000 0474 7970 6511 0440
+0000010: 0001 0140 0001 0240 0001 0340 0001 0408
+0000020: 6675 6e63 7469 6f6e 0504 0001 0203 0463
+0000030: 6f64 651b 0403 0010 0003 0011 0006 0013
+0000040: 0000 0000 0a00 1200 0000 0000 0000 00
;;; STDOUT ;;)
diff --git a/test/dump/return.txt b/test/dump/return.txt
index ed097bbd..dfb93e04 100644
--- a/test/dump/return.txt
+++ b/test/dump/return.txt
@@ -5,50 +5,51 @@
(func (return)))
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
-0000004: 0a00 0000 ; WASM_BINARY_VERSION
-; section "signatures"
-0000008: 00 ; section size (guess)
-0000009: 0a ; string length
-000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
-0000014: 02 ; num signatures
-; signature 0
-0000015: 00 ; num params
-0000016: 01 ; result_type
-; signature 1
-0000017: 00 ; num params
-0000018: 00 ; result_type
-0000008: 10 ; FIXUP section size
-; section "function_signatures"
-0000019: 00 ; section size (guess)
-000001a: 13 ; string length
-000001b: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
-000002b: 7265 73 ; section id: "function_signatures"
-000002e: 02 ; num functions
-000002f: 00 ; function 0 signature index
-0000030: 01 ; function 1 signature index
-0000019: 17 ; FIXUP section size
-; section "function_bodies"
-0000031: 00 ; section size (guess)
-0000032: 0f ; string length
-0000033: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
-0000042: 02 ; num functions
+0000004: 0b00 0000 ; WASM_BINARY_VERSION
+; section "type"
+0000008: 04 ; string length
+0000009: 7479 7065 ; section id: "type"
+000000d: 00 ; section size (guess)
+000000e: 02 ; num types
+; type 0
+000000f: 40 ; function form
+0000010: 00 ; num params
+0000011: 01 ; num results
+0000012: 01 ; result_type
+; type 1
+0000013: 40 ; function form
+0000014: 00 ; num params
+0000015: 00 ; num results
+000000d: 08 ; FIXUP section size
+; section "function"
+0000016: 08 ; string length
+0000017: 6675 6e63 7469 6f6e ; section id: "function"
+000001f: 00 ; section size (guess)
+0000020: 02 ; num functions
+0000021: 00 ; function 0 signature index
+0000022: 01 ; function 1 signature index
+000001f: 03 ; FIXUP section size
+; section "code"
+0000023: 04 ; string length
+0000024: 636f 6465 ; section id: "code"
+0000028: 00 ; section size (guess)
+0000029: 02 ; num functions
; function body 0
-0000043: 00 ; func body size (guess)
-0000044: 00 ; local decl count
-0000045: 14 ; OPCODE_RETURN
-0000046: 0a ; OPCODE_I32_CONST
-0000047: 2a ; i32 literal
-0000043: 04 ; FIXUP func body size
+000002a: 00 ; func body size (guess)
+000002b: 00 ; local decl count
+000002c: 10 ; OPCODE_I32_CONST
+000002d: 2a ; i32 literal
+000002e: 09 ; OPCODE_RETURN
+000002a: 04 ; FIXUP func body size
; function body 1
-0000048: 00 ; func body size (guess)
-0000049: 00 ; local decl count
-000004a: 14 ; OPCODE_RETURN
-0000048: 02 ; FIXUP func body size
-0000031: 19 ; FIXUP section size
+000002f: 00 ; func body size (guess)
+0000030: 00 ; local decl count
+0000031: 09 ; OPCODE_RETURN
+000002f: 02 ; FIXUP func body size
+0000028: 09 ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 100a 7369 676e 6174
-0000010: 7572 6573 0200 0100 0017 1366 756e 6374
-0000020: 696f 6e5f 7369 676e 6174 7572 6573 0200
-0000030: 0119 0f66 756e 6374 696f 6e5f 626f 6469
-0000040: 6573 0204 0014 0a2a 0200 14
+0000000: 0061 736d 0b00 0000 0474 7970 6508 0240
+0000010: 0001 0140 0000 0866 756e 6374 696f 6e03
+0000020: 0200 0104 636f 6465 0902 0400 102a 0902
+0000030: 0009
;;; STDOUT ;;)
diff --git a/test/dump/select.txt b/test/dump/select.txt
index a36af508..6ed00331 100644
--- a/test/dump/select.txt
+++ b/test/dump/select.txt
@@ -7,69 +7,67 @@
(select (f64.const 2) (f64.const 3) (i32.const 1))))
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
-0000004: 0a00 0000 ; WASM_BINARY_VERSION
-; section "signatures"
-0000008: 00 ; section size (guess)
-0000009: 0a ; string length
-000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
-0000014: 01 ; num signatures
-; signature 0
-0000015: 00 ; num params
-0000016: 00 ; result_type
-0000008: 0e ; FIXUP section size
-; section "function_signatures"
-0000017: 00 ; section size (guess)
-0000018: 13 ; string length
-0000019: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
-0000029: 7265 73 ; section id: "function_signatures"
-000002c: 01 ; num functions
-000002d: 00 ; function 0 signature index
-0000017: 16 ; FIXUP section size
-; section "function_bodies"
-000002e: 00 ; section size (guess)
-000002f: 0f ; string length
-0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
-000003f: 01 ; num functions
+0000004: 0b00 0000 ; WASM_BINARY_VERSION
+; section "type"
+0000008: 04 ; string length
+0000009: 7479 7065 ; section id: "type"
+000000d: 00 ; section size (guess)
+000000e: 01 ; num types
+; type 0
+000000f: 40 ; function form
+0000010: 00 ; num params
+0000011: 00 ; num results
+000000d: 04 ; FIXUP section size
+; section "function"
+0000012: 08 ; string length
+0000013: 6675 6e63 7469 6f6e ; section id: "function"
+000001b: 00 ; section size (guess)
+000001c: 01 ; num functions
+000001d: 00 ; function 0 signature index
+000001b: 02 ; FIXUP section size
+; section "code"
+000001e: 04 ; string length
+000001f: 636f 6465 ; section id: "code"
+0000023: 00 ; section size (guess)
+0000024: 01 ; num functions
; function body 0
-0000040: 00 ; func body size (guess)
-0000041: 00 ; local decl count
-0000042: 05 ; OPCODE_SELECT
-0000043: 0a ; OPCODE_I32_CONST
-0000044: 02 ; i32 literal
-0000045: 0a ; OPCODE_I32_CONST
-0000046: 03 ; i32 literal
-0000047: 0a ; OPCODE_I32_CONST
-0000048: 01 ; i32 literal
-0000049: 05 ; OPCODE_SELECT
-000004a: 0b ; OPCODE_I64_CONST
-000004b: 02 ; i64 literal
-000004c: 0b ; OPCODE_I64_CONST
-000004d: 03 ; i64 literal
-000004e: 0a ; OPCODE_I32_CONST
-000004f: 01 ; i32 literal
-0000050: 05 ; OPCODE_SELECT
-0000051: 0d ; OPCODE_F32_CONST
-0000052: 0000 0040 ; f32 literal
-0000056: 0d ; OPCODE_F32_CONST
-0000057: 0000 4040 ; f32 literal
-000005b: 0a ; OPCODE_I32_CONST
-000005c: 01 ; i32 literal
-000005d: 05 ; OPCODE_SELECT
-000005e: 0c ; OPCODE_F64_CONST
-000005f: 0000 0000 0000 0040 ; f64 literal
-0000067: 0c ; OPCODE_F64_CONST
-0000068: 0000 0000 0000 0840 ; f64 literal
-0000070: 0a ; OPCODE_I32_CONST
-0000071: 01 ; i32 literal
-0000040: 31 ; FIXUP func body size
-000002e: 43 ; FIXUP section size
+0000025: 00 ; func body size (guess)
+0000026: 00 ; local decl count
+0000027: 10 ; OPCODE_I32_CONST
+0000028: 02 ; i32 literal
+0000029: 10 ; OPCODE_I32_CONST
+000002a: 03 ; i32 literal
+000002b: 10 ; OPCODE_I32_CONST
+000002c: 01 ; i32 literal
+000002d: 05 ; OPCODE_SELECT
+000002e: 11 ; OPCODE_I64_CONST
+000002f: 02 ; i64 literal
+0000030: 11 ; OPCODE_I64_CONST
+0000031: 03 ; i64 literal
+0000032: 10 ; OPCODE_I32_CONST
+0000033: 01 ; i32 literal
+0000034: 05 ; OPCODE_SELECT
+0000035: 13 ; OPCODE_F32_CONST
+0000036: 0000 0040 ; f32 literal
+000003a: 13 ; OPCODE_F32_CONST
+000003b: 0000 4040 ; f32 literal
+000003f: 10 ; OPCODE_I32_CONST
+0000040: 01 ; i32 literal
+0000041: 05 ; OPCODE_SELECT
+0000042: 12 ; OPCODE_F64_CONST
+0000043: 0000 0000 0000 0040 ; f64 literal
+000004b: 12 ; OPCODE_F64_CONST
+000004c: 0000 0000 0000 0840 ; f64 literal
+0000054: 10 ; OPCODE_I32_CONST
+0000055: 01 ; i32 literal
+0000056: 05 ; OPCODE_SELECT
+0000025: 31 ; FIXUP func body size
+0000023: 33 ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0e0a 7369 676e 6174
-0000010: 7572 6573 0100 0016 1366 756e 6374 696f
-0000020: 6e5f 7369 676e 6174 7572 6573 0100 430f
-0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 7301
-0000040: 3100 050a 020a 030a 0105 0b02 0b03 0a01
-0000050: 050d 0000 0040 0d00 0040 400a 0105 0c00
-0000060: 0000 0000 0000 400c 0000 0000 0000 0840
-0000070: 0a01
+0000000: 0061 736d 0b00 0000 0474 7970 6504 0140
+0000010: 0000 0866 756e 6374 696f 6e02 0100 0463
+0000020: 6f64 6533 0131 0010 0210 0310 0105 1102
+0000030: 1103 1001 0513 0000 0040 1300 0040 4010
+0000040: 0105 1200 0000 0000 0000 4012 0000 0000
+0000050: 0000 0840 1001 05
;;; STDOUT ;;)
diff --git a/test/dump/setlocal-param.txt b/test/dump/setlocal-param.txt
index 9b90a0bd..e33c3925 100644
--- a/test/dump/setlocal-param.txt
+++ b/test/dump/setlocal-param.txt
@@ -14,72 +14,70 @@
(set_local 5 (f32.const 0))))
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
-0000004: 0a00 0000 ; WASM_BINARY_VERSION
-; section "signatures"
-0000008: 00 ; section size (guess)
-0000009: 0a ; string length
-000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
-0000014: 01 ; num signatures
-; signature 0
-0000015: 02 ; num params
-0000016: 00 ; result_type
-0000017: 01 ; param type
-0000018: 03 ; param type
-0000008: 10 ; FIXUP section size
-; section "function_signatures"
-0000019: 00 ; section size (guess)
-000001a: 13 ; string length
-000001b: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
-000002b: 7265 73 ; section id: "function_signatures"
-000002e: 01 ; num functions
-000002f: 00 ; function 0 signature index
-0000019: 16 ; FIXUP section size
-; section "function_bodies"
-0000030: 00 ; section size (guess)
-0000031: 0f ; string length
-0000032: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
-0000041: 01 ; num functions
+0000004: 0b00 0000 ; WASM_BINARY_VERSION
+; section "type"
+0000008: 04 ; string length
+0000009: 7479 7065 ; section id: "type"
+000000d: 00 ; section size (guess)
+000000e: 01 ; num types
+; type 0
+000000f: 40 ; function form
+0000010: 02 ; num params
+0000011: 01 ; param type
+0000012: 03 ; param type
+0000013: 00 ; num results
+000000d: 06 ; FIXUP section size
+; section "function"
+0000014: 08 ; string length
+0000015: 6675 6e63 7469 6f6e ; section id: "function"
+000001d: 00 ; section size (guess)
+000001e: 01 ; num functions
+000001f: 00 ; function 0 signature index
+000001d: 02 ; FIXUP section size
+; section "code"
+0000020: 04 ; string length
+0000021: 636f 6465 ; section id: "code"
+0000025: 00 ; section size (guess)
+0000026: 01 ; num functions
; function body 0
-0000042: 00 ; func body size (guess)
-0000043: 03 ; local decl count
-0000044: 01 ; local type count
-0000045: 01 ; WASM_TYPE_I32
-0000046: 01 ; local type count
-0000047: 02 ; WASM_TYPE_I64
-0000048: 02 ; local type count
-0000049: 03 ; WASM_TYPE_F32
-000004a: 0f ; OPCODE_SET_LOCAL
-000004b: 00 ; remapped local index
-000004c: 0a ; OPCODE_I32_CONST
-000004d: 00 ; i32 literal
-000004e: 0f ; OPCODE_SET_LOCAL
-000004f: 01 ; remapped local index
-0000050: 0d ; OPCODE_F32_CONST
-0000051: 0000 0000 ; f32 literal
-0000055: 0f ; OPCODE_SET_LOCAL
-0000056: 03 ; remapped local index
-0000057: 0b ; OPCODE_I64_CONST
-0000058: 00 ; i64 literal
-0000059: 0f ; OPCODE_SET_LOCAL
-000005a: 04 ; remapped local index
-000005b: 0d ; OPCODE_F32_CONST
-000005c: 0000 0000 ; f32 literal
-0000060: 0f ; OPCODE_SET_LOCAL
-0000061: 02 ; remapped local index
-0000062: 0a ; OPCODE_I32_CONST
-0000063: 00 ; i32 literal
-0000064: 0f ; OPCODE_SET_LOCAL
-0000065: 05 ; remapped local index
-0000066: 0d ; OPCODE_F32_CONST
-0000067: 0000 0000 ; f32 literal
-0000042: 28 ; FIXUP func body size
-0000030: 3a ; FIXUP section size
+0000027: 00 ; func body size (guess)
+0000028: 03 ; local decl count
+0000029: 01 ; local type count
+000002a: 01 ; WASM_TYPE_I32
+000002b: 01 ; local type count
+000002c: 02 ; WASM_TYPE_I64
+000002d: 02 ; local type count
+000002e: 03 ; WASM_TYPE_F32
+000002f: 10 ; OPCODE_I32_CONST
+0000030: 00 ; i32 literal
+0000031: 15 ; OPCODE_SET_LOCAL
+0000032: 00 ; remapped local index
+0000033: 13 ; OPCODE_F32_CONST
+0000034: 0000 0000 ; f32 literal
+0000038: 15 ; OPCODE_SET_LOCAL
+0000039: 01 ; remapped local index
+000003a: 11 ; OPCODE_I64_CONST
+000003b: 00 ; i64 literal
+000003c: 15 ; OPCODE_SET_LOCAL
+000003d: 03 ; remapped local index
+000003e: 13 ; OPCODE_F32_CONST
+000003f: 0000 0000 ; f32 literal
+0000043: 15 ; OPCODE_SET_LOCAL
+0000044: 04 ; remapped local index
+0000045: 10 ; OPCODE_I32_CONST
+0000046: 00 ; i32 literal
+0000047: 15 ; OPCODE_SET_LOCAL
+0000048: 02 ; remapped local index
+0000049: 13 ; OPCODE_F32_CONST
+000004a: 0000 0000 ; f32 literal
+000004e: 15 ; OPCODE_SET_LOCAL
+000004f: 05 ; remapped local index
+0000027: 28 ; FIXUP func body size
+0000025: 2a ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 100a 7369 676e 6174
-0000010: 7572 6573 0102 0001 0316 1366 756e 6374
-0000020: 696f 6e5f 7369 676e 6174 7572 6573 0100
-0000030: 3a0f 6675 6e63 7469 6f6e 5f62 6f64 6965
-0000040: 7301 2803 0101 0102 0203 0f00 0a00 0f01
-0000050: 0d00 0000 000f 030b 000f 040d 0000 0000
-0000060: 0f02 0a00 0f05 0d00 0000 00
+0000000: 0061 736d 0b00 0000 0474 7970 6506 0140
+0000010: 0201 0300 0866 756e 6374 696f 6e02 0100
+0000020: 0463 6f64 652a 0128 0301 0101 0202 0310
+0000030: 0015 0013 0000 0000 1501 1100 1503 1300
+0000040: 0000 0015 0410 0015 0213 0000 0000 1505
;;; STDOUT ;;)
diff --git a/test/dump/setlocal.txt b/test/dump/setlocal.txt
index 07c897b4..07291393 100644
--- a/test/dump/setlocal.txt
+++ b/test/dump/setlocal.txt
@@ -16,81 +16,80 @@
(set_local 7 (i64.const 0))))
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
-0000004: 0a00 0000 ; WASM_BINARY_VERSION
-; section "signatures"
-0000008: 00 ; section size (guess)
-0000009: 0a ; string length
-000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
-0000014: 01 ; num signatures
-; signature 0
-0000015: 00 ; num params
-0000016: 00 ; result_type
-0000008: 0e ; FIXUP section size
-; section "function_signatures"
-0000017: 00 ; section size (guess)
-0000018: 13 ; string length
-0000019: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
-0000029: 7265 73 ; section id: "function_signatures"
-000002c: 01 ; num functions
-000002d: 00 ; function 0 signature index
-0000017: 16 ; FIXUP section size
-; section "function_bodies"
-000002e: 00 ; section size (guess)
-000002f: 0f ; string length
-0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
-000003f: 01 ; num functions
+0000004: 0b00 0000 ; WASM_BINARY_VERSION
+; section "type"
+0000008: 04 ; string length
+0000009: 7479 7065 ; section id: "type"
+000000d: 00 ; section size (guess)
+000000e: 01 ; num types
+; type 0
+000000f: 40 ; function form
+0000010: 00 ; num params
+0000011: 00 ; num results
+000000d: 04 ; FIXUP section size
+; section "function"
+0000012: 08 ; string length
+0000013: 6675 6e63 7469 6f6e ; section id: "function"
+000001b: 00 ; section size (guess)
+000001c: 01 ; num functions
+000001d: 00 ; function 0 signature index
+000001b: 02 ; FIXUP section size
+; section "code"
+000001e: 04 ; string length
+000001f: 636f 6465 ; section id: "code"
+0000023: 00 ; section size (guess)
+0000024: 01 ; num functions
; function body 0
-0000040: 00 ; func body size (guess)
-0000041: 04 ; local decl count
-0000042: 02 ; local type count
-0000043: 01 ; WASM_TYPE_I32
-0000044: 02 ; local type count
-0000045: 02 ; WASM_TYPE_I64
-0000046: 02 ; local type count
-0000047: 03 ; WASM_TYPE_F32
-0000048: 02 ; local type count
-0000049: 04 ; WASM_TYPE_F64
-000004a: 0f ; OPCODE_SET_LOCAL
-000004b: 06 ; remapped local index
-000004c: 0c ; OPCODE_F64_CONST
-000004d: 0000 0000 0000 0000 ; f64 literal
-0000055: 0f ; OPCODE_SET_LOCAL
-0000056: 04 ; remapped local index
-0000057: 0d ; OPCODE_F32_CONST
-0000058: 0000 0000 ; f32 literal
-000005c: 0f ; OPCODE_SET_LOCAL
-000005d: 02 ; remapped local index
-000005e: 0b ; OPCODE_I64_CONST
-000005f: 00 ; i64 literal
-0000060: 0f ; OPCODE_SET_LOCAL
-0000061: 00 ; remapped local index
-0000062: 0a ; OPCODE_I32_CONST
-0000063: 00 ; i32 literal
-0000064: 0f ; OPCODE_SET_LOCAL
-0000065: 01 ; remapped local index
-0000066: 0a ; OPCODE_I32_CONST
-0000067: 00 ; i32 literal
-0000068: 0f ; OPCODE_SET_LOCAL
-0000069: 05 ; remapped local index
-000006a: 0d ; OPCODE_F32_CONST
-000006b: 0000 0000 ; f32 literal
-000006f: 0f ; OPCODE_SET_LOCAL
-0000070: 07 ; remapped local index
-0000071: 0c ; OPCODE_F64_CONST
-0000072: 0000 0000 0000 0000 ; f64 literal
-000007a: 0f ; OPCODE_SET_LOCAL
-000007b: 03 ; remapped local index
-000007c: 0b ; OPCODE_I64_CONST
-000007d: 00 ; i64 literal
-0000040: 3d ; FIXUP func body size
-000002e: 4f ; FIXUP section size
+0000025: 00 ; func body size (guess)
+0000026: 04 ; local decl count
+0000027: 02 ; local type count
+0000028: 01 ; WASM_TYPE_I32
+0000029: 02 ; local type count
+000002a: 02 ; WASM_TYPE_I64
+000002b: 02 ; local type count
+000002c: 03 ; WASM_TYPE_F32
+000002d: 02 ; local type count
+000002e: 04 ; WASM_TYPE_F64
+000002f: 12 ; OPCODE_F64_CONST
+0000030: 0000 0000 0000 0000 ; f64 literal
+0000038: 15 ; OPCODE_SET_LOCAL
+0000039: 06 ; remapped local index
+000003a: 13 ; OPCODE_F32_CONST
+000003b: 0000 0000 ; f32 literal
+000003f: 15 ; OPCODE_SET_LOCAL
+0000040: 04 ; remapped local index
+0000041: 11 ; OPCODE_I64_CONST
+0000042: 00 ; i64 literal
+0000043: 15 ; OPCODE_SET_LOCAL
+0000044: 02 ; remapped local index
+0000045: 10 ; OPCODE_I32_CONST
+0000046: 00 ; i32 literal
+0000047: 15 ; OPCODE_SET_LOCAL
+0000048: 00 ; remapped local index
+0000049: 10 ; OPCODE_I32_CONST
+000004a: 00 ; i32 literal
+000004b: 15 ; OPCODE_SET_LOCAL
+000004c: 01 ; remapped local index
+000004d: 13 ; OPCODE_F32_CONST
+000004e: 0000 0000 ; f32 literal
+0000052: 15 ; OPCODE_SET_LOCAL
+0000053: 05 ; remapped local index
+0000054: 12 ; OPCODE_F64_CONST
+0000055: 0000 0000 0000 0000 ; f64 literal
+000005d: 15 ; OPCODE_SET_LOCAL
+000005e: 07 ; remapped local index
+000005f: 11 ; OPCODE_I64_CONST
+0000060: 00 ; i64 literal
+0000061: 15 ; OPCODE_SET_LOCAL
+0000062: 03 ; remapped local index
+0000025: 3d ; FIXUP func body size
+0000023: 3f ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0e0a 7369 676e 6174
-0000010: 7572 6573 0100 0016 1366 756e 6374 696f
-0000020: 6e5f 7369 676e 6174 7572 6573 0100 4f0f
-0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 7301
-0000040: 3d04 0201 0202 0203 0204 0f06 0c00 0000
-0000050: 0000 0000 000f 040d 0000 0000 0f02 0b00
-0000060: 0f00 0a00 0f01 0a00 0f05 0d00 0000 000f
-0000070: 070c 0000 0000 0000 0000 0f03 0b00
+0000000: 0061 736d 0b00 0000 0474 7970 6504 0140
+0000010: 0000 0866 756e 6374 696f 6e02 0100 0463
+0000020: 6f64 653f 013d 0402 0102 0202 0302 0412
+0000030: 0000 0000 0000 0000 1506 1300 0000 0015
+0000040: 0411 0015 0210 0015 0010 0015 0113 0000
+0000050: 0000 1505 1200 0000 0000 0000 0015 0711
+0000060: 0015 03
;;; STDOUT ;;)
diff --git a/test/dump/signatures.txt b/test/dump/signatures.txt
index 3ac067ae..3bab52a2 100644
--- a/test/dump/signatures.txt
+++ b/test/dump/signatures.txt
@@ -13,47 +13,62 @@
(type (func (param i32) (result f64))))
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
-0000004: 0a00 0000 ; WASM_BINARY_VERSION
-; section "signatures"
-0000008: 00 ; section size (guess)
-0000009: 0a ; string length
-000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
-0000014: 09 ; num signatures
-; signature 0
-0000015: 01 ; num params
-0000016: 00 ; result_type
-0000017: 01 ; param type
-; signature 1
+0000004: 0b00 0000 ; WASM_BINARY_VERSION
+; section "type"
+0000008: 04 ; string length
+0000009: 7479 7065 ; section id: "type"
+000000d: 00 ; section size (guess)
+000000e: 09 ; num types
+; type 0
+000000f: 40 ; function form
+0000010: 01 ; num params
+0000011: 01 ; param type
+0000012: 00 ; num results
+; type 1
+0000013: 40 ; function form
+0000014: 01 ; num params
+0000015: 02 ; param type
+0000016: 00 ; num results
+; type 2
+0000017: 40 ; function form
0000018: 01 ; num params
-0000019: 00 ; result_type
-000001a: 02 ; param type
-; signature 2
-000001b: 01 ; num params
-000001c: 00 ; result_type
-000001d: 03 ; param type
-; signature 3
-000001e: 01 ; num params
-000001f: 00 ; result_type
-0000020: 04 ; param type
-; signature 4
-0000021: 00 ; num params
+0000019: 03 ; param type
+000001a: 00 ; num results
+; type 3
+000001b: 40 ; function form
+000001c: 01 ; num params
+000001d: 04 ; param type
+000001e: 00 ; num results
+; type 4
+000001f: 40 ; function form
+0000020: 00 ; num params
+0000021: 01 ; num results
0000022: 01 ; result_type
-; signature 5
-0000023: 00 ; num params
-0000024: 02 ; result_type
-; signature 6
-0000025: 00 ; num params
-0000026: 03 ; result_type
-; signature 7
-0000027: 00 ; num params
-0000028: 04 ; result_type
-; signature 8
-0000029: 01 ; num params
-000002a: 04 ; result_type
-000002b: 01 ; param type
-0000008: 23 ; FIXUP section size
+; type 5
+0000023: 40 ; function form
+0000024: 00 ; num params
+0000025: 01 ; num results
+0000026: 02 ; result_type
+; type 6
+0000027: 40 ; function form
+0000028: 00 ; num params
+0000029: 01 ; num results
+000002a: 03 ; result_type
+; type 7
+000002b: 40 ; function form
+000002c: 00 ; num params
+000002d: 01 ; num results
+000002e: 04 ; result_type
+; type 8
+000002f: 40 ; function form
+0000030: 01 ; num params
+0000031: 01 ; param type
+0000032: 01 ; num results
+0000033: 04 ; result_type
+000000d: 26 ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 230a 7369 676e 6174
-0000010: 7572 6573 0901 0001 0100 0201 0003 0100
-0000020: 0400 0100 0200 0300 0401 0401
+0000000: 0061 736d 0b00 0000 0474 7970 6526 0940
+0000010: 0101 0040 0102 0040 0103 0040 0104 0040
+0000020: 0001 0140 0001 0240 0001 0340 0001 0440
+0000030: 0101 0104
;;; STDOUT ;;)
diff --git a/test/dump/store-aligned.txt b/test/dump/store-aligned.txt
index d0d4aa52..425372da 100644
--- a/test/dump/store-aligned.txt
+++ b/test/dump/store-aligned.txt
@@ -37,248 +37,246 @@
(i64.store align=8 (i32.const 0) (i64.const 0))))
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
-0000004: 0a00 0000 ; WASM_BINARY_VERSION
-; section "signatures"
-0000008: 00 ; section size (guess)
-0000009: 0a ; string length
-000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
-0000014: 01 ; num signatures
-; signature 0
-0000015: 00 ; num params
-0000016: 00 ; result_type
-0000008: 0e ; FIXUP section size
-; section "function_signatures"
-0000017: 00 ; section size (guess)
-0000018: 13 ; string length
-0000019: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
-0000029: 7265 73 ; section id: "function_signatures"
-000002c: 01 ; num functions
-000002d: 00 ; function 0 signature index
-0000017: 16 ; FIXUP section size
-; section "function_bodies"
-000002e: 00 ; section size (guess)
-000002f: 0f ; string length
-0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
-000003f: 01 ; num functions
+0000004: 0b00 0000 ; WASM_BINARY_VERSION
+; section "type"
+0000008: 04 ; string length
+0000009: 7479 7065 ; section id: "type"
+000000d: 00 ; section size (guess)
+000000e: 01 ; num types
+; type 0
+000000f: 40 ; function form
+0000010: 00 ; num params
+0000011: 00 ; num results
+000000d: 04 ; FIXUP section size
+; section "function"
+0000012: 08 ; string length
+0000013: 6675 6e63 7469 6f6e ; section id: "function"
+000001b: 00 ; section size (guess)
+000001c: 01 ; num functions
+000001d: 00 ; function 0 signature index
+000001b: 02 ; FIXUP section size
+; section "code"
+000001e: 04 ; string length
+000001f: 636f 6465 ; section id: "code"
+0000023: 00 ; section size (guess)
+0000024: 01 ; num functions
; function body 0
-0000040: 00 ; func body size (guess)
-0000041: 00 ; local decl count
-0000042: 2e ; OPCODE_I32_STORE8
-0000043: 00 ; alignment
-0000044: 00 ; store offset
-0000045: 0a ; OPCODE_I32_CONST
+0000025: 00 ; func body size (guess)
+0000026: 00 ; local decl count
+0000027: 10 ; OPCODE_I32_CONST
+0000028: 00 ; i32 literal
+0000029: 10 ; OPCODE_I32_CONST
+000002a: 00 ; i32 literal
+000002b: 2e ; OPCODE_I32_STORE8
+000002c: 00 ; alignment
+000002d: 00 ; store offset
+000002e: 10 ; OPCODE_I32_CONST
+000002f: 00 ; i32 literal
+0000030: 10 ; OPCODE_I32_CONST
+0000031: 00 ; i32 literal
+0000032: 2e ; OPCODE_I32_STORE8
+0000033: 01 ; alignment
+0000034: 00 ; store offset
+0000035: 10 ; OPCODE_I32_CONST
+0000036: 00 ; i32 literal
+0000037: 10 ; OPCODE_I32_CONST
+0000038: 00 ; i32 literal
+0000039: 2e ; OPCODE_I32_STORE8
+000003a: 02 ; alignment
+000003b: 00 ; store offset
+000003c: 10 ; OPCODE_I32_CONST
+000003d: 00 ; i32 literal
+000003e: 10 ; OPCODE_I32_CONST
+000003f: 00 ; i32 literal
+0000040: 2e ; OPCODE_I32_STORE8
+0000041: 03 ; alignment
+0000042: 00 ; store offset
+0000043: 10 ; OPCODE_I32_CONST
+0000044: 00 ; i32 literal
+0000045: 10 ; OPCODE_I32_CONST
0000046: 00 ; i32 literal
-0000047: 0a ; OPCODE_I32_CONST
-0000048: 00 ; i32 literal
-0000049: 2e ; OPCODE_I32_STORE8
-000004a: 01 ; alignment
-000004b: 00 ; store offset
-000004c: 0a ; OPCODE_I32_CONST
+0000047: 2f ; OPCODE_I32_STORE16
+0000048: 00 ; alignment
+0000049: 00 ; store offset
+000004a: 10 ; OPCODE_I32_CONST
+000004b: 00 ; i32 literal
+000004c: 10 ; OPCODE_I32_CONST
000004d: 00 ; i32 literal
-000004e: 0a ; OPCODE_I32_CONST
-000004f: 00 ; i32 literal
-0000050: 2e ; OPCODE_I32_STORE8
-0000051: 02 ; alignment
-0000052: 00 ; store offset
-0000053: 0a ; OPCODE_I32_CONST
+000004e: 2f ; OPCODE_I32_STORE16
+000004f: 01 ; alignment
+0000050: 00 ; store offset
+0000051: 10 ; OPCODE_I32_CONST
+0000052: 00 ; i32 literal
+0000053: 10 ; OPCODE_I32_CONST
0000054: 00 ; i32 literal
-0000055: 0a ; OPCODE_I32_CONST
-0000056: 00 ; i32 literal
-0000057: 2e ; OPCODE_I32_STORE8
-0000058: 03 ; alignment
-0000059: 00 ; store offset
-000005a: 0a ; OPCODE_I32_CONST
+0000055: 2f ; OPCODE_I32_STORE16
+0000056: 02 ; alignment
+0000057: 00 ; store offset
+0000058: 10 ; OPCODE_I32_CONST
+0000059: 00 ; i32 literal
+000005a: 10 ; OPCODE_I32_CONST
000005b: 00 ; i32 literal
-000005c: 0a ; OPCODE_I32_CONST
-000005d: 00 ; i32 literal
-000005e: 2f ; OPCODE_I32_STORE16
-000005f: 00 ; alignment
-0000060: 00 ; store offset
-0000061: 0a ; OPCODE_I32_CONST
+000005c: 2f ; OPCODE_I32_STORE16
+000005d: 03 ; alignment
+000005e: 00 ; store offset
+000005f: 10 ; OPCODE_I32_CONST
+0000060: 00 ; i32 literal
+0000061: 10 ; OPCODE_I32_CONST
0000062: 00 ; i32 literal
-0000063: 0a ; OPCODE_I32_CONST
-0000064: 00 ; i32 literal
-0000065: 2f ; OPCODE_I32_STORE16
-0000066: 01 ; alignment
-0000067: 00 ; store offset
-0000068: 0a ; OPCODE_I32_CONST
+0000063: 33 ; OPCODE_I32_STORE
+0000064: 00 ; alignment
+0000065: 00 ; store offset
+0000066: 10 ; OPCODE_I32_CONST
+0000067: 00 ; i32 literal
+0000068: 10 ; OPCODE_I32_CONST
0000069: 00 ; i32 literal
-000006a: 0a ; OPCODE_I32_CONST
-000006b: 00 ; i32 literal
-000006c: 2f ; OPCODE_I32_STORE16
-000006d: 02 ; alignment
-000006e: 00 ; store offset
-000006f: 0a ; OPCODE_I32_CONST
+000006a: 33 ; OPCODE_I32_STORE
+000006b: 01 ; alignment
+000006c: 00 ; store offset
+000006d: 10 ; OPCODE_I32_CONST
+000006e: 00 ; i32 literal
+000006f: 10 ; OPCODE_I32_CONST
0000070: 00 ; i32 literal
-0000071: 0a ; OPCODE_I32_CONST
-0000072: 00 ; i32 literal
-0000073: 2f ; OPCODE_I32_STORE16
-0000074: 03 ; alignment
-0000075: 00 ; store offset
-0000076: 0a ; OPCODE_I32_CONST
+0000071: 33 ; OPCODE_I32_STORE
+0000072: 02 ; alignment
+0000073: 00 ; store offset
+0000074: 10 ; OPCODE_I32_CONST
+0000075: 00 ; i32 literal
+0000076: 10 ; OPCODE_I32_CONST
0000077: 00 ; i32 literal
-0000078: 0a ; OPCODE_I32_CONST
-0000079: 00 ; i32 literal
-000007a: 33 ; OPCODE_I32_STORE
-000007b: 00 ; alignment
-000007c: 00 ; store offset
-000007d: 0a ; OPCODE_I32_CONST
-000007e: 00 ; i32 literal
-000007f: 0a ; OPCODE_I32_CONST
-0000080: 00 ; i32 literal
-0000081: 33 ; OPCODE_I32_STORE
-0000082: 01 ; alignment
-0000083: 00 ; store offset
-0000084: 0a ; OPCODE_I32_CONST
-0000085: 00 ; i32 literal
-0000086: 0a ; OPCODE_I32_CONST
-0000087: 00 ; i32 literal
-0000088: 33 ; OPCODE_I32_STORE
-0000089: 02 ; alignment
-000008a: 00 ; store offset
-000008b: 0a ; OPCODE_I32_CONST
-000008c: 00 ; i32 literal
-000008d: 0a ; OPCODE_I32_CONST
-000008e: 00 ; i32 literal
-000008f: 33 ; OPCODE_I32_STORE
-0000090: 03 ; alignment
-0000091: 00 ; store offset
-0000092: 0a ; OPCODE_I32_CONST
-0000093: 00 ; i32 literal
-0000094: 0a ; OPCODE_I32_CONST
-0000095: 00 ; i32 literal
-0000096: 34 ; OPCODE_I64_STORE
-0000097: 00 ; alignment
-0000098: 00 ; store offset
-0000099: 0a ; OPCODE_I32_CONST
-000009a: 00 ; i32 literal
-000009b: 0b ; OPCODE_I64_CONST
-000009c: 00 ; i64 literal
-000009d: 34 ; OPCODE_I64_STORE
-000009e: 01 ; alignment
-000009f: 00 ; store offset
-00000a0: 0a ; OPCODE_I32_CONST
-00000a1: 00 ; i32 literal
-00000a2: 0b ; OPCODE_I64_CONST
-00000a3: 00 ; i64 literal
-00000a4: 34 ; OPCODE_I64_STORE
-00000a5: 02 ; alignment
-00000a6: 00 ; store offset
-00000a7: 0a ; OPCODE_I32_CONST
-00000a8: 00 ; i32 literal
-00000a9: 0b ; OPCODE_I64_CONST
-00000aa: 00 ; i64 literal
-00000ab: 34 ; OPCODE_I64_STORE
-00000ac: 03 ; alignment
-00000ad: 00 ; store offset
-00000ae: 0a ; OPCODE_I32_CONST
-00000af: 00 ; i32 literal
-00000b0: 0b ; OPCODE_I64_CONST
-00000b1: 00 ; i64 literal
-00000b2: 30 ; OPCODE_I64_STORE8
-00000b3: 00 ; alignment
-00000b4: 00 ; store offset
-00000b5: 0a ; OPCODE_I32_CONST
-00000b6: 00 ; i32 literal
-00000b7: 0b ; OPCODE_I64_CONST
-00000b8: 00 ; i64 literal
-00000b9: 30 ; OPCODE_I64_STORE8
-00000ba: 01 ; alignment
-00000bb: 00 ; store offset
-00000bc: 0a ; OPCODE_I32_CONST
-00000bd: 00 ; i32 literal
-00000be: 0b ; OPCODE_I64_CONST
-00000bf: 00 ; i64 literal
-00000c0: 30 ; OPCODE_I64_STORE8
-00000c1: 02 ; alignment
-00000c2: 00 ; store offset
-00000c3: 0a ; OPCODE_I32_CONST
-00000c4: 00 ; i32 literal
-00000c5: 0b ; OPCODE_I64_CONST
-00000c6: 00 ; i64 literal
-00000c7: 30 ; OPCODE_I64_STORE8
-00000c8: 03 ; alignment
-00000c9: 00 ; store offset
-00000ca: 0a ; OPCODE_I32_CONST
-00000cb: 00 ; i32 literal
-00000cc: 0b ; OPCODE_I64_CONST
-00000cd: 00 ; i64 literal
-00000ce: 31 ; OPCODE_I64_STORE16
-00000cf: 00 ; alignment
-00000d0: 00 ; store offset
-00000d1: 0a ; OPCODE_I32_CONST
-00000d2: 00 ; i32 literal
-00000d3: 0b ; OPCODE_I64_CONST
-00000d4: 00 ; i64 literal
-00000d5: 31 ; OPCODE_I64_STORE16
-00000d6: 01 ; alignment
-00000d7: 00 ; store offset
-00000d8: 0a ; OPCODE_I32_CONST
-00000d9: 00 ; i32 literal
-00000da: 0b ; OPCODE_I64_CONST
-00000db: 00 ; i64 literal
-00000dc: 31 ; OPCODE_I64_STORE16
-00000dd: 02 ; alignment
-00000de: 00 ; store offset
-00000df: 0a ; OPCODE_I32_CONST
-00000e0: 00 ; i32 literal
-00000e1: 0b ; OPCODE_I64_CONST
-00000e2: 00 ; i64 literal
-00000e3: 31 ; OPCODE_I64_STORE16
-00000e4: 03 ; alignment
-00000e5: 00 ; store offset
-00000e6: 0a ; OPCODE_I32_CONST
-00000e7: 00 ; i32 literal
-00000e8: 0b ; OPCODE_I64_CONST
-00000e9: 00 ; i64 literal
-00000ea: 34 ; OPCODE_I64_STORE
-00000eb: 00 ; alignment
-00000ec: 00 ; store offset
-00000ed: 0a ; OPCODE_I32_CONST
-00000ee: 00 ; i32 literal
-00000ef: 0b ; OPCODE_I64_CONST
-00000f0: 00 ; i64 literal
-00000f1: 34 ; OPCODE_I64_STORE
-00000f2: 01 ; alignment
-00000f3: 00 ; store offset
-00000f4: 0a ; OPCODE_I32_CONST
-00000f5: 00 ; i32 literal
-00000f6: 0b ; OPCODE_I64_CONST
-00000f7: 00 ; i64 literal
-00000f8: 34 ; OPCODE_I64_STORE
-00000f9: 02 ; alignment
-00000fa: 00 ; store offset
-00000fb: 0a ; OPCODE_I32_CONST
-00000fc: 00 ; i32 literal
-00000fd: 0b ; OPCODE_I64_CONST
-00000fe: 00 ; i64 literal
-00000ff: 34 ; OPCODE_I64_STORE
-0000100: 03 ; alignment
-0000101: 00 ; store offset
-0000102: 0a ; OPCODE_I32_CONST
-0000103: 00 ; i32 literal
-0000104: 0b ; OPCODE_I64_CONST
-0000105: 00 ; i64 literal
-; move data: [41, 106) -> [42, 107)
-0000040: c501 ; FIXUP func body size
-; move data: [2f, 107) -> [30, 108)
-000002e: d801 ; FIXUP section size
+0000078: 33 ; OPCODE_I32_STORE
+0000079: 03 ; alignment
+000007a: 00 ; store offset
+000007b: 10 ; OPCODE_I32_CONST
+000007c: 00 ; i32 literal
+000007d: 11 ; OPCODE_I64_CONST
+000007e: 00 ; i64 literal
+000007f: 34 ; OPCODE_I64_STORE
+0000080: 00 ; alignment
+0000081: 00 ; store offset
+0000082: 10 ; OPCODE_I32_CONST
+0000083: 00 ; i32 literal
+0000084: 11 ; OPCODE_I64_CONST
+0000085: 00 ; i64 literal
+0000086: 34 ; OPCODE_I64_STORE
+0000087: 01 ; alignment
+0000088: 00 ; store offset
+0000089: 10 ; OPCODE_I32_CONST
+000008a: 00 ; i32 literal
+000008b: 11 ; OPCODE_I64_CONST
+000008c: 00 ; i64 literal
+000008d: 34 ; OPCODE_I64_STORE
+000008e: 02 ; alignment
+000008f: 00 ; store offset
+0000090: 10 ; OPCODE_I32_CONST
+0000091: 00 ; i32 literal
+0000092: 11 ; OPCODE_I64_CONST
+0000093: 00 ; i64 literal
+0000094: 34 ; OPCODE_I64_STORE
+0000095: 03 ; alignment
+0000096: 00 ; store offset
+0000097: 10 ; OPCODE_I32_CONST
+0000098: 00 ; i32 literal
+0000099: 11 ; OPCODE_I64_CONST
+000009a: 00 ; i64 literal
+000009b: 30 ; OPCODE_I64_STORE8
+000009c: 00 ; alignment
+000009d: 00 ; store offset
+000009e: 10 ; OPCODE_I32_CONST
+000009f: 00 ; i32 literal
+00000a0: 11 ; OPCODE_I64_CONST
+00000a1: 00 ; i64 literal
+00000a2: 30 ; OPCODE_I64_STORE8
+00000a3: 01 ; alignment
+00000a4: 00 ; store offset
+00000a5: 10 ; OPCODE_I32_CONST
+00000a6: 00 ; i32 literal
+00000a7: 11 ; OPCODE_I64_CONST
+00000a8: 00 ; i64 literal
+00000a9: 30 ; OPCODE_I64_STORE8
+00000aa: 02 ; alignment
+00000ab: 00 ; store offset
+00000ac: 10 ; OPCODE_I32_CONST
+00000ad: 00 ; i32 literal
+00000ae: 11 ; OPCODE_I64_CONST
+00000af: 00 ; i64 literal
+00000b0: 30 ; OPCODE_I64_STORE8
+00000b1: 03 ; alignment
+00000b2: 00 ; store offset
+00000b3: 10 ; OPCODE_I32_CONST
+00000b4: 00 ; i32 literal
+00000b5: 11 ; OPCODE_I64_CONST
+00000b6: 00 ; i64 literal
+00000b7: 31 ; OPCODE_I64_STORE16
+00000b8: 00 ; alignment
+00000b9: 00 ; store offset
+00000ba: 10 ; OPCODE_I32_CONST
+00000bb: 00 ; i32 literal
+00000bc: 11 ; OPCODE_I64_CONST
+00000bd: 00 ; i64 literal
+00000be: 31 ; OPCODE_I64_STORE16
+00000bf: 01 ; alignment
+00000c0: 00 ; store offset
+00000c1: 10 ; OPCODE_I32_CONST
+00000c2: 00 ; i32 literal
+00000c3: 11 ; OPCODE_I64_CONST
+00000c4: 00 ; i64 literal
+00000c5: 31 ; OPCODE_I64_STORE16
+00000c6: 02 ; alignment
+00000c7: 00 ; store offset
+00000c8: 10 ; OPCODE_I32_CONST
+00000c9: 00 ; i32 literal
+00000ca: 11 ; OPCODE_I64_CONST
+00000cb: 00 ; i64 literal
+00000cc: 31 ; OPCODE_I64_STORE16
+00000cd: 03 ; alignment
+00000ce: 00 ; store offset
+00000cf: 10 ; OPCODE_I32_CONST
+00000d0: 00 ; i32 literal
+00000d1: 11 ; OPCODE_I64_CONST
+00000d2: 00 ; i64 literal
+00000d3: 34 ; OPCODE_I64_STORE
+00000d4: 00 ; alignment
+00000d5: 00 ; store offset
+00000d6: 10 ; OPCODE_I32_CONST
+00000d7: 00 ; i32 literal
+00000d8: 11 ; OPCODE_I64_CONST
+00000d9: 00 ; i64 literal
+00000da: 34 ; OPCODE_I64_STORE
+00000db: 01 ; alignment
+00000dc: 00 ; store offset
+00000dd: 10 ; OPCODE_I32_CONST
+00000de: 00 ; i32 literal
+00000df: 11 ; OPCODE_I64_CONST
+00000e0: 00 ; i64 literal
+00000e1: 34 ; OPCODE_I64_STORE
+00000e2: 02 ; alignment
+00000e3: 00 ; store offset
+00000e4: 10 ; OPCODE_I32_CONST
+00000e5: 00 ; i32 literal
+00000e6: 11 ; OPCODE_I64_CONST
+00000e7: 00 ; i64 literal
+00000e8: 34 ; OPCODE_I64_STORE
+00000e9: 03 ; alignment
+00000ea: 00 ; store offset
+; move data: [26, eb) -> [27, ec)
+0000025: c501 ; FIXUP func body size
+; move data: [24, ec) -> [25, ed)
+0000023: c801 ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0e0a 7369 676e 6174
-0000010: 7572 6573 0100 0016 1366 756e 6374 696f
-0000020: 6e5f 7369 676e 6174 7572 6573 0100 d801
-0000030: 0f66 756e 6374 696f 6e5f 626f 6469 6573
-0000040: 01c5 0100 2e00 000a 000a 002e 0100 0a00
-0000050: 0a00 2e02 000a 000a 002e 0300 0a00 0a00
-0000060: 2f00 000a 000a 002f 0100 0a00 0a00 2f02
-0000070: 000a 000a 002f 0300 0a00 0a00 3300 000a
-0000080: 000a 0033 0100 0a00 0a00 3302 000a 000a
-0000090: 0033 0300 0a00 0a00 3400 000a 000b 0034
-00000a0: 0100 0a00 0b00 3402 000a 000b 0034 0300
-00000b0: 0a00 0b00 3000 000a 000b 0030 0100 0a00
-00000c0: 0b00 3002 000a 000b 0030 0300 0a00 0b00
-00000d0: 3100 000a 000b 0031 0100 0a00 0b00 3102
-00000e0: 000a 000b 0031 0300 0a00 0b00 3400 000a
-00000f0: 000b 0034 0100 0a00 0b00 3402 000a 000b
-0000100: 0034 0300 0a00 0b00
+0000000: 0061 736d 0b00 0000 0474 7970 6504 0140
+0000010: 0000 0866 756e 6374 696f 6e02 0100 0463
+0000020: 6f64 65c8 0101 c501 0010 0010 002e 0000
+0000030: 1000 1000 2e01 0010 0010 002e 0200 1000
+0000040: 1000 2e03 0010 0010 002f 0000 1000 1000
+0000050: 2f01 0010 0010 002f 0200 1000 1000 2f03
+0000060: 0010 0010 0033 0000 1000 1000 3301 0010
+0000070: 0010 0033 0200 1000 1000 3303 0010 0011
+0000080: 0034 0000 1000 1100 3401 0010 0011 0034
+0000090: 0200 1000 1100 3403 0010 0011 0030 0000
+00000a0: 1000 1100 3001 0010 0011 0030 0200 1000
+00000b0: 1100 3003 0010 0011 0031 0000 1000 1100
+00000c0: 3101 0010 0011 0031 0200 1000 1100 3103
+00000d0: 0010 0011 0034 0000 1000 1100 3401 0010
+00000e0: 0011 0034 0200 1000 1100 3403 00
;;; STDOUT ;;)
diff --git a/test/dump/store.txt b/test/dump/store.txt
index edff71ac..67f672ef 100644
--- a/test/dump/store.txt
+++ b/test/dump/store.txt
@@ -12,105 +12,103 @@
(f64.store (i32.const 0) (f64.const 0))))
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
-0000004: 0a00 0000 ; WASM_BINARY_VERSION
-; section "signatures"
-0000008: 00 ; section size (guess)
-0000009: 0a ; string length
-000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
-0000014: 01 ; num signatures
-; signature 0
-0000015: 00 ; num params
-0000016: 00 ; result_type
-0000008: 0e ; FIXUP section size
-; section "function_signatures"
-0000017: 00 ; section size (guess)
-0000018: 13 ; string length
-0000019: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
-0000029: 7265 73 ; section id: "function_signatures"
-000002c: 01 ; num functions
-000002d: 00 ; function 0 signature index
-0000017: 16 ; FIXUP section size
-; section "function_bodies"
-000002e: 00 ; section size (guess)
-000002f: 0f ; string length
-0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
-000003f: 01 ; num functions
+0000004: 0b00 0000 ; WASM_BINARY_VERSION
+; section "type"
+0000008: 04 ; string length
+0000009: 7479 7065 ; section id: "type"
+000000d: 00 ; section size (guess)
+000000e: 01 ; num types
+; type 0
+000000f: 40 ; function form
+0000010: 00 ; num params
+0000011: 00 ; num results
+000000d: 04 ; FIXUP section size
+; section "function"
+0000012: 08 ; string length
+0000013: 6675 6e63 7469 6f6e ; section id: "function"
+000001b: 00 ; section size (guess)
+000001c: 01 ; num functions
+000001d: 00 ; function 0 signature index
+000001b: 02 ; FIXUP section size
+; section "code"
+000001e: 04 ; string length
+000001f: 636f 6465 ; section id: "code"
+0000023: 00 ; section size (guess)
+0000024: 01 ; num functions
; function body 0
-0000040: 00 ; func body size (guess)
-0000041: 00 ; local decl count
-0000042: 2e ; OPCODE_I32_STORE8
-0000043: 00 ; alignment
-0000044: 00 ; store offset
-0000045: 0a ; OPCODE_I32_CONST
-0000046: 00 ; i32 literal
-0000047: 0a ; OPCODE_I32_CONST
-0000048: 00 ; i32 literal
-0000049: 2f ; OPCODE_I32_STORE16
-000004a: 01 ; alignment
-000004b: 00 ; store offset
-000004c: 0a ; OPCODE_I32_CONST
-000004d: 00 ; i32 literal
-000004e: 0a ; OPCODE_I32_CONST
-000004f: 00 ; i32 literal
-0000050: 33 ; OPCODE_I32_STORE
-0000051: 02 ; alignment
-0000052: 00 ; store offset
-0000053: 0a ; OPCODE_I32_CONST
-0000054: 00 ; i32 literal
-0000055: 0a ; OPCODE_I32_CONST
-0000056: 00 ; i32 literal
-0000057: 34 ; OPCODE_I64_STORE
-0000058: 03 ; alignment
-0000059: 00 ; store offset
-000005a: 0a ; OPCODE_I32_CONST
-000005b: 00 ; i32 literal
-000005c: 0b ; OPCODE_I64_CONST
-000005d: 00 ; i64 literal
-000005e: 30 ; OPCODE_I64_STORE8
-000005f: 00 ; alignment
-0000060: 00 ; store offset
-0000061: 0a ; OPCODE_I32_CONST
-0000062: 00 ; i32 literal
-0000063: 0b ; OPCODE_I64_CONST
-0000064: 00 ; i64 literal
-0000065: 31 ; OPCODE_I64_STORE16
-0000066: 01 ; alignment
-0000067: 00 ; store offset
-0000068: 0a ; OPCODE_I32_CONST
-0000069: 00 ; i32 literal
-000006a: 0b ; OPCODE_I64_CONST
-000006b: 00 ; i64 literal
-000006c: 32 ; OPCODE_I64_STORE32
-000006d: 02 ; alignment
-000006e: 00 ; store offset
-000006f: 0a ; OPCODE_I32_CONST
-0000070: 00 ; i32 literal
-0000071: 0b ; OPCODE_I64_CONST
-0000072: 00 ; i64 literal
-0000073: 35 ; OPCODE_F32_STORE
-0000074: 02 ; alignment
-0000075: 00 ; store offset
-0000076: 0a ; OPCODE_I32_CONST
-0000077: 00 ; i32 literal
-0000078: 0d ; OPCODE_F32_CONST
-0000079: 0000 0000 ; f32 literal
-000007d: 36 ; OPCODE_F64_STORE
-000007e: 03 ; alignment
-000007f: 00 ; store offset
-0000080: 0a ; OPCODE_I32_CONST
-0000081: 00 ; i32 literal
-0000082: 0c ; OPCODE_F64_CONST
-0000083: 0000 0000 0000 0000 ; f64 literal
-0000040: 4a ; FIXUP func body size
-000002e: 5c ; FIXUP section size
+0000025: 00 ; func body size (guess)
+0000026: 00 ; local decl count
+0000027: 10 ; OPCODE_I32_CONST
+0000028: 00 ; i32 literal
+0000029: 10 ; OPCODE_I32_CONST
+000002a: 00 ; i32 literal
+000002b: 2e ; OPCODE_I32_STORE8
+000002c: 00 ; alignment
+000002d: 00 ; store offset
+000002e: 10 ; OPCODE_I32_CONST
+000002f: 00 ; i32 literal
+0000030: 10 ; OPCODE_I32_CONST
+0000031: 00 ; i32 literal
+0000032: 2f ; OPCODE_I32_STORE16
+0000033: 01 ; alignment
+0000034: 00 ; store offset
+0000035: 10 ; OPCODE_I32_CONST
+0000036: 00 ; i32 literal
+0000037: 10 ; OPCODE_I32_CONST
+0000038: 00 ; i32 literal
+0000039: 33 ; OPCODE_I32_STORE
+000003a: 02 ; alignment
+000003b: 00 ; store offset
+000003c: 10 ; OPCODE_I32_CONST
+000003d: 00 ; i32 literal
+000003e: 11 ; OPCODE_I64_CONST
+000003f: 00 ; i64 literal
+0000040: 34 ; OPCODE_I64_STORE
+0000041: 03 ; alignment
+0000042: 00 ; store offset
+0000043: 10 ; OPCODE_I32_CONST
+0000044: 00 ; i32 literal
+0000045: 11 ; OPCODE_I64_CONST
+0000046: 00 ; i64 literal
+0000047: 30 ; OPCODE_I64_STORE8
+0000048: 00 ; alignment
+0000049: 00 ; store offset
+000004a: 10 ; OPCODE_I32_CONST
+000004b: 00 ; i32 literal
+000004c: 11 ; OPCODE_I64_CONST
+000004d: 00 ; i64 literal
+000004e: 31 ; OPCODE_I64_STORE16
+000004f: 01 ; alignment
+0000050: 00 ; store offset
+0000051: 10 ; OPCODE_I32_CONST
+0000052: 00 ; i32 literal
+0000053: 11 ; OPCODE_I64_CONST
+0000054: 00 ; i64 literal
+0000055: 32 ; OPCODE_I64_STORE32
+0000056: 02 ; alignment
+0000057: 00 ; store offset
+0000058: 10 ; OPCODE_I32_CONST
+0000059: 00 ; i32 literal
+000005a: 13 ; OPCODE_F32_CONST
+000005b: 0000 0000 ; f32 literal
+000005f: 35 ; OPCODE_F32_STORE
+0000060: 02 ; alignment
+0000061: 00 ; store offset
+0000062: 10 ; OPCODE_I32_CONST
+0000063: 00 ; i32 literal
+0000064: 12 ; OPCODE_F64_CONST
+0000065: 0000 0000 0000 0000 ; f64 literal
+000006d: 36 ; OPCODE_F64_STORE
+000006e: 03 ; alignment
+000006f: 00 ; store offset
+0000025: 4a ; FIXUP func body size
+0000023: 4c ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0e0a 7369 676e 6174
-0000010: 7572 6573 0100 0016 1366 756e 6374 696f
-0000020: 6e5f 7369 676e 6174 7572 6573 0100 5c0f
-0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 7301
-0000040: 4a00 2e00 000a 000a 002f 0100 0a00 0a00
-0000050: 3302 000a 000a 0034 0300 0a00 0b00 3000
-0000060: 000a 000b 0031 0100 0a00 0b00 3202 000a
-0000070: 000b 0035 0200 0a00 0d00 0000 0036 0300
-0000080: 0a00 0c00 0000 0000 0000 00
+0000000: 0061 736d 0b00 0000 0474 7970 6504 0140
+0000010: 0000 0866 756e 6374 696f 6e02 0100 0463
+0000020: 6f64 654c 014a 0010 0010 002e 0000 1000
+0000030: 1000 2f01 0010 0010 0033 0200 1000 1100
+0000040: 3403 0010 0011 0030 0000 1000 1100 3101
+0000050: 0010 0011 0032 0200 1000 1300 0000 0035
+0000060: 0200 1000 1200 0000 0000 0000 0036 0300
;;; STDOUT ;;)
diff --git a/test/dump/string-escape.txt b/test/dump/string-escape.txt
index 5fc044ce..25d8ceb3 100644
--- a/test/dump/string-escape.txt
+++ b/test/dump/string-escape.txt
@@ -2,52 +2,50 @@
(module (func) (export "tab:\t newline:\n slash:\\ quote:\' double:\"" 0))
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
-0000004: 0a00 0000 ; WASM_BINARY_VERSION
-; section "signatures"
-0000008: 00 ; section size (guess)
-0000009: 0a ; string length
-000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
-0000014: 01 ; num signatures
-; signature 0
-0000015: 00 ; num params
-0000016: 00 ; result_type
-0000008: 0e ; FIXUP section size
-; section "function_signatures"
-0000017: 00 ; section size (guess)
-0000018: 13 ; string length
-0000019: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
-0000029: 7265 73 ; section id: "function_signatures"
-000002c: 01 ; num functions
-000002d: 00 ; function 0 signature index
-0000017: 16 ; FIXUP section size
-; section "export_table"
-000002e: 00 ; section size (guess)
-000002f: 0c ; string length
-0000030: 6578 706f 7274 5f74 6162 6c65 ; section id: "export_table"
-000003c: 01 ; num exports
-000003d: 00 ; export func index
-000003e: 28 ; string length
-000003f: 7461 623a 0920 6e65 776c 696e 653a 0a20 tab:. newline:.
-000004f: 736c 6173 683a 5c20 7175 6f74 653a 2720 slash:\ quote:'
-000005f: 646f 7562 6c65 3a22 double:" ; export name
-000002e: 38 ; FIXUP section size
-; section "function_bodies"
-0000067: 00 ; section size (guess)
-0000068: 0f ; string length
-0000069: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
-0000078: 01 ; num functions
+0000004: 0b00 0000 ; WASM_BINARY_VERSION
+; section "type"
+0000008: 04 ; string length
+0000009: 7479 7065 ; section id: "type"
+000000d: 00 ; section size (guess)
+000000e: 01 ; num types
+; type 0
+000000f: 40 ; function form
+0000010: 00 ; num params
+0000011: 00 ; num results
+000000d: 04 ; FIXUP section size
+; section "function"
+0000012: 08 ; string length
+0000013: 6675 6e63 7469 6f6e ; section id: "function"
+000001b: 00 ; section size (guess)
+000001c: 01 ; num functions
+000001d: 00 ; function 0 signature index
+000001b: 02 ; FIXUP section size
+; section "export"
+000001e: 06 ; string length
+000001f: 6578 706f 7274 ; section id: "export"
+0000025: 00 ; section size (guess)
+0000026: 01 ; num exports
+0000027: 00 ; export func index
+0000028: 28 ; string length
+0000029: 7461 623a 0920 6e65 776c 696e 653a 0a20 tab:. newline:.
+0000039: 736c 6173 683a 5c20 7175 6f74 653a 2720 slash:\ quote:'
+0000049: 646f 7562 6c65 3a22 double:" ; export name
+0000025: 2b ; FIXUP section size
+; section "code"
+0000051: 04 ; string length
+0000052: 636f 6465 ; section id: "code"
+0000056: 00 ; section size (guess)
+0000057: 01 ; num functions
; function body 0
-0000079: 00 ; func body size (guess)
-000007a: 00 ; local decl count
-0000079: 01 ; FIXUP func body size
-0000067: 13 ; FIXUP section size
+0000058: 00 ; func body size (guess)
+0000059: 00 ; local decl count
+0000058: 01 ; FIXUP func body size
+0000056: 03 ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0e0a 7369 676e 6174
-0000010: 7572 6573 0100 0016 1366 756e 6374 696f
-0000020: 6e5f 7369 676e 6174 7572 6573 0100 380c
-0000030: 6578 706f 7274 5f74 6162 6c65 0100 2874
-0000040: 6162 3a09 206e 6577 6c69 6e65 3a0a 2073
-0000050: 6c61 7368 3a5c 2071 756f 7465 3a27 2064
-0000060: 6f75 626c 653a 2213 0f66 756e 6374 696f
-0000070: 6e5f 626f 6469 6573 0101 00
+0000000: 0061 736d 0b00 0000 0474 7970 6504 0140
+0000010: 0000 0866 756e 6374 696f 6e02 0100 0665
+0000020: 7870 6f72 742b 0100 2874 6162 3a09 206e
+0000030: 6577 6c69 6e65 3a0a 2073 6c61 7368 3a5c
+0000040: 2071 756f 7465 3a27 2064 6f75 626c 653a
+0000050: 2204 636f 6465 0301 0100
;;; STDOUT ;;)
diff --git a/test/dump/string-hex.txt b/test/dump/string-hex.txt
index c6a90713..f8e33d76 100644
--- a/test/dump/string-hex.txt
+++ b/test/dump/string-hex.txt
@@ -2,48 +2,46 @@
(module (func) (export "foo\ba\dc\0d\ee" 0))
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
-0000004: 0a00 0000 ; WASM_BINARY_VERSION
-; section "signatures"
-0000008: 00 ; section size (guess)
-0000009: 0a ; string length
-000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
-0000014: 01 ; num signatures
-; signature 0
-0000015: 00 ; num params
-0000016: 00 ; result_type
-0000008: 0e ; FIXUP section size
-; section "function_signatures"
-0000017: 00 ; section size (guess)
-0000018: 13 ; string length
-0000019: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
-0000029: 7265 73 ; section id: "function_signatures"
-000002c: 01 ; num functions
-000002d: 00 ; function 0 signature index
-0000017: 16 ; FIXUP section size
-; section "export_table"
-000002e: 00 ; section size (guess)
-000002f: 0c ; string length
-0000030: 6578 706f 7274 5f74 6162 6c65 ; section id: "export_table"
-000003c: 01 ; num exports
-000003d: 00 ; export func index
-000003e: 07 ; string length
-000003f: 666f 6fba dc0d ee foo.... ; export name
-000002e: 17 ; FIXUP section size
-; section "function_bodies"
-0000046: 00 ; section size (guess)
-0000047: 0f ; string length
-0000048: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
-0000057: 01 ; num functions
+0000004: 0b00 0000 ; WASM_BINARY_VERSION
+; section "type"
+0000008: 04 ; string length
+0000009: 7479 7065 ; section id: "type"
+000000d: 00 ; section size (guess)
+000000e: 01 ; num types
+; type 0
+000000f: 40 ; function form
+0000010: 00 ; num params
+0000011: 00 ; num results
+000000d: 04 ; FIXUP section size
+; section "function"
+0000012: 08 ; string length
+0000013: 6675 6e63 7469 6f6e ; section id: "function"
+000001b: 00 ; section size (guess)
+000001c: 01 ; num functions
+000001d: 00 ; function 0 signature index
+000001b: 02 ; FIXUP section size
+; section "export"
+000001e: 06 ; string length
+000001f: 6578 706f 7274 ; section id: "export"
+0000025: 00 ; section size (guess)
+0000026: 01 ; num exports
+0000027: 00 ; export func index
+0000028: 07 ; string length
+0000029: 666f 6fba dc0d ee foo.... ; export name
+0000025: 0a ; FIXUP section size
+; section "code"
+0000030: 04 ; string length
+0000031: 636f 6465 ; section id: "code"
+0000035: 00 ; section size (guess)
+0000036: 01 ; num functions
; function body 0
-0000058: 00 ; func body size (guess)
-0000059: 00 ; local decl count
-0000058: 01 ; FIXUP func body size
-0000046: 13 ; FIXUP section size
+0000037: 00 ; func body size (guess)
+0000038: 00 ; local decl count
+0000037: 01 ; FIXUP func body size
+0000035: 03 ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0e0a 7369 676e 6174
-0000010: 7572 6573 0100 0016 1366 756e 6374 696f
-0000020: 6e5f 7369 676e 6174 7572 6573 0100 170c
-0000030: 6578 706f 7274 5f74 6162 6c65 0100 0766
-0000040: 6f6f badc 0dee 130f 6675 6e63 7469 6f6e
-0000050: 5f62 6f64 6965 7301 0100
+0000000: 0061 736d 0b00 0000 0474 7970 6504 0140
+0000010: 0000 0866 756e 6374 696f 6e02 0100 0665
+0000020: 7870 6f72 740a 0100 0766 6f6f badc 0dee
+0000030: 0463 6f64 6503 0101 00
;;; STDOUT ;;)
diff --git a/test/dump/table.txt b/test/dump/table.txt
index 87a4b2c1..89d1d75b 100644
--- a/test/dump/table.txt
+++ b/test/dump/table.txt
@@ -7,71 +7,72 @@
(table 0 0 1 2))
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
-0000004: 0a00 0000 ; WASM_BINARY_VERSION
-; section "signatures"
-0000008: 00 ; section size (guess)
-0000009: 0a ; string length
-000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
-0000014: 03 ; num signatures
-; signature 0
-0000015: 01 ; num params
-0000016: 00 ; result_type
-0000017: 01 ; param type
-; signature 1
-0000018: 02 ; num params
-0000019: 00 ; result_type
-000001a: 01 ; param type
-000001b: 02 ; param type
-; signature 2
-000001c: 00 ; num params
-000001d: 04 ; result_type
-0000008: 15 ; FIXUP section size
-; section "function_signatures"
-000001e: 00 ; section size (guess)
-000001f: 13 ; string length
-0000020: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
-0000030: 7265 73 ; section id: "function_signatures"
-0000033: 03 ; num functions
-0000034: 00 ; function 0 signature index
-0000035: 01 ; function 1 signature index
-0000036: 02 ; function 2 signature index
-000001e: 18 ; FIXUP section size
-; section "function_table"
-0000037: 00 ; section size (guess)
-0000038: 0e ; string length
-0000039: 6675 6e63 7469 6f6e 5f74 6162 6c65 ; section id: "function_table"
-0000047: 04 ; num function table entries
-0000048: 00 ; function table entry
-0000049: 00 ; function table entry
-000004a: 01 ; function table entry
-000004b: 02 ; function table entry
-0000037: 14 ; FIXUP section size
-; section "function_bodies"
-000004c: 00 ; section size (guess)
-000004d: 0f ; string length
-000004e: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
-000005d: 03 ; num functions
+0000004: 0b00 0000 ; WASM_BINARY_VERSION
+; section "type"
+0000008: 04 ; string length
+0000009: 7479 7065 ; section id: "type"
+000000d: 00 ; section size (guess)
+000000e: 03 ; num types
+; type 0
+000000f: 40 ; function form
+0000010: 01 ; num params
+0000011: 01 ; param type
+0000012: 00 ; num results
+; type 1
+0000013: 40 ; function form
+0000014: 02 ; num params
+0000015: 01 ; param type
+0000016: 02 ; param type
+0000017: 00 ; num results
+; type 2
+0000018: 40 ; function form
+0000019: 00 ; num params
+000001a: 01 ; num results
+000001b: 04 ; result_type
+000000d: 0e ; FIXUP section size
+; section "function"
+000001c: 08 ; string length
+000001d: 6675 6e63 7469 6f6e ; section id: "function"
+0000025: 00 ; section size (guess)
+0000026: 03 ; num functions
+0000027: 00 ; function 0 signature index
+0000028: 01 ; function 1 signature index
+0000029: 02 ; function 2 signature index
+0000025: 04 ; FIXUP section size
+; section "table"
+000002a: 05 ; string length
+000002b: 7461 626c 65 ; section id: "table"
+0000030: 00 ; section size (guess)
+0000031: 04 ; num function table entries
+0000032: 00 ; function table entry
+0000033: 00 ; function table entry
+0000034: 01 ; function table entry
+0000035: 02 ; function table entry
+0000030: 05 ; FIXUP section size
+; section "code"
+0000036: 04 ; string length
+0000037: 636f 6465 ; section id: "code"
+000003b: 00 ; section size (guess)
+000003c: 03 ; num functions
; function body 0
-000005e: 00 ; func body size (guess)
-000005f: 00 ; local decl count
-000005e: 01 ; FIXUP func body size
+000003d: 00 ; func body size (guess)
+000003e: 00 ; local decl count
+000003d: 01 ; FIXUP func body size
; function body 1
-0000060: 00 ; func body size (guess)
-0000061: 00 ; local decl count
-0000060: 01 ; FIXUP func body size
+000003f: 00 ; func body size (guess)
+0000040: 00 ; local decl count
+000003f: 01 ; FIXUP func body size
; function body 2
-0000062: 00 ; func body size (guess)
-0000063: 00 ; local decl count
-0000064: 0c ; OPCODE_F64_CONST
-0000065: 0000 0000 0000 0000 ; f64 literal
-0000062: 0a ; FIXUP func body size
-000004c: 20 ; FIXUP section size
+0000041: 00 ; func body size (guess)
+0000042: 00 ; local decl count
+0000043: 12 ; OPCODE_F64_CONST
+0000044: 0000 0000 0000 0000 ; f64 literal
+0000041: 0a ; FIXUP func body size
+000003b: 10 ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 150a 7369 676e 6174
-0000010: 7572 6573 0301 0001 0200 0102 0004 1813
-0000020: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
-0000030: 7265 7303 0001 0214 0e66 756e 6374 696f
-0000040: 6e5f 7461 626c 6504 0000 0102 200f 6675
-0000050: 6e63 7469 6f6e 5f62 6f64 6965 7303 0100
-0000060: 0100 0a00 0c00 0000 0000 0000 00
+0000000: 0061 736d 0b00 0000 0474 7970 650e 0340
+0000010: 0101 0040 0201 0200 4000 0104 0866 756e
+0000020: 6374 696f 6e04 0300 0102 0574 6162 6c65
+0000030: 0504 0000 0102 0463 6f64 6510 0301 0001
+0000040: 000a 0012 0000 0000 0000 0000
;;; STDOUT ;;)
diff --git a/test/dump/unary.txt b/test/dump/unary.txt
index 264269e4..7543ed65 100644
--- a/test/dump/unary.txt
+++ b/test/dump/unary.txt
@@ -27,69 +27,67 @@
(f64.nearest (f64.const 0))))))))))
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
-0000004: 0a00 0000 ; WASM_BINARY_VERSION
-; section "signatures"
-0000008: 00 ; section size (guess)
-0000009: 0a ; string length
-000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
-0000014: 01 ; num signatures
-; signature 0
-0000015: 00 ; num params
-0000016: 00 ; result_type
-0000008: 0e ; FIXUP section size
-; section "function_signatures"
-0000017: 00 ; section size (guess)
-0000018: 13 ; string length
-0000019: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
-0000029: 7265 73 ; section id: "function_signatures"
-000002c: 01 ; num functions
-000002d: 00 ; function 0 signature index
-0000017: 16 ; FIXUP section size
-; section "function_bodies"
-000002e: 00 ; section size (guess)
-000002f: 0f ; string length
-0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
-000003f: 01 ; num functions
+0000004: 0b00 0000 ; WASM_BINARY_VERSION
+; section "type"
+0000008: 04 ; string length
+0000009: 7479 7065 ; section id: "type"
+000000d: 00 ; section size (guess)
+000000e: 01 ; num types
+; type 0
+000000f: 40 ; function form
+0000010: 00 ; num params
+0000011: 00 ; num results
+000000d: 04 ; FIXUP section size
+; section "function"
+0000012: 08 ; string length
+0000013: 6675 6e63 7469 6f6e ; section id: "function"
+000001b: 00 ; section size (guess)
+000001c: 01 ; num functions
+000001d: 00 ; function 0 signature index
+000001b: 02 ; FIXUP section size
+; section "code"
+000001e: 04 ; string length
+000001f: 636f 6465 ; section id: "code"
+0000023: 00 ; section size (guess)
+0000024: 01 ; num functions
; function body 0
-0000040: 00 ; func body size (guess)
-0000041: 00 ; local decl count
-0000042: 5a ; OPCODE_I32_EQZ
-0000043: 57 ; OPCODE_I32_CLZ
-0000044: 58 ; OPCODE_I32_CTZ
-0000045: 59 ; OPCODE_I32_POPCNT
-0000046: 0a ; OPCODE_I32_CONST
-0000047: 00 ; i32 literal
-0000048: 72 ; OPCODE_I64_CLZ
-0000049: 73 ; OPCODE_I64_CTZ
-000004a: 74 ; OPCODE_I64_POPCNT
-000004b: 0b ; OPCODE_I64_CONST
-000004c: 00 ; i64 literal
-000004d: 7c ; OPCODE_F32_NEG
-000004e: 7b ; OPCODE_F32_ABS
-000004f: 82 ; OPCODE_F32_SQRT
-0000050: 7e ; OPCODE_F32_CEIL
-0000051: 7f ; OPCODE_F32_FLOOR
-0000052: 80 ; OPCODE_F32_TRUNC
-0000053: 81 ; OPCODE_F32_NEAREST
-0000054: 0d ; OPCODE_F32_CONST
-0000055: 0000 0000 ; f32 literal
-0000059: 90 ; OPCODE_F64_NEG
-000005a: 8f ; OPCODE_F64_ABS
-000005b: 96 ; OPCODE_F64_SQRT
-000005c: 92 ; OPCODE_F64_CEIL
-000005d: 93 ; OPCODE_F64_FLOOR
-000005e: 94 ; OPCODE_F64_TRUNC
-000005f: 95 ; OPCODE_F64_NEAREST
-0000060: 0c ; OPCODE_F64_CONST
-0000061: 0000 0000 0000 0000 ; f64 literal
-0000040: 28 ; FIXUP func body size
-000002e: 3a ; FIXUP section size
+0000025: 00 ; func body size (guess)
+0000026: 00 ; local decl count
+0000027: 10 ; OPCODE_I32_CONST
+0000028: 00 ; i32 literal
+0000029: 59 ; OPCODE_I32_POPCNT
+000002a: 58 ; OPCODE_I32_CTZ
+000002b: 57 ; OPCODE_I32_CLZ
+000002c: 5a ; OPCODE_I32_EQZ
+000002d: 11 ; OPCODE_I64_CONST
+000002e: 00 ; i64 literal
+000002f: 74 ; OPCODE_I64_POPCNT
+0000030: 73 ; OPCODE_I64_CTZ
+0000031: 72 ; OPCODE_I64_CLZ
+0000032: 13 ; OPCODE_F32_CONST
+0000033: 0000 0000 ; f32 literal
+0000037: 81 ; OPCODE_F32_NEAREST
+0000038: 80 ; OPCODE_F32_TRUNC
+0000039: 7f ; OPCODE_F32_FLOOR
+000003a: 7e ; OPCODE_F32_CEIL
+000003b: 82 ; OPCODE_F32_SQRT
+000003c: 7b ; OPCODE_F32_ABS
+000003d: 7c ; OPCODE_F32_NEG
+000003e: 12 ; OPCODE_F64_CONST
+000003f: 0000 0000 0000 0000 ; f64 literal
+0000047: 95 ; OPCODE_F64_NEAREST
+0000048: 94 ; OPCODE_F64_TRUNC
+0000049: 93 ; OPCODE_F64_FLOOR
+000004a: 92 ; OPCODE_F64_CEIL
+000004b: 96 ; OPCODE_F64_SQRT
+000004c: 8f ; OPCODE_F64_ABS
+000004d: 90 ; OPCODE_F64_NEG
+0000025: 28 ; FIXUP func body size
+0000023: 2a ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0e0a 7369 676e 6174
-0000010: 7572 6573 0100 0016 1366 756e 6374 696f
-0000020: 6e5f 7369 676e 6174 7572 6573 0100 3a0f
-0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 7301
-0000040: 2800 5a57 5859 0a00 7273 740b 007c 7b82
-0000050: 7e7f 8081 0d00 0000 0090 8f96 9293 9495
-0000060: 0c00 0000 0000 0000 00
+0000000: 0061 736d 0b00 0000 0474 7970 6504 0140
+0000010: 0000 0866 756e 6374 696f 6e02 0100 0463
+0000020: 6f64 652a 0128 0010 0059 5857 5a11 0074
+0000030: 7372 1300 0000 0081 807f 7e82 7b7c 1200
+0000040: 0000 0000 0000 0095 9493 9296 8f90
;;; STDOUT ;;)
diff --git a/test/dump/unreachable.txt b/test/dump/unreachable.txt
index 48f9c71e..34065f9c 100644
--- a/test/dump/unreachable.txt
+++ b/test/dump/unreachable.txt
@@ -4,39 +4,37 @@
(unreachable)))
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
-0000004: 0a00 0000 ; WASM_BINARY_VERSION
-; section "signatures"
-0000008: 00 ; section size (guess)
-0000009: 0a ; string length
-000000a: 7369 676e 6174 7572 6573 ; section id: "signatures"
-0000014: 01 ; num signatures
-; signature 0
-0000015: 00 ; num params
-0000016: 00 ; result_type
-0000008: 0e ; FIXUP section size
-; section "function_signatures"
-0000017: 00 ; section size (guess)
-0000018: 13 ; string length
-0000019: 6675 6e63 7469 6f6e 5f73 6967 6e61 7475
-0000029: 7265 73 ; section id: "function_signatures"
-000002c: 01 ; num functions
-000002d: 00 ; function 0 signature index
-0000017: 16 ; FIXUP section size
-; section "function_bodies"
-000002e: 00 ; section size (guess)
-000002f: 0f ; string length
-0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 73 ; section id: "function_bodies"
-000003f: 01 ; num functions
+0000004: 0b00 0000 ; WASM_BINARY_VERSION
+; section "type"
+0000008: 04 ; string length
+0000009: 7479 7065 ; section id: "type"
+000000d: 00 ; section size (guess)
+000000e: 01 ; num types
+; type 0
+000000f: 40 ; function form
+0000010: 00 ; num params
+0000011: 00 ; num results
+000000d: 04 ; FIXUP section size
+; section "function"
+0000012: 08 ; string length
+0000013: 6675 6e63 7469 6f6e ; section id: "function"
+000001b: 00 ; section size (guess)
+000001c: 01 ; num functions
+000001d: 00 ; function 0 signature index
+000001b: 02 ; FIXUP section size
+; section "code"
+000001e: 04 ; string length
+000001f: 636f 6465 ; section id: "code"
+0000023: 00 ; section size (guess)
+0000024: 01 ; num functions
; function body 0
-0000040: 00 ; func body size (guess)
-0000041: 00 ; local decl count
-0000042: 15 ; OPCODE_UNREACHABLE
-0000040: 02 ; FIXUP func body size
-000002e: 14 ; FIXUP section size
+0000025: 00 ; func body size (guess)
+0000026: 00 ; local decl count
+0000027: 0a ; OPCODE_UNREACHABLE
+0000025: 02 ; FIXUP func body size
+0000023: 04 ; FIXUP section size
;; dump
-0000000: 0061 736d 0a00 0000 0e0a 7369 676e 6174
-0000010: 7572 6573 0100 0016 1366 756e 6374 696f
-0000020: 6e5f 7369 676e 6174 7572 6573 0100 140f
-0000030: 6675 6e63 7469 6f6e 5f62 6f64 6965 7301
-0000040: 0200 15
+0000000: 0061 736d 0b00 0000 0474 7970 6504 0140
+0000010: 0000 0866 756e 6374 696f 6e02 0100 0463
+0000020: 6f64 6504 0102 000a
;;; STDOUT ;;)