diff options
46 files changed, 1151 insertions, 1207 deletions
diff --git a/src/wasm-binary-writer.c b/src/wasm-binary-writer.c index 6a9d1ec5..9eec0038 100644 --- a/src/wasm-binary-writer.c +++ b/src/wasm-binary-writer.c @@ -1075,8 +1075,7 @@ static void write_module(WasmWriteContext* ctx, WasmModule* module) { remap_locals(ctx, func); int is_exported = wasm_func_is_exported(module, func); - /* TODO(binji): remove? */ - int has_name = 1; /* is_exported */ + int has_name = is_exported; int has_locals = func->locals.types.size > 0; uint8_t flags = 0; if (has_name) diff --git a/test/dump/binary.txt b/test/dump/binary.txt index 9659530f..e18c4994 100644 --- a/test/dump/binary.txt +++ b/test/dump/binary.txt @@ -100,23 +100,26 @@ 0000004: 02 ; WASM_SECTION_FUNCTIONS 0000005: 01 ; num functions ; function 0 -0000006: 01 ; func flags +0000006: 00 ; func flags 0000007: 0000 ; func signature index -0000009: 0000 0000 ; func name offset -000000d: 0000 ; func body size -000000f: 40 ; OPCODE_I32_ADD -0000010: 41 ; OPCODE_I32_SUB -0000011: 42 ; OPCODE_I32_MUL -0000012: 43 ; OPCODE_I32_DIV_S -0000013: 44 ; OPCODE_I32_DIV_U -0000014: 45 ; OPCODE_I32_REM_S -0000015: 46 ; OPCODE_I32_REM_U -0000016: 47 ; OPCODE_I32_AND -0000017: 48 ; OPCODE_I32_OR -0000018: 49 ; OPCODE_I32_XOR -0000019: 4a ; OPCODE_I32_SHL -000001a: 4b ; OPCODE_I32_SHR_U -000001b: 4c ; OPCODE_I32_SHR_S +0000009: 0000 ; func body size +000000b: 40 ; OPCODE_I32_ADD +000000c: 41 ; OPCODE_I32_SUB +000000d: 42 ; OPCODE_I32_MUL +000000e: 43 ; OPCODE_I32_DIV_S +000000f: 44 ; OPCODE_I32_DIV_U +0000010: 45 ; OPCODE_I32_REM_S +0000011: 46 ; OPCODE_I32_REM_U +0000012: 47 ; OPCODE_I32_AND +0000013: 48 ; OPCODE_I32_OR +0000014: 49 ; OPCODE_I32_XOR +0000015: 4a ; OPCODE_I32_SHL +0000016: 4b ; OPCODE_I32_SHR_U +0000017: 4c ; OPCODE_I32_SHR_S +0000018: 09 ; OPCODE_I8_CONST +0000019: 00 ; u8 literal +000001a: 09 ; OPCODE_I8_CONST +000001b: 00 ; u8 literal 000001c: 09 ; OPCODE_I8_CONST 000001d: 00 ; u8 literal 000001e: 09 ; OPCODE_I8_CONST @@ -141,97 +144,93 @@ 0000031: 00 ; u8 literal 0000032: 09 ; OPCODE_I8_CONST 0000033: 00 ; u8 literal -0000034: 09 ; OPCODE_I8_CONST -0000035: 00 ; u8 literal -0000036: 09 ; OPCODE_I8_CONST -0000037: 00 ; u8 literal -0000038: 5b ; OPCODE_I64_ADD -0000039: 5c ; OPCODE_I64_SUB -000003a: 5d ; OPCODE_I64_MUL -000003b: 5e ; OPCODE_I64_DIV_S -000003c: 5f ; OPCODE_I64_DIV_U -000003d: 60 ; OPCODE_I64_REM_S -000003e: 61 ; OPCODE_I64_REM_U -000003f: 62 ; OPCODE_I64_AND -0000040: 63 ; OPCODE_I64_OR -0000041: 64 ; OPCODE_I64_XOR -0000042: 65 ; OPCODE_I64_SHL -0000043: 66 ; OPCODE_I64_SHR_U -0000044: 67 ; OPCODE_I64_SHR_S -0000045: 0b ; OPCODE_I64_CONST -0000046: 0000 0000 0000 0000 ; u64 literal -000004e: 0b ; OPCODE_I64_CONST -000004f: 0000 0000 0000 0000 ; u64 literal -0000057: 0b ; OPCODE_I64_CONST -0000058: 0000 0000 0000 0000 ; u64 literal -0000060: 0b ; OPCODE_I64_CONST -0000061: 0000 0000 0000 0000 ; u64 literal -0000069: 0b ; OPCODE_I64_CONST -000006a: 0000 0000 0000 0000 ; u64 literal -0000072: 0b ; OPCODE_I64_CONST -0000073: 0000 0000 0000 0000 ; u64 literal -000007b: 0b ; OPCODE_I64_CONST -000007c: 0000 0000 0000 0000 ; u64 literal -0000084: 0b ; OPCODE_I64_CONST -0000085: 0000 0000 0000 0000 ; u64 literal -000008d: 0b ; OPCODE_I64_CONST -000008e: 0000 0000 0000 0000 ; u64 literal -0000096: 0b ; OPCODE_I64_CONST -0000097: 0000 0000 0000 0000 ; u64 literal -000009f: 0b ; OPCODE_I64_CONST -00000a0: 0000 0000 0000 0000 ; u64 literal -00000a8: 0b ; OPCODE_I64_CONST -00000a9: 0000 0000 0000 0000 ; u64 literal -00000b1: 0b ; OPCODE_I64_CONST -00000b2: 0000 0000 0000 0000 ; u64 literal -00000ba: 0b ; OPCODE_I64_CONST -00000bb: 0000 0000 0000 0000 ; u64 literal -00000c3: 75 ; OPCODE_F32_ADD -00000c4: 76 ; OPCODE_F32_SUB -00000c5: 77 ; OPCODE_F32_MUL -00000c6: 78 ; OPCODE_F32_DIV -00000c7: 79 ; OPCODE_F32_MIN -00000c8: 7a ; OPCODE_F32_MAX -00000c9: 7d ; OPCODE_F32_COPYSIGN -00000ca: 0d ; OPCODE_F32_CONST -00000cb: 0000 0000 ; f32 literal -00000cf: 0d ; OPCODE_F32_CONST -00000d0: 0000 0000 ; f32 literal -00000d4: 0d ; OPCODE_F32_CONST -00000d5: 0000 0000 ; f32 literal -00000d9: 0d ; OPCODE_F32_CONST -00000da: 0000 0000 ; f32 literal -00000de: 0d ; OPCODE_F32_CONST -00000df: 0000 0000 ; f32 literal -00000e3: 0d ; OPCODE_F32_CONST -00000e4: 0000 0000 ; f32 literal -00000e8: 0d ; OPCODE_F32_CONST -00000e9: 0000 0000 ; f32 literal -00000ed: 0d ; OPCODE_F32_CONST -00000ee: 0000 0000 ; f32 literal -00000f2: 89 ; OPCODE_F64_ADD -00000f3: 8a ; OPCODE_F64_SUB -00000f4: 8b ; OPCODE_F64_MUL -00000f5: 8c ; OPCODE_F64_DIV -00000f6: 8d ; OPCODE_F64_MIN -00000f7: 8e ; OPCODE_F64_MAX -00000f8: 91 ; OPCODE_F64_COPYSIGN -00000f9: 0c ; OPCODE_F64_CONST -00000fa: 0000 0000 0000 0000 ; f64 literal -0000102: 0c ; OPCODE_F64_CONST -0000103: 0000 0000 0000 0000 ; f64 literal -000010b: 0c ; OPCODE_F64_CONST -000010c: 0000 0000 0000 0000 ; f64 literal -0000114: 0c ; OPCODE_F64_CONST -0000115: 0000 0000 0000 0000 ; f64 literal -000011d: 0c ; OPCODE_F64_CONST -000011e: 0000 0000 0000 0000 ; f64 literal -0000126: 0c ; OPCODE_F64_CONST -0000127: 0000 0000 0000 0000 ; f64 literal -000012f: 0c ; OPCODE_F64_CONST -0000130: 0000 0000 0000 0000 ; f64 literal -0000138: 0c ; OPCODE_F64_CONST -0000139: 0000 0000 0000 0000 ; f64 literal -000000d: 3201 ; FIXUP func body size -0000141: 06 ; WASM_SECTION_END +0000034: 5b ; OPCODE_I64_ADD +0000035: 5c ; OPCODE_I64_SUB +0000036: 5d ; OPCODE_I64_MUL +0000037: 5e ; OPCODE_I64_DIV_S +0000038: 5f ; OPCODE_I64_DIV_U +0000039: 60 ; OPCODE_I64_REM_S +000003a: 61 ; OPCODE_I64_REM_U +000003b: 62 ; OPCODE_I64_AND +000003c: 63 ; OPCODE_I64_OR +000003d: 64 ; OPCODE_I64_XOR +000003e: 65 ; OPCODE_I64_SHL +000003f: 66 ; OPCODE_I64_SHR_U +0000040: 67 ; OPCODE_I64_SHR_S +0000041: 0b ; OPCODE_I64_CONST +0000042: 0000 0000 0000 0000 ; u64 literal +000004a: 0b ; OPCODE_I64_CONST +000004b: 0000 0000 0000 0000 ; u64 literal +0000053: 0b ; OPCODE_I64_CONST +0000054: 0000 0000 0000 0000 ; u64 literal +000005c: 0b ; OPCODE_I64_CONST +000005d: 0000 0000 0000 0000 ; u64 literal +0000065: 0b ; OPCODE_I64_CONST +0000066: 0000 0000 0000 0000 ; u64 literal +000006e: 0b ; OPCODE_I64_CONST +000006f: 0000 0000 0000 0000 ; u64 literal +0000077: 0b ; OPCODE_I64_CONST +0000078: 0000 0000 0000 0000 ; u64 literal +0000080: 0b ; OPCODE_I64_CONST +0000081: 0000 0000 0000 0000 ; u64 literal +0000089: 0b ; OPCODE_I64_CONST +000008a: 0000 0000 0000 0000 ; u64 literal +0000092: 0b ; OPCODE_I64_CONST +0000093: 0000 0000 0000 0000 ; u64 literal +000009b: 0b ; OPCODE_I64_CONST +000009c: 0000 0000 0000 0000 ; u64 literal +00000a4: 0b ; OPCODE_I64_CONST +00000a5: 0000 0000 0000 0000 ; u64 literal +00000ad: 0b ; OPCODE_I64_CONST +00000ae: 0000 0000 0000 0000 ; u64 literal +00000b6: 0b ; OPCODE_I64_CONST +00000b7: 0000 0000 0000 0000 ; u64 literal +00000bf: 75 ; OPCODE_F32_ADD +00000c0: 76 ; OPCODE_F32_SUB +00000c1: 77 ; OPCODE_F32_MUL +00000c2: 78 ; OPCODE_F32_DIV +00000c3: 79 ; OPCODE_F32_MIN +00000c4: 7a ; OPCODE_F32_MAX +00000c5: 7d ; OPCODE_F32_COPYSIGN +00000c6: 0d ; OPCODE_F32_CONST +00000c7: 0000 0000 ; f32 literal +00000cb: 0d ; OPCODE_F32_CONST +00000cc: 0000 0000 ; f32 literal +00000d0: 0d ; OPCODE_F32_CONST +00000d1: 0000 0000 ; f32 literal +00000d5: 0d ; OPCODE_F32_CONST +00000d6: 0000 0000 ; f32 literal +00000da: 0d ; OPCODE_F32_CONST +00000db: 0000 0000 ; f32 literal +00000df: 0d ; OPCODE_F32_CONST +00000e0: 0000 0000 ; f32 literal +00000e4: 0d ; OPCODE_F32_CONST +00000e5: 0000 0000 ; f32 literal +00000e9: 0d ; OPCODE_F32_CONST +00000ea: 0000 0000 ; f32 literal +00000ee: 89 ; OPCODE_F64_ADD +00000ef: 8a ; OPCODE_F64_SUB +00000f0: 8b ; OPCODE_F64_MUL +00000f1: 8c ; OPCODE_F64_DIV +00000f2: 8d ; OPCODE_F64_MIN +00000f3: 8e ; OPCODE_F64_MAX +00000f4: 91 ; OPCODE_F64_COPYSIGN +00000f5: 0c ; OPCODE_F64_CONST +00000f6: 0000 0000 0000 0000 ; f64 literal +00000fe: 0c ; OPCODE_F64_CONST +00000ff: 0000 0000 0000 0000 ; f64 literal +0000107: 0c ; OPCODE_F64_CONST +0000108: 0000 0000 0000 0000 ; f64 literal +0000110: 0c ; OPCODE_F64_CONST +0000111: 0000 0000 0000 0000 ; f64 literal +0000119: 0c ; OPCODE_F64_CONST +000011a: 0000 0000 0000 0000 ; f64 literal +0000122: 0c ; OPCODE_F64_CONST +0000123: 0000 0000 0000 0000 ; f64 literal +000012b: 0c ; OPCODE_F64_CONST +000012c: 0000 0000 0000 0000 ; f64 literal +0000134: 0c ; OPCODE_F64_CONST +0000135: 0000 0000 0000 0000 ; f64 literal +0000009: 3201 ; FIXUP func body size +000013d: 06 ; WASM_SECTION_END ;;; STDOUT ;;) diff --git a/test/dump/block.txt b/test/dump/block.txt index 08557a87..475f069a 100644 --- a/test/dump/block.txt +++ b/test/dump/block.txt @@ -21,25 +21,23 @@ 0000006: 02 ; WASM_SECTION_FUNCTIONS 0000007: 02 ; num functions ; function 0 -0000008: 01 ; func flags +0000008: 00 ; func flags 0000009: 0000 ; func signature index -000000b: 0000 0000 ; func name offset -000000f: 0000 ; func body size -0000011: 01 ; OPCODE_BLOCK -0000012: 03 ; num expressions -0000013: 00 ; OPCODE_NOP -0000014: 00 ; OPCODE_NOP -0000015: 00 ; OPCODE_NOP -000000f: 0500 ; FIXUP func body size +000000b: 0000 ; func body size +000000d: 01 ; OPCODE_BLOCK +000000e: 03 ; num expressions +000000f: 00 ; OPCODE_NOP +0000010: 00 ; OPCODE_NOP +0000011: 00 ; OPCODE_NOP +000000b: 0500 ; FIXUP func body size ; function 1 -0000016: 01 ; func flags -0000017: 0100 ; func signature index -0000019: 0000 0000 ; func name offset -000001d: 0000 ; func body size -000001f: 01 ; OPCODE_BLOCK -0000020: 01 ; num expressions -0000021: 09 ; OPCODE_I8_CONST -0000022: 01 ; u8 literal -000001d: 0400 ; FIXUP func body size -0000023: 06 ; WASM_SECTION_END +0000012: 00 ; func flags +0000013: 0100 ; func signature index +0000015: 0000 ; func body size +0000017: 01 ; OPCODE_BLOCK +0000018: 01 ; num expressions +0000019: 09 ; OPCODE_I8_CONST +000001a: 01 ; u8 literal +0000015: 0400 ; FIXUP func body size +000001b: 06 ; WASM_SECTION_END ;;; STDOUT ;;) diff --git a/test/dump/break-block-named.txt b/test/dump/break-block-named.txt index 386b4090..1bbcc142 100644 --- a/test/dump/break-block-named.txt +++ b/test/dump/break-block-named.txt @@ -17,26 +17,25 @@ 0000004: 02 ; WASM_SECTION_FUNCTIONS 0000005: 01 ; num functions ; function 0 -0000006: 01 ; func flags +0000006: 00 ; func flags 0000007: 0000 ; func signature index -0000009: 0000 0000 ; func name offset -000000d: 0000 ; func body size +0000009: 0000 ; func body size +000000b: 01 ; OPCODE_BLOCK +000000c: 01 ; num expressions +000000d: 02 ; OPCODE_LOOP +000000e: 01 ; num expressions 000000f: 01 ; OPCODE_BLOCK -0000010: 01 ; num expressions -0000011: 02 ; OPCODE_LOOP -0000012: 01 ; num expressions +0000010: 02 ; num expressions +0000011: 09 ; OPCODE_I8_CONST +0000012: 00 ; u8 literal 0000013: 01 ; OPCODE_BLOCK 0000014: 02 ; num expressions -0000015: 09 ; OPCODE_I8_CONST -0000016: 00 ; u8 literal -0000017: 01 ; OPCODE_BLOCK -0000018: 02 ; num expressions -0000019: 06 ; OPCODE_BR -000001a: 00 ; break depth -000001b: 00 ; OPCODE_NOP -000001c: 06 ; OPCODE_BR -000001d: 04 ; break depth -000001e: 00 ; OPCODE_NOP -000000d: 1000 ; FIXUP func body size -000001f: 06 ; WASM_SECTION_END +0000015: 06 ; OPCODE_BR +0000016: 00 ; break depth +0000017: 00 ; OPCODE_NOP +0000018: 06 ; OPCODE_BR +0000019: 04 ; break depth +000001a: 00 ; OPCODE_NOP +0000009: 1000 ; FIXUP func body size +000001b: 06 ; WASM_SECTION_END ;;; STDOUT ;;) diff --git a/test/dump/break-block.txt b/test/dump/break-block.txt index 27aa0a51..070eb81c 100644 --- a/test/dump/break-block.txt +++ b/test/dump/break-block.txt @@ -19,32 +19,31 @@ 0000004: 02 ; WASM_SECTION_FUNCTIONS 0000005: 01 ; num functions ; function 0 -0000006: 01 ; func flags +0000006: 00 ; func flags 0000007: 0000 ; func signature index -0000009: 0000 0000 ; func name offset -000000d: 0000 ; func body size +0000009: 0000 ; func body size +000000b: 01 ; OPCODE_BLOCK +000000c: 01 ; num expressions +000000d: 02 ; OPCODE_LOOP +000000e: 01 ; num expressions 000000f: 01 ; OPCODE_BLOCK -0000010: 01 ; num expressions -0000011: 02 ; OPCODE_LOOP -0000012: 01 ; num expressions +0000010: 02 ; num expressions +0000011: 09 ; OPCODE_I8_CONST +0000012: 00 ; u8 literal 0000013: 01 ; OPCODE_BLOCK -0000014: 02 ; num expressions -0000015: 09 ; OPCODE_I8_CONST -0000016: 00 ; u8 literal -0000017: 01 ; OPCODE_BLOCK -0000018: 04 ; num expressions -0000019: 06 ; OPCODE_BR -000001a: 00 ; break depth -000001b: 00 ; OPCODE_NOP -000001c: 06 ; OPCODE_BR -000001d: 00 ; break depth -000001e: 00 ; OPCODE_NOP -000001f: 06 ; OPCODE_BR -0000020: 02 ; break depth -0000021: 00 ; OPCODE_NOP -0000022: 06 ; OPCODE_BR -0000023: 04 ; break depth -0000024: 00 ; OPCODE_NOP -000000d: 1600 ; FIXUP func body size -0000025: 06 ; WASM_SECTION_END +0000014: 04 ; num expressions +0000015: 06 ; OPCODE_BR +0000016: 00 ; break depth +0000017: 00 ; OPCODE_NOP +0000018: 06 ; OPCODE_BR +0000019: 00 ; break depth +000001a: 00 ; OPCODE_NOP +000001b: 06 ; OPCODE_BR +000001c: 02 ; break depth +000001d: 00 ; OPCODE_NOP +000001e: 06 ; OPCODE_BR +000001f: 04 ; break depth +0000020: 00 ; OPCODE_NOP +0000009: 1600 ; FIXUP func body size +0000021: 06 ; WASM_SECTION_END ;;; STDOUT ;;) diff --git a/test/dump/break-label.txt b/test/dump/break-label.txt index 52904e5a..d9ba0d57 100644 --- a/test/dump/break-label.txt +++ b/test/dump/break-label.txt @@ -15,21 +15,20 @@ 0000004: 02 ; WASM_SECTION_FUNCTIONS 0000005: 01 ; num functions ; function 0 -0000006: 01 ; func flags +0000006: 00 ; func flags 0000007: 0000 ; func signature index -0000009: 0000 0000 ; func name offset -000000d: 0000 ; func body size -000000f: 01 ; OPCODE_BLOCK -0000010: 01 ; num expressions -0000011: 01 ; OPCODE_BLOCK -0000012: 02 ; num expressions -0000013: 00 ; OPCODE_NOP -0000014: 03 ; OPCODE_IF -0000015: 09 ; OPCODE_I8_CONST -0000016: 01 ; u8 literal -0000017: 06 ; OPCODE_BR -0000018: 01 ; break depth -0000019: 00 ; OPCODE_NOP -000000d: 0b00 ; FIXUP func body size -000001a: 06 ; WASM_SECTION_END +0000009: 0000 ; func body size +000000b: 01 ; OPCODE_BLOCK +000000c: 01 ; num expressions +000000d: 01 ; OPCODE_BLOCK +000000e: 02 ; num expressions +000000f: 00 ; OPCODE_NOP +0000010: 03 ; OPCODE_IF +0000011: 09 ; OPCODE_I8_CONST +0000012: 01 ; u8 literal +0000013: 06 ; OPCODE_BR +0000014: 01 ; break depth +0000015: 00 ; OPCODE_NOP +0000009: 0b00 ; FIXUP func body size +0000016: 06 ; WASM_SECTION_END ;;; STDOUT ;;) diff --git a/test/dump/break-loop-inner-expr.txt b/test/dump/break-loop-inner-expr.txt index 95baf698..8e2384c0 100644 --- a/test/dump/break-loop-inner-expr.txt +++ b/test/dump/break-loop-inner-expr.txt @@ -16,28 +16,27 @@ 0000004: 02 ; WASM_SECTION_FUNCTIONS 0000005: 01 ; num functions ; function 0 -0000006: 01 ; func flags +0000006: 00 ; func flags 0000007: 0000 ; func signature index -0000009: 0000 0000 ; func name offset -000000d: 0000 ; func body size -000000f: 02 ; OPCODE_LOOP -0000010: 03 ; num expressions -0000011: 03 ; OPCODE_IF +0000009: 0000 ; func body size +000000b: 02 ; OPCODE_LOOP +000000c: 03 ; num expressions +000000d: 03 ; OPCODE_IF +000000e: 09 ; OPCODE_I8_CONST +000000f: 01 ; u8 literal +0000010: 06 ; OPCODE_BR +0000011: 00 ; break depth 0000012: 09 ; OPCODE_I8_CONST -0000013: 01 ; u8 literal -0000014: 06 ; OPCODE_BR -0000015: 00 ; break depth -0000016: 09 ; OPCODE_I8_CONST -0000017: 02 ; u8 literal -0000018: 03 ; OPCODE_IF +0000013: 02 ; u8 literal +0000014: 03 ; OPCODE_IF +0000015: 09 ; OPCODE_I8_CONST +0000016: 03 ; u8 literal +0000017: 06 ; OPCODE_BR +0000018: 01 ; break depth 0000019: 09 ; OPCODE_I8_CONST -000001a: 03 ; u8 literal -000001b: 06 ; OPCODE_BR -000001c: 01 ; break depth -000001d: 09 ; OPCODE_I8_CONST -000001e: 04 ; u8 literal -000001f: 09 ; OPCODE_I8_CONST -0000020: 05 ; u8 literal -000000d: 1200 ; FIXUP func body size -0000021: 06 ; WASM_SECTION_END +000001a: 04 ; u8 literal +000001b: 09 ; OPCODE_I8_CONST +000001c: 05 ; u8 literal +0000009: 1200 ; FIXUP func body size +000001d: 06 ; WASM_SECTION_END ;;; STDOUT ;;) diff --git a/test/dump/break-loop-inner.txt b/test/dump/break-loop-inner.txt index 03d798fc..a12fe21b 100644 --- a/test/dump/break-loop-inner.txt +++ b/test/dump/break-loop-inner.txt @@ -15,24 +15,23 @@ 0000004: 02 ; WASM_SECTION_FUNCTIONS 0000005: 01 ; num functions ; function 0 -0000006: 01 ; func flags +0000006: 00 ; func flags 0000007: 0000 ; func signature index -0000009: 0000 0000 ; func name offset -000000d: 0000 ; func body size -000000f: 02 ; OPCODE_LOOP -0000010: 02 ; num expressions -0000011: 03 ; OPCODE_IF -0000012: 09 ; OPCODE_I8_CONST -0000013: 01 ; u8 literal -0000014: 06 ; OPCODE_BR -0000015: 01 ; break depth -0000016: 00 ; OPCODE_NOP -0000017: 03 ; OPCODE_IF -0000018: 09 ; OPCODE_I8_CONST -0000019: 02 ; u8 literal -000001a: 06 ; OPCODE_BR -000001b: 00 ; break depth -000001c: 00 ; OPCODE_NOP -000000d: 0e00 ; FIXUP func body size -000001d: 06 ; WASM_SECTION_END +0000009: 0000 ; func body size +000000b: 02 ; OPCODE_LOOP +000000c: 02 ; num expressions +000000d: 03 ; OPCODE_IF +000000e: 09 ; OPCODE_I8_CONST +000000f: 01 ; u8 literal +0000010: 06 ; OPCODE_BR +0000011: 01 ; break depth +0000012: 00 ; OPCODE_NOP +0000013: 03 ; OPCODE_IF +0000014: 09 ; OPCODE_I8_CONST +0000015: 02 ; u8 literal +0000016: 06 ; OPCODE_BR +0000017: 00 ; break depth +0000018: 00 ; OPCODE_NOP +0000009: 0e00 ; FIXUP func body size +0000019: 06 ; WASM_SECTION_END ;;; STDOUT ;;) diff --git a/test/dump/break-loop.txt b/test/dump/break-loop.txt index bd9074a8..7dd63b53 100644 --- a/test/dump/break-loop.txt +++ b/test/dump/break-loop.txt @@ -13,18 +13,17 @@ 0000004: 02 ; WASM_SECTION_FUNCTIONS 0000005: 01 ; num functions ; function 0 -0000006: 01 ; func flags +0000006: 00 ; func flags 0000007: 0000 ; func signature index -0000009: 0000 0000 ; func name offset -000000d: 0000 ; func body size -000000f: 02 ; OPCODE_LOOP -0000010: 01 ; num expressions -0000011: 03 ; OPCODE_IF -0000012: 09 ; OPCODE_I8_CONST -0000013: 01 ; u8 literal -0000014: 06 ; OPCODE_BR -0000015: 00 ; break depth -0000016: 00 ; OPCODE_NOP -000000d: 0800 ; FIXUP func body size -0000017: 06 ; WASM_SECTION_END +0000009: 0000 ; func body size +000000b: 02 ; OPCODE_LOOP +000000c: 01 ; num expressions +000000d: 03 ; OPCODE_IF +000000e: 09 ; OPCODE_I8_CONST +000000f: 01 ; u8 literal +0000010: 06 ; OPCODE_BR +0000011: 00 ; break depth +0000012: 00 ; OPCODE_NOP +0000009: 0800 ; FIXUP func body size +0000013: 06 ; WASM_SECTION_END ;;; STDOUT ;;) diff --git a/test/dump/brif-loop.txt b/test/dump/brif-loop.txt index b9405983..cdfd2ec7 100644 --- a/test/dump/brif-loop.txt +++ b/test/dump/brif-loop.txt @@ -12,17 +12,16 @@ 0000004: 02 ; WASM_SECTION_FUNCTIONS 0000005: 01 ; num functions ; function 0 -0000006: 01 ; func flags +0000006: 00 ; func flags 0000007: 0000 ; func signature index -0000009: 0000 0000 ; func name offset -000000d: 0000 ; func body size -000000f: 02 ; OPCODE_LOOP -0000010: 01 ; num expressions -0000011: 07 ; OPCODE_BR_IF -0000012: 00 ; break depth -0000013: 09 ; OPCODE_I8_CONST -0000014: 00 ; u8 literal -0000015: 00 ; OPCODE_NOP -000000d: 0700 ; FIXUP func body size -0000016: 06 ; WASM_SECTION_END +0000009: 0000 ; func body size +000000b: 02 ; OPCODE_LOOP +000000c: 01 ; num expressions +000000d: 07 ; OPCODE_BR_IF +000000e: 00 ; break depth +000000f: 09 ; OPCODE_I8_CONST +0000010: 00 ; u8 literal +0000011: 00 ; OPCODE_NOP +0000009: 0700 ; FIXUP func body size +0000012: 06 ; WASM_SECTION_END ;;; STDOUT ;;) diff --git a/test/dump/brif.txt b/test/dump/brif.txt index 0c80f202..a8126c98 100644 --- a/test/dump/brif.txt +++ b/test/dump/brif.txt @@ -12,17 +12,16 @@ 0000004: 02 ; WASM_SECTION_FUNCTIONS 0000005: 01 ; num functions ; function 0 -0000006: 01 ; func flags +0000006: 00 ; func flags 0000007: 0000 ; func signature index -0000009: 0000 0000 ; func name offset -000000d: 0000 ; func body size -000000f: 01 ; OPCODE_BLOCK -0000010: 01 ; num expressions -0000011: 07 ; OPCODE_BR_IF -0000012: 00 ; break depth -0000013: 09 ; OPCODE_I8_CONST -0000014: 01 ; u8 literal -0000015: 00 ; OPCODE_NOP -000000d: 0700 ; FIXUP func body size -0000016: 06 ; WASM_SECTION_END +0000009: 0000 ; func body size +000000b: 01 ; OPCODE_BLOCK +000000c: 01 ; num expressions +000000d: 07 ; OPCODE_BR_IF +000000e: 00 ; break depth +000000f: 09 ; OPCODE_I8_CONST +0000010: 01 ; u8 literal +0000011: 00 ; OPCODE_NOP +0000009: 0700 ; FIXUP func body size +0000012: 06 ; WASM_SECTION_END ;;; STDOUT ;;) diff --git a/test/dump/call.txt b/test/dump/call.txt index 5e26c106..aead56fa 100644 --- a/test/dump/call.txt +++ b/test/dump/call.txt @@ -12,14 +12,13 @@ 0000005: 02 ; WASM_SECTION_FUNCTIONS 0000006: 01 ; num functions ; function 0 -0000007: 01 ; func flags +0000007: 00 ; func flags 0000008: 0000 ; func signature index -000000a: 0000 0000 ; func name offset -000000e: 0000 ; func body size -0000010: 12 ; OPCODE_CALL_FUNCTION -0000011: 00 ; func index -0000012: 09 ; OPCODE_I8_CONST -0000013: 01 ; u8 literal -000000e: 0400 ; FIXUP func body size -0000014: 06 ; WASM_SECTION_END +000000a: 0000 ; func body size +000000c: 12 ; OPCODE_CALL_FUNCTION +000000d: 00 ; func index +000000e: 09 ; OPCODE_I8_CONST +000000f: 01 ; u8 literal +000000a: 0400 ; FIXUP func body size +0000010: 06 ; WASM_SECTION_END ;;; STDOUT ;;) diff --git a/test/dump/callimport.txt b/test/dump/callimport.txt index 96186251..c67775e9 100644 --- a/test/dump/callimport.txt +++ b/test/dump/callimport.txt @@ -27,22 +27,21 @@ 000000b: 0000 ; import signature index 000000d: 0000 0000 ; import name offset ; function 0 -0000011: 01 ; func flags +0000011: 00 ; func flags 0000012: 0100 ; func signature index -0000014: 0000 0000 ; func name offset -0000018: 0000 ; func body size -000001a: 12 ; OPCODE_CALL_FUNCTION -000001b: 00 ; import index -000001c: 09 ; OPCODE_I8_CONST -000001d: 01 ; u8 literal -000001e: 0d ; OPCODE_F32_CONST -000001f: 0000 0040 ; f32 literal -0000023: 12 ; OPCODE_CALL_FUNCTION -0000024: 01 ; func index -0000018: 0b00 ; FIXUP func body size -0000025: 06 ; WASM_SECTION_END +0000014: 0000 ; func body size +0000016: 12 ; OPCODE_CALL_FUNCTION +0000017: 00 ; import index +0000018: 09 ; OPCODE_I8_CONST +0000019: 01 ; u8 literal +000001a: 0d ; OPCODE_F32_CONST +000001b: 0000 0040 ; f32 literal +000001f: 12 ; OPCODE_CALL_FUNCTION +0000020: 01 ; func index +0000014: 0b00 ; FIXUP func body size +0000021: 06 ; WASM_SECTION_END ; import 0 -000000d: 2600 0000 ; FIXUP import name offset -0000026: 6261 72 ; import name -0000029: 00 ; \0 +000000d: 2200 0000 ; FIXUP import name offset +0000022: 6261 72 ; import name +0000025: 00 ; \0 ;;; STDOUT ;;) diff --git a/test/dump/callindirect.txt b/test/dump/callindirect.txt index c0bf93ce..3f48ba0f 100644 --- a/test/dump/callindirect.txt +++ b/test/dump/callindirect.txt @@ -14,19 +14,18 @@ 0000005: 02 ; WASM_SECTION_FUNCTIONS 0000006: 01 ; num functions ; function 0 -0000007: 01 ; func flags +0000007: 00 ; func flags 0000008: 0000 ; func signature index -000000a: 0000 0000 ; func name offset -000000e: 0000 ; func body size -0000010: 13 ; OPCODE_CALL_INDIRECT -0000011: 00 ; signature index -0000012: 09 ; OPCODE_I8_CONST -0000013: 00 ; u8 literal -0000014: 09 ; OPCODE_I8_CONST -0000015: 00 ; u8 literal -000000e: 0600 ; FIXUP func body size -0000016: 05 ; WASM_SECTION_FUNCTION_TABLE -0000017: 01 ; num function table entries -0000018: 0000 ; function table entry -000001a: 06 ; WASM_SECTION_END +000000a: 0000 ; func body size +000000c: 13 ; OPCODE_CALL_INDIRECT +000000d: 00 ; signature index +000000e: 09 ; OPCODE_I8_CONST +000000f: 00 ; u8 literal +0000010: 09 ; OPCODE_I8_CONST +0000011: 00 ; u8 literal +000000a: 0600 ; FIXUP func body size +0000012: 05 ; WASM_SECTION_FUNCTION_TABLE +0000013: 01 ; num function table entries +0000014: 0000 ; function table entry +0000016: 06 ; WASM_SECTION_END ;;; STDOUT ;;) diff --git a/test/dump/cast.txt b/test/dump/cast.txt index cb582949..2bfd7899 100644 --- a/test/dump/cast.txt +++ b/test/dump/cast.txt @@ -15,22 +15,21 @@ 0000004: 02 ; WASM_SECTION_FUNCTIONS 0000005: 01 ; num functions ; function 0 -0000006: 01 ; func flags +0000006: 00 ; func flags 0000007: 0000 ; func signature index -0000009: 0000 0000 ; func name offset -000000d: 0000 ; func body size -000000f: ad ; OPCODE_F32_REINTERPRET_I32 -0000010: 09 ; OPCODE_I8_CONST -0000011: 00 ; u8 literal -0000012: b4 ; OPCODE_I32_REINTERPRET_F32 -0000013: 0d ; OPCODE_F32_CONST -0000014: 0000 0000 ; f32 literal -0000018: b3 ; OPCODE_F64_REINTERPRET_I64 -0000019: 0b ; OPCODE_I64_CONST -000001a: 0000 0000 0000 0000 ; u64 literal -0000022: b5 ; OPCODE_I64_REINTERPRET_F64 -0000023: 0c ; OPCODE_F64_CONST -0000024: 0000 0000 0000 0000 ; f64 literal -000000d: 1d00 ; FIXUP func body size -000002c: 06 ; WASM_SECTION_END +0000009: 0000 ; func body size +000000b: ad ; OPCODE_F32_REINTERPRET_I32 +000000c: 09 ; OPCODE_I8_CONST +000000d: 00 ; u8 literal +000000e: b4 ; OPCODE_I32_REINTERPRET_F32 +000000f: 0d ; OPCODE_F32_CONST +0000010: 0000 0000 ; f32 literal +0000014: b3 ; OPCODE_F64_REINTERPRET_I64 +0000015: 0b ; OPCODE_I64_CONST +0000016: 0000 0000 0000 0000 ; u64 literal +000001e: b5 ; OPCODE_I64_REINTERPRET_F64 +000001f: 0c ; OPCODE_F64_CONST +0000020: 0000 0000 0000 0000 ; f64 literal +0000009: 1d00 ; FIXUP func body size +0000028: 06 ; WASM_SECTION_END ;;; STDOUT ;;) diff --git a/test/dump/compare.txt b/test/dump/compare.txt index 5ed8fd3b..1aac5f32 100644 --- a/test/dump/compare.txt +++ b/test/dump/compare.txt @@ -58,20 +58,23 @@ 0000004: 02 ; WASM_SECTION_FUNCTIONS 0000005: 01 ; num functions ; function 0 -0000006: 01 ; func flags +0000006: 00 ; func flags 0000007: 0000 ; func signature index -0000009: 0000 0000 ; func name offset -000000d: 0000 ; func body size -000000f: 4d ; OPCODE_I32_EQ -0000010: 4e ; OPCODE_I32_NE -0000011: 4f ; OPCODE_I32_LT_S -0000012: 51 ; OPCODE_I32_LT_U -0000013: 50 ; OPCODE_I32_LE_S -0000014: 52 ; OPCODE_I32_LE_U -0000015: 53 ; OPCODE_I32_GT_S -0000016: 55 ; OPCODE_I32_GT_U -0000017: 54 ; OPCODE_I32_GE_S -0000018: 56 ; OPCODE_I32_GE_U +0000009: 0000 ; func body size +000000b: 4d ; OPCODE_I32_EQ +000000c: 4e ; OPCODE_I32_NE +000000d: 4f ; OPCODE_I32_LT_S +000000e: 51 ; OPCODE_I32_LT_U +000000f: 50 ; OPCODE_I32_LE_S +0000010: 52 ; OPCODE_I32_LE_U +0000011: 53 ; OPCODE_I32_GT_S +0000012: 55 ; OPCODE_I32_GT_U +0000013: 54 ; OPCODE_I32_GE_S +0000014: 56 ; OPCODE_I32_GE_U +0000015: 09 ; OPCODE_I8_CONST +0000016: 00 ; u8 literal +0000017: 09 ; OPCODE_I8_CONST +0000018: 00 ; u8 literal 0000019: 09 ; OPCODE_I8_CONST 000001a: 00 ; u8 literal 000001b: 09 ; OPCODE_I8_CONST @@ -90,120 +93,116 @@ 0000028: 00 ; u8 literal 0000029: 09 ; OPCODE_I8_CONST 000002a: 00 ; u8 literal -000002b: 09 ; OPCODE_I8_CONST -000002c: 00 ; u8 literal -000002d: 09 ; OPCODE_I8_CONST -000002e: 00 ; u8 literal -000002f: 68 ; OPCODE_I64_EQ -0000030: 0b ; OPCODE_I64_CONST -0000031: 0000 0000 0000 0000 ; u64 literal -0000039: 0b ; OPCODE_I64_CONST -000003a: 0000 0000 0000 0000 ; u64 literal -0000042: 69 ; OPCODE_I64_NE -0000043: 0b ; OPCODE_I64_CONST -0000044: 0000 0000 0000 0000 ; u64 literal -000004c: 0b ; OPCODE_I64_CONST -000004d: 0000 0000 0000 0000 ; u64 literal -0000055: 6a ; OPCODE_I64_LT_S -0000056: 0b ; OPCODE_I64_CONST -0000057: 0000 0000 0000 0000 ; u64 literal -000005f: 0b ; OPCODE_I64_CONST -0000060: 0000 0000 0000 0000 ; u64 literal -0000068: 6c ; OPCODE_I64_LT_U -0000069: 0b ; OPCODE_I64_CONST -000006a: 0000 0000 0000 0000 ; u64 literal -0000072: 0b ; OPCODE_I64_CONST -0000073: 0000 0000 0000 0000 ; u64 literal -000007b: 6b ; OPCODE_I64_LE_S -000007c: 0b ; OPCODE_I64_CONST -000007d: 0000 0000 0000 0000 ; u64 literal -0000085: 0b ; OPCODE_I64_CONST -0000086: 0000 0000 0000 0000 ; u64 literal -000008e: 6d ; OPCODE_I64_LE_U -000008f: 0b ; OPCODE_I64_CONST -0000090: 0000 0000 0000 0000 ; u64 literal -0000098: 0b ; OPCODE_I64_CONST -0000099: 0000 0000 0000 0000 ; u64 literal -00000a1: 6e ; OPCODE_I64_GT_S -00000a2: 0b ; OPCODE_I64_CONST -00000a3: 0000 0000 0000 0000 ; u64 literal -00000ab: 0b ; OPCODE_I64_CONST -00000ac: 0000 0000 0000 0000 ; u64 literal -00000b4: 70 ; OPCODE_I64_GT_U -00000b5: 0b ; OPCODE_I64_CONST -00000b6: 0000 0000 0000 0000 ; u64 literal -00000be: 0b ; OPCODE_I64_CONST -00000bf: 0000 0000 0000 0000 ; u64 literal -00000c7: 6f ; OPCODE_I64_GE_S -00000c8: 0b ; OPCODE_I64_CONST -00000c9: 0000 0000 0000 0000 ; u64 literal -00000d1: 0b ; OPCODE_I64_CONST -00000d2: 0000 0000 0000 0000 ; u64 literal -00000da: 71 ; OPCODE_I64_GE_U -00000db: 0b ; OPCODE_I64_CONST -00000dc: 0000 0000 0000 0000 ; u64 literal -00000e4: 0b ; OPCODE_I64_CONST -00000e5: 0000 0000 0000 0000 ; u64 literal -00000ed: 83 ; OPCODE_F32_EQ -00000ee: 0d ; OPCODE_F32_CONST -00000ef: 0000 0000 ; f32 literal -00000f3: 0d ; OPCODE_F32_CONST -00000f4: 0000 0000 ; f32 literal -00000f8: 84 ; OPCODE_F32_NE -00000f9: 0d ; OPCODE_F32_CONST -00000fa: 0000 0000 ; f32 literal -00000fe: 0d ; OPCODE_F32_CONST -00000ff: 0000 0000 ; f32 literal -0000103: 85 ; OPCODE_F32_LT -0000104: 0d ; OPCODE_F32_CONST -0000105: 0000 0000 ; f32 literal -0000109: 0d ; OPCODE_F32_CONST -000010a: 0000 0000 ; f32 literal -000010e: 86 ; OPCODE_F32_LE -000010f: 0d ; OPCODE_F32_CONST -0000110: 0000 0000 ; f32 literal -0000114: 0d ; OPCODE_F32_CONST -0000115: 0000 0000 ; f32 literal -0000119: 87 ; OPCODE_F32_GT -000011a: 0d ; OPCODE_F32_CONST -000011b: 0000 0000 ; f32 literal -000011f: 0d ; OPCODE_F32_CONST -0000120: 0000 0000 ; f32 literal -0000124: 88 ; OPCODE_F32_GE -0000125: 0d ; OPCODE_F32_CONST -0000126: 0000 0000 ; f32 literal -000012a: 0d ; OPCODE_F32_CONST -000012b: 0000 0000 ; f32 literal -000012f: 97 ; OPCODE_F64_EQ -0000130: 0c ; OPCODE_F64_CONST -0000131: 0000 0000 0000 0000 ; f64 literal -0000139: 0c ; OPCODE_F64_CONST -000013a: 0000 0000 0000 0000 ; f64 literal -0000142: 98 ; OPCODE_F64_NE -0000143: 0c ; OPCODE_F64_CONST -0000144: 0000 0000 0000 0000 ; f64 literal -000014c: 0c ; OPCODE_F64_CONST -000014d: 0000 0000 0000 0000 ; f64 literal -0000155: 99 ; OPCODE_F64_LT -0000156: 0c ; OPCODE_F64_CONST -0000157: 0000 0000 0000 0000 ; f64 literal -000015f: 0c ; OPCODE_F64_CONST -0000160: 0000 0000 0000 0000 ; f64 literal -0000168: 9a ; OPCODE_F64_LE -0000169: 0c ; OPCODE_F64_CONST -000016a: 0000 0000 0000 0000 ; f64 literal -0000172: 0c ; OPCODE_F64_CONST -0000173: 0000 0000 0000 0000 ; f64 literal -000017b: 9b ; OPCODE_F64_GT -000017c: 0c ; OPCODE_F64_CONST -000017d: 0000 0000 0000 0000 ; f64 literal -0000185: 0c ; OPCODE_F64_CONST -0000186: 0000 0000 0000 0000 ; f64 literal -000018e: 9c ; OPCODE_F64_GE -000018f: 0c ; OPCODE_F64_CONST -0000190: 0000 0000 0000 0000 ; f64 literal -0000198: 0c ; OPCODE_F64_CONST -0000199: 0000 0000 0000 0000 ; f64 literal -000000d: 9201 ; FIXUP func body size -00001a1: 06 ; WASM_SECTION_END +000002b: 68 ; OPCODE_I64_EQ +000002c: 0b ; OPCODE_I64_CONST +000002d: 0000 0000 0000 0000 ; u64 literal +0000035: 0b ; OPCODE_I64_CONST +0000036: 0000 0000 0000 0000 ; u64 literal +000003e: 69 ; OPCODE_I64_NE +000003f: 0b ; OPCODE_I64_CONST +0000040: 0000 0000 0000 0000 ; u64 literal +0000048: 0b ; OPCODE_I64_CONST +0000049: 0000 0000 0000 0000 ; u64 literal +0000051: 6a ; OPCODE_I64_LT_S +0000052: 0b ; OPCODE_I64_CONST +0000053: 0000 0000 0000 0000 ; u64 literal +000005b: 0b ; OPCODE_I64_CONST +000005c: 0000 0000 0000 0000 ; u64 literal +0000064: 6c ; OPCODE_I64_LT_U +0000065: 0b ; OPCODE_I64_CONST +0000066: 0000 0000 0000 0000 ; u64 literal +000006e: 0b ; OPCODE_I64_CONST +000006f: 0000 0000 0000 0000 ; u64 literal +0000077: 6b ; OPCODE_I64_LE_S +0000078: 0b ; OPCODE_I64_CONST +0000079: 0000 0000 0000 0000 ; u64 literal +0000081: 0b ; OPCODE_I64_CONST +0000082: 0000 0000 0000 0000 ; u64 literal +000008a: 6d ; OPCODE_I64_LE_U +000008b: 0b ; OPCODE_I64_CONST +000008c: 0000 0000 0000 0000 ; u64 literal +0000094: 0b ; OPCODE_I64_CONST +0000095: 0000 0000 0000 0000 ; u64 literal +000009d: 6e ; OPCODE_I64_GT_S +000009e: 0b ; OPCODE_I64_CONST +000009f: 0000 0000 0000 0000 ; u64 literal +00000a7: 0b ; OPCODE_I64_CONST +00000a8: 0000 0000 0000 0000 ; u64 literal +00000b0: 70 ; OPCODE_I64_GT_U +00000b1: 0b ; OPCODE_I64_CONST +00000b2: 0000 0000 0000 0000 ; u64 literal +00000ba: 0b ; OPCODE_I64_CONST +00000bb: 0000 0000 0000 0000 ; u64 literal +00000c3: 6f ; OPCODE_I64_GE_S +00000c4: 0b ; OPCODE_I64_CONST +00000c5: 0000 0000 0000 0000 ; u64 literal +00000cd: 0b ; OPCODE_I64_CONST +00000ce: 0000 0000 0000 0000 ; u64 literal +00000d6: 71 ; OPCODE_I64_GE_U +00000d7: 0b ; OPCODE_I64_CONST +00000d8: 0000 0000 0000 0000 ; u64 literal +00000e0: 0b ; OPCODE_I64_CONST +00000e1: 0000 0000 0000 0000 ; u64 literal +00000e9: 83 ; OPCODE_F32_EQ +00000ea: 0d ; OPCODE_F32_CONST +00000eb: 0000 0000 ; f32 literal +00000ef: 0d ; OPCODE_F32_CONST +00000f0: 0000 0000 ; f32 literal +00000f4: 84 ; OPCODE_F32_NE +00000f5: 0d ; OPCODE_F32_CONST +00000f6: 0000 0000 ; f32 literal +00000fa: 0d ; OPCODE_F32_CONST +00000fb: 0000 0000 ; f32 literal +00000ff: 85 ; OPCODE_F32_LT +0000100: 0d ; OPCODE_F32_CONST +0000101: 0000 0000 ; f32 literal +0000105: 0d ; OPCODE_F32_CONST +0000106: 0000 0000 ; f32 literal +000010a: 86 ; OPCODE_F32_LE +000010b: 0d ; OPCODE_F32_CONST +000010c: 0000 0000 ; f32 literal +0000110: 0d ; OPCODE_F32_CONST +0000111: 0000 0000 ; f32 literal +0000115: 87 ; OPCODE_F32_GT +0000116: 0d ; OPCODE_F32_CONST +0000117: 0000 0000 ; f32 literal +000011b: 0d ; OPCODE_F32_CONST +000011c: 0000 0000 ; f32 literal +0000120: 88 ; OPCODE_F32_GE +0000121: 0d ; OPCODE_F32_CONST +0000122: 0000 0000 ; f32 literal +0000126: 0d ; OPCODE_F32_CONST +0000127: 0000 0000 ; f32 literal +000012b: 97 ; OPCODE_F64_EQ +000012c: 0c ; OPCODE_F64_CONST +000012d: 0000 0000 0000 0000 ; f64 literal +0000135: 0c ; OPCODE_F64_CONST +0000136: 0000 0000 0000 0000 ; f64 literal +000013e: 98 ; OPCODE_F64_NE +000013f: 0c ; OPCODE_F64_CONST +0000140: 0000 0000 0000 0000 ; f64 literal +0000148: 0c ; OPCODE_F64_CONST +0000149: 0000 0000 0000 0000 ; f64 literal +0000151: 99 ; OPCODE_F64_LT +0000152: 0c ; OPCODE_F64_CONST +0000153: 0000 0000 0000 0000 ; f64 literal +000015b: 0c ; OPCODE_F64_CONST +000015c: 0000 0000 0000 0000 ; f64 literal +0000164: 9a ; OPCODE_F64_LE +0000165: 0c ; OPCODE_F64_CONST +0000166: 0000 0000 0000 0000 ; f64 literal +000016e: 0c ; OPCODE_F64_CONST +000016f: 0000 0000 0000 0000 ; f64 literal +0000177: 9b ; OPCODE_F64_GT +0000178: 0c ; OPCODE_F64_CONST +0000179: 0000 0000 0000 0000 ; f64 literal +0000181: 0c ; OPCODE_F64_CONST +0000182: 0000 0000 0000 0000 ; f64 literal +000018a: 9c ; OPCODE_F64_GE +000018b: 0c ; OPCODE_F64_CONST +000018c: 0000 0000 0000 0000 ; f64 literal +0000194: 0c ; OPCODE_F64_CONST +0000195: 0000 0000 0000 0000 ; f64 literal +0000009: 9201 ; FIXUP func body size +000019d: 06 ; WASM_SECTION_END ;;; STDOUT ;;) diff --git a/test/dump/const.txt b/test/dump/const.txt index cd733a10..a2d26319 100644 --- a/test/dump/const.txt +++ b/test/dump/const.txt @@ -51,86 +51,85 @@ 0000004: 02 ; WASM_SECTION_FUNCTIONS 0000005: 01 ; num functions ; function 0 -0000006: 01 ; func flags +0000006: 00 ; func flags 0000007: 0000 ; func signature index -0000009: 0000 0000 ; func name offset -000000d: 0000 ; func body size -000000f: 09 ; OPCODE_I8_CONST -0000010: 00 ; u8 literal -0000011: 0a ; OPCODE_I32_CONST -0000012: 0000 0080 ; u32 literal -0000016: 09 ; OPCODE_I8_CONST -0000017: ff ; u8 literal -0000018: 0a ; OPCODE_I32_CONST -0000019: 0000 0080 ; u32 literal -000001d: 09 ; OPCODE_I8_CONST -000001e: ff ; u8 literal -000001f: 0b ; OPCODE_I64_CONST -0000020: 0000 0000 0000 0000 ; u64 literal -0000028: 0b ; OPCODE_I64_CONST -0000029: 0000 0000 0000 0080 ; u64 literal -0000031: 0b ; OPCODE_I64_CONST -0000032: ffff ffff ffff ffff ; u64 literal -000003a: 0b ; OPCODE_I64_CONST -000003b: 0000 0000 0000 0080 ; u64 literal -0000043: 0b ; OPCODE_I64_CONST -0000044: ffff ffff ffff ffff ; u64 literal -000004c: 0d ; OPCODE_F32_CONST -000004d: 0000 0000 ; f32 literal -0000051: 0d ; OPCODE_F32_CONST -0000052: 1668 a965 ; f32 literal -0000056: 0d ; OPCODE_F32_CONST -0000057: 4020 4f37 ; f32 literal -000005b: 0d ; OPCODE_F32_CONST -000005c: 0000 c07f ; f32 literal -0000060: 0d ; OPCODE_F32_CONST -0000061: 0000 c0ff ; f32 literal -0000065: 0d ; OPCODE_F32_CONST -0000066: 0000 c07f ; f32 literal -000006a: 0d ; OPCODE_F32_CONST -000006b: bc0a 807f ; f32 literal -000006f: 0d ; OPCODE_F32_CONST -0000070: bc0a 80ff ; f32 literal -0000074: 0d ; OPCODE_F32_CONST -0000075: bc0a 807f ; f32 literal -0000079: 0d ; OPCODE_F32_CONST -000007a: 0000 807f ; f32 literal -000007e: 0d ; OPCODE_F32_CONST -000007f: 0000 80ff ; f32 literal -0000083: 0d ; OPCODE_F32_CONST -0000084: 0000 807f ; f32 literal -0000088: 0d ; OPCODE_F32_CONST -0000089: 0000 00bf ; f32 literal -000008d: 0d ; OPCODE_F32_CONST -000008e: db0f c940 ; f32 literal -0000092: 0c ; OPCODE_F64_CONST -0000093: 0000 0000 0000 0000 ; f64 literal -000009b: 0c ; OPCODE_F64_CONST -000009c: b856 0e3c dd9a efbf ; f64 literal -00000a4: 0c ; OPCODE_F64_CONST -00000a5: 182d 4454 fb21 1940 ; f64 literal -00000ad: 0c ; OPCODE_F64_CONST -00000ae: 0000 0000 0000 f87f ; f64 literal -00000b6: 0c ; OPCODE_F64_CONST -00000b7: 0000 0000 0000 f8ff ; f64 literal -00000bf: 0c ; OPCODE_F64_CONST -00000c0: 0000 0000 0000 f87f ; f64 literal -00000c8: 0c ; OPCODE_F64_CONST -00000c9: bc0a 0000 0000 f07f ; f64 literal -00000d1: 0c ; OPCODE_F64_CONST -00000d2: bc0a 0000 0000 f0ff ; f64 literal -00000da: 0c ; OPCODE_F64_CONST -00000db: bc0a 0000 0000 f07f ; f64 literal -00000e3: 0c ; OPCODE_F64_CONST -00000e4: 0000 0000 0000 f07f ; f64 literal -00000ec: 0c ; OPCODE_F64_CONST -00000ed: 0000 0000 0000 f0ff ; f64 literal -00000f5: 0c ; OPCODE_F64_CONST -00000f6: 0000 0000 0000 f07f ; f64 literal -00000fe: 0c ; OPCODE_F64_CONST -00000ff: 0000 0000 0000 e0bf ; f64 literal -0000107: 0c ; OPCODE_F64_CONST -0000108: 182d 4454 fb21 1940 ; f64 literal -000000d: 0101 ; FIXUP func body size -0000110: 06 ; WASM_SECTION_END +0000009: 0000 ; func body size +000000b: 09 ; OPCODE_I8_CONST +000000c: 00 ; u8 literal +000000d: 0a ; OPCODE_I32_CONST +000000e: 0000 0080 ; u32 literal +0000012: 09 ; OPCODE_I8_CONST +0000013: ff ; u8 literal +0000014: 0a ; OPCODE_I32_CONST +0000015: 0000 0080 ; u32 literal +0000019: 09 ; OPCODE_I8_CONST +000001a: ff ; u8 literal +000001b: 0b ; OPCODE_I64_CONST +000001c: 0000 0000 0000 0000 ; u64 literal +0000024: 0b ; OPCODE_I64_CONST +0000025: 0000 0000 0000 0080 ; u64 literal +000002d: 0b ; OPCODE_I64_CONST +000002e: ffff ffff ffff ffff ; u64 literal +0000036: 0b ; OPCODE_I64_CONST +0000037: 0000 0000 0000 0080 ; u64 literal +000003f: 0b ; OPCODE_I64_CONST +0000040: ffff ffff ffff ffff ; u64 literal +0000048: 0d ; OPCODE_F32_CONST +0000049: 0000 0000 ; f32 literal +000004d: 0d ; OPCODE_F32_CONST +000004e: 1668 a965 ; f32 literal +0000052: 0d ; OPCODE_F32_CONST +0000053: 4020 4f37 ; f32 literal +0000057: 0d ; OPCODE_F32_CONST +0000058: 0000 c07f ; f32 literal +000005c: 0d ; OPCODE_F32_CONST +000005d: 0000 c0ff ; f32 literal +0000061: 0d ; OPCODE_F32_CONST +0000062: 0000 c07f ; f32 literal +0000066: 0d ; OPCODE_F32_CONST +0000067: bc0a 807f ; f32 literal +000006b: 0d ; OPCODE_F32_CONST +000006c: bc0a 80ff ; f32 literal +0000070: 0d ; OPCODE_F32_CONST +0000071: bc0a 807f ; f32 literal +0000075: 0d ; OPCODE_F32_CONST +0000076: 0000 807f ; f32 literal +000007a: 0d ; OPCODE_F32_CONST +000007b: 0000 80ff ; f32 literal +000007f: 0d ; OPCODE_F32_CONST +0000080: 0000 807f ; f32 literal +0000084: 0d ; OPCODE_F32_CONST +0000085: 0000 00bf ; f32 literal +0000089: 0d ; OPCODE_F32_CONST +000008a: db0f c940 ; f32 literal +000008e: 0c ; OPCODE_F64_CONST +000008f: 0000 0000 0000 0000 ; f64 literal +0000097: 0c ; OPCODE_F64_CONST +0000098: b856 0e3c dd9a efbf ; f64 literal +00000a0: 0c ; OPCODE_F64_CONST +00000a1: 182d 4454 fb21 1940 ; f64 literal +00000a9: 0c ; OPCODE_F64_CONST +00000aa: 0000 0000 0000 f87f ; f64 literal +00000b2: 0c ; OPCODE_F64_CONST +00000b3: 0000 0000 0000 f8ff ; f64 literal +00000bb: 0c ; OPCODE_F64_CONST +00000bc: 0000 0000 0000 f87f ; f64 literal +00000c4: 0c ; OPCODE_F64_CONST +00000c5: bc0a 0000 0000 f07f ; f64 literal +00000cd: 0c ; OPCODE_F64_CONST +00000ce: bc0a 0000 0000 f0ff ; f64 literal +00000d6: 0c ; OPCODE_F64_CONST +00000d7: bc0a 0000 0000 f07f ; f64 literal +00000df: 0c ; OPCODE_F64_CONST +00000e0: 0000 0000 0000 f07f ; f64 literal +00000e8: 0c ; OPCODE_F64_CONST +00000e9: 0000 0000 0000 f0ff ; f64 literal +00000f1: 0c ; OPCODE_F64_CONST +00000f2: 0000 0000 0000 f07f ; f64 literal +00000fa: 0c ; OPCODE_F64_CONST +00000fb: 0000 0000 0000 e0bf ; f64 literal +0000103: 0c ; OPCODE_F64_CONST +0000104: 182d 4454 fb21 1940 ; f64 literal +0000009: 0101 ; FIXUP func body size +000010c: 06 ; WASM_SECTION_END ;;; STDOUT ;;) diff --git a/test/dump/convert.txt b/test/dump/convert.txt index 5b27e9dc..07d9cbd9 100644 --- a/test/dump/convert.txt +++ b/test/dump/convert.txt @@ -33,37 +33,36 @@ 0000004: 02 ; WASM_SECTION_FUNCTIONS 0000005: 01 ; num functions ; function 0 -0000006: 01 ; func flags +0000006: 00 ; func flags 0000007: 0000 ; func signature index -0000009: 0000 0000 ; func name offset -000000d: 0000 ; func body size -000000f: a1 ; OPCODE_I32_CONVERT_I64 -0000010: a7 ; OPCODE_I64_UCONVERT_I32 -0000011: 9d ; OPCODE_I32_SCONVERT_F32 -0000012: a8 ; OPCODE_F32_SCONVERT_I32 -0000013: 9f ; OPCODE_I32_UCONVERT_F32 -0000014: a9 ; OPCODE_F32_UCONVERT_I32 -0000015: 9e ; OPCODE_I32_SCONVERT_F64 -0000016: ae ; OPCODE_F64_SCONVERT_I32 -0000017: a0 ; OPCODE_I32_UCONVERT_F64 -0000018: af ; OPCODE_F64_UCONVERT_I32 -0000019: 09 ; OPCODE_I8_CONST -000001a: 00 ; u8 literal -000001b: a2 ; OPCODE_I64_SCONVERT_F32 -000001c: aa ; OPCODE_F32_SCONVERT_I64 -000001d: a4 ; OPCODE_I64_UCONVERT_F32 -000001e: ab ; OPCODE_F32_UCONVERT_I64 -000001f: a3 ; OPCODE_I64_SCONVERT_F64 -0000020: b0 ; OPCODE_F64_SCONVERT_I64 -0000021: a5 ; OPCODE_I64_UCONVERT_F64 -0000022: b1 ; OPCODE_F64_UCONVERT_I64 -0000023: a6 ; OPCODE_I64_SCONVERT_I32 -0000024: 09 ; OPCODE_I8_CONST -0000025: 00 ; u8 literal -0000026: ac ; OPCODE_F32_CONVERT_F64 -0000027: b2 ; OPCODE_F64_CONVERT_F32 -0000028: 0d ; OPCODE_F32_CONST -0000029: 0000 0000 ; f32 literal -000000d: 1e00 ; FIXUP func body size -000002d: 06 ; WASM_SECTION_END +0000009: 0000 ; func body size +000000b: a1 ; OPCODE_I32_CONVERT_I64 +000000c: a7 ; OPCODE_I64_UCONVERT_I32 +000000d: 9d ; OPCODE_I32_SCONVERT_F32 +000000e: a8 ; OPCODE_F32_SCONVERT_I32 +000000f: 9f ; OPCODE_I32_UCONVERT_F32 +0000010: a9 ; OPCODE_F32_UCONVERT_I32 +0000011: 9e ; OPCODE_I32_SCONVERT_F64 +0000012: ae ; OPCODE_F64_SCONVERT_I32 +0000013: a0 ; OPCODE_I32_UCONVERT_F64 +0000014: af ; OPCODE_F64_UCONVERT_I32 +0000015: 09 ; OPCODE_I8_CONST +0000016: 00 ; u8 literal +0000017: a2 ; OPCODE_I64_SCONVERT_F32 +0000018: aa ; OPCODE_F32_SCONVERT_I64 +0000019: a4 ; OPCODE_I64_UCONVERT_F32 +000001a: ab ; OPCODE_F32_UCONVERT_I64 +000001b: a3 ; OPCODE_I64_SCONVERT_F64 +000001c: b0 ; OPCODE_F64_SCONVERT_I64 +000001d: a5 ; OPCODE_I64_UCONVERT_F64 +000001e: b1 ; OPCODE_F64_UCONVERT_I64 +000001f: a6 ; OPCODE_I64_SCONVERT_I32 +0000020: 09 ; OPCODE_I8_CONST +0000021: 00 ; u8 literal +0000022: ac ; OPCODE_F32_CONVERT_F64 +0000023: b2 ; OPCODE_F64_CONVERT_F32 +0000024: 0d ; OPCODE_F32_CONST +0000025: 0000 0000 ; f32 literal +0000009: 1e00 ; FIXUP func body size +0000029: 06 ; WASM_SECTION_END ;;; STDOUT ;;) diff --git a/test/dump/dedupe-sig.txt b/test/dump/dedupe-sig.txt index 22fcd41e..9f0eeb47 100644 --- a/test/dump/dedupe-sig.txt +++ b/test/dump/dedupe-sig.txt @@ -17,16 +17,15 @@ 0000008: 0000 ; import signature index 000000a: 0000 0000 ; import name offset ; function 0 -000000e: 01 ; func flags +000000e: 00 ; func flags 000000f: 0000 ; func signature index -0000011: 0000 0000 ; func name offset -0000015: 0000 ; func body size -0000017: 0b ; OPCODE_I64_CONST -0000018: 0000 0000 0000 0000 ; u64 literal -0000015: 0900 ; FIXUP func body size -0000020: 06 ; WASM_SECTION_END +0000011: 0000 ; func body size +0000013: 0b ; OPCODE_I64_CONST +0000014: 0000 0000 0000 0000 ; u64 literal +0000011: 0900 ; FIXUP func body size +000001c: 06 ; WASM_SECTION_END ; import 0 -000000a: 2100 0000 ; FIXUP import name offset -0000021: 6261 72 ; import name -0000024: 00 ; \0 +000000a: 1d00 0000 ; FIXUP import name offset +000001d: 6261 72 ; import name +0000020: 00 ; \0 ;;; STDOUT ;;) diff --git a/test/dump/expr-break.txt b/test/dump/expr-break.txt index 0456eb3d..3db4301b 100644 --- a/test/dump/expr-break.txt +++ b/test/dump/expr-break.txt @@ -12,16 +12,15 @@ 0000004: 02 ; WASM_SECTION_FUNCTIONS 0000005: 01 ; num functions ; function 0 -0000006: 01 ; func flags +0000006: 00 ; func flags 0000007: 0000 ; func signature index -0000009: 0000 0000 ; func name offset -000000d: 0000 ; func body size -000000f: 01 ; OPCODE_BLOCK -0000010: 01 ; num expressions -0000011: 06 ; OPCODE_BR -0000012: 00 ; break depth -0000013: 09 ; OPCODE_I8_CONST -0000014: 01 ; u8 literal -000000d: 0600 ; FIXUP func body size -0000015: 06 ; WASM_SECTION_END +0000009: 0000 ; func body size +000000b: 01 ; OPCODE_BLOCK +000000c: 01 ; num expressions +000000d: 06 ; OPCODE_BR +000000e: 00 ; break depth +000000f: 09 ; OPCODE_I8_CONST +0000010: 01 ; u8 literal +0000009: 0600 ; FIXUP func body size +0000011: 06 ; WASM_SECTION_END ;;; STDOUT ;;) diff --git a/test/dump/func-multi.txt b/test/dump/func-multi.txt index 04d9f28c..374f7d16 100644 --- a/test/dump/func-multi.txt +++ b/test/dump/func-multi.txt @@ -12,22 +12,19 @@ 0000004: 02 ; WASM_SECTION_FUNCTIONS 0000005: 03 ; num functions ; function 0 -0000006: 01 ; func flags +0000006: 00 ; func flags 0000007: 0000 ; func signature index -0000009: 0000 0000 ; func name offset -000000d: 0000 ; func body size -000000d: 0000 ; FIXUP func body size +0000009: 0000 ; func body size +0000009: 0000 ; FIXUP func body size ; function 1 -000000f: 01 ; func flags -0000010: 0000 ; func signature index -0000012: 0000 0000 ; func name offset -0000016: 0000 ; func body size -0000016: 0000 ; FIXUP func body size +000000b: 00 ; func flags +000000c: 0000 ; func signature index +000000e: 0000 ; func body size +000000e: 0000 ; FIXUP func body size ; function 2 -0000018: 01 ; func flags -0000019: 0000 ; func signature index -000001b: 0000 0000 ; func name offset -000001f: 0000 ; func body size -000001f: 0000 ; FIXUP func body size -0000021: 06 ; WASM_SECTION_END +0000010: 00 ; func flags +0000011: 0000 ; func signature index +0000013: 0000 ; func body size +0000013: 0000 ; FIXUP func body size +0000015: 06 ; WASM_SECTION_END ;;; STDOUT ;;) diff --git a/test/dump/func-named.txt b/test/dump/func-named.txt index 5996fc40..d3079af3 100644 --- a/test/dump/func-named.txt +++ b/test/dump/func-named.txt @@ -10,10 +10,9 @@ 0000004: 02 ; WASM_SECTION_FUNCTIONS 0000005: 01 ; num functions ; function 0 -0000006: 01 ; func flags +0000006: 00 ; func flags 0000007: 0000 ; func signature index -0000009: 0000 0000 ; func name offset -000000d: 0000 ; func body size -000000d: 0000 ; FIXUP func body size -000000f: 06 ; WASM_SECTION_END +0000009: 0000 ; func body size +0000009: 0000 ; FIXUP func body size +000000b: 06 ; WASM_SECTION_END ;;; STDOUT ;;) diff --git a/test/dump/getlocal-param.txt b/test/dump/getlocal-param.txt index 0d9aa706..d3ec6238 100644 --- a/test/dump/getlocal-param.txt +++ b/test/dump/getlocal-param.txt @@ -23,26 +23,25 @@ 0000006: 02 ; WASM_SECTION_FUNCTIONS 0000007: 01 ; num functions ; function 0 -0000008: 05 ; func flags +0000008: 04 ; func flags 0000009: 0000 ; func signature index -000000b: 0000 0000 ; func name offset -000000f: 0100 ; num local i32 -0000011: 0100 ; num local i64 -0000013: 0200 ; num local f32 -0000015: 0000 ; num local f64 -0000017: 0000 ; func body size +000000b: 0100 ; num local i32 +000000d: 0100 ; num local i64 +000000f: 0200 ; num local f32 +0000011: 0000 ; num local f64 +0000013: 0000 ; func body size +0000015: 0e ; OPCODE_GET_LOCAL +0000016: 00 ; remapped local index +0000017: 0e ; OPCODE_GET_LOCAL +0000018: 01 ; remapped local index 0000019: 0e ; OPCODE_GET_LOCAL -000001a: 00 ; remapped local index +000001a: 03 ; remapped local index 000001b: 0e ; OPCODE_GET_LOCAL -000001c: 01 ; remapped local index +000001c: 04 ; remapped local index 000001d: 0e ; OPCODE_GET_LOCAL -000001e: 03 ; remapped local index +000001e: 02 ; remapped local index 000001f: 0e ; OPCODE_GET_LOCAL -0000020: 04 ; remapped local index -0000021: 0e ; OPCODE_GET_LOCAL -0000022: 02 ; remapped local index -0000023: 0e ; OPCODE_GET_LOCAL -0000024: 05 ; remapped local index -0000017: 0c00 ; FIXUP func body size -0000025: 06 ; WASM_SECTION_END +0000020: 05 ; remapped local index +0000013: 0c00 ; FIXUP func body size +0000021: 06 ; WASM_SECTION_END ;;; STDOUT ;;) diff --git a/test/dump/getlocal.txt b/test/dump/getlocal.txt index 58e1c0be..d55b79f3 100644 --- a/test/dump/getlocal.txt +++ b/test/dump/getlocal.txt @@ -23,30 +23,29 @@ 0000004: 02 ; WASM_SECTION_FUNCTIONS 0000005: 01 ; num functions ; function 0 -0000006: 05 ; func flags +0000006: 04 ; func flags 0000007: 0000 ; func signature index -0000009: 0000 0000 ; func name offset -000000d: 0200 ; num local i32 -000000f: 0200 ; num local i64 -0000011: 0200 ; num local f32 -0000013: 0200 ; num local f64 -0000015: 0000 ; func body size +0000009: 0200 ; num local i32 +000000b: 0200 ; num local i64 +000000d: 0200 ; num local f32 +000000f: 0200 ; num local f64 +0000011: 0000 ; func body size +0000013: 0e ; OPCODE_GET_LOCAL +0000014: 06 ; remapped local index +0000015: 0e ; OPCODE_GET_LOCAL +0000016: 04 ; remapped local index 0000017: 0e ; OPCODE_GET_LOCAL -0000018: 06 ; remapped local index +0000018: 02 ; remapped local index 0000019: 0e ; OPCODE_GET_LOCAL -000001a: 04 ; remapped local index +000001a: 00 ; remapped local index 000001b: 0e ; OPCODE_GET_LOCAL -000001c: 02 ; remapped local index +000001c: 01 ; remapped local index 000001d: 0e ; OPCODE_GET_LOCAL -000001e: 00 ; remapped local index +000001e: 05 ; remapped local index 000001f: 0e ; OPCODE_GET_LOCAL -0000020: 01 ; remapped local index +0000020: 07 ; remapped local index 0000021: 0e ; OPCODE_GET_LOCAL -0000022: 05 ; remapped local index -0000023: 0e ; OPCODE_GET_LOCAL -0000024: 07 ; remapped local index -0000025: 0e ; OPCODE_GET_LOCAL -0000026: 03 ; remapped local index -0000015: 1000 ; FIXUP func body size -0000027: 06 ; WASM_SECTION_END +0000022: 03 ; remapped local index +0000011: 1000 ; FIXUP func body size +0000023: 06 ; WASM_SECTION_END ;;; STDOUT ;;) diff --git a/test/dump/if.txt b/test/dump/if.txt index 853c42eb..4831a0c7 100644 --- a/test/dump/if.txt +++ b/test/dump/if.txt @@ -14,32 +14,30 @@ 0000004: 02 ; WASM_SECTION_FUNCTIONS 0000005: 02 ; num functions ; function 0 -0000006: 01 ; func flags +0000006: 00 ; func flags 0000007: 0000 ; func signature index -0000009: 0000 0000 ; func name offset -000000d: 0000 ; func body size -000000f: 03 ; OPCODE_IF +0000009: 0000 ; func body size +000000b: 03 ; OPCODE_IF +000000c: 09 ; OPCODE_I8_CONST +000000d: 01 ; u8 literal +000000e: 00 ; OPCODE_NOP +000000f: 04 ; OPCODE_IF_THEN 0000010: 09 ; OPCODE_I8_CONST -0000011: 01 ; u8 literal -0000012: 00 ; OPCODE_NOP -0000013: 04 ; OPCODE_IF_THEN -0000014: 09 ; OPCODE_I8_CONST -0000015: 00 ; u8 literal -0000016: 0d ; OPCODE_F32_CONST -0000017: 0000 803f ; f32 literal -000001b: 0d ; OPCODE_F32_CONST -000001c: 0000 0040 ; f32 literal -000000d: 1100 ; FIXUP func body size +0000011: 00 ; u8 literal +0000012: 0d ; OPCODE_F32_CONST +0000013: 0000 803f ; f32 literal +0000017: 0d ; OPCODE_F32_CONST +0000018: 0000 0040 ; f32 literal +0000009: 1100 ; FIXUP func body size ; function 1 -0000020: 01 ; func flags -0000021: 0000 ; func signature index -0000023: 0000 0000 ; func name offset -0000027: 0000 ; func body size -0000029: 04 ; OPCODE_IF_THEN -000002a: 09 ; OPCODE_I8_CONST -000002b: 01 ; u8 literal -000002c: 14 ; OPCODE_RETURN -000002d: 14 ; OPCODE_RETURN -0000027: 0500 ; FIXUP func body size -000002e: 06 ; WASM_SECTION_END +000001c: 00 ; func flags +000001d: 0000 ; func signature index +000001f: 0000 ; func body size +0000021: 04 ; OPCODE_IF_THEN +0000022: 09 ; OPCODE_I8_CONST +0000023: 01 ; u8 literal +0000024: 14 ; OPCODE_RETURN +0000025: 14 ; OPCODE_RETURN +000001f: 0500 ; FIXUP func body size +0000026: 06 ; WASM_SECTION_END ;;; STDOUT ;;) diff --git a/test/dump/load-aligned.txt b/test/dump/load-aligned.txt index e2772c8c..6d5b003a 100644 --- a/test/dump/load-aligned.txt +++ b/test/dump/load-aligned.txt @@ -44,10 +44,13 @@ 0000004: 02 ; WASM_SECTION_FUNCTIONS 0000005: 01 ; num functions ; function 0 -0000006: 01 ; func flags +0000006: 00 ; func flags 0000007: 0000 ; func signature index -0000009: 0000 0000 ; func name offset -000000d: 0000 ; func body size +0000009: 0000 ; func body size +000000b: 20 ; OPCODE_I32_LOAD_MEM8_S +000000c: 00 ; load access byte +000000d: 09 ; OPCODE_I8_CONST +000000e: 00 ; u8 literal 000000f: 20 ; OPCODE_I32_LOAD_MEM8_S 0000010: 00 ; load access byte 0000011: 09 ; OPCODE_I8_CONST @@ -60,7 +63,7 @@ 0000018: 00 ; load access byte 0000019: 09 ; OPCODE_I8_CONST 000001a: 00 ; u8 literal -000001b: 20 ; OPCODE_I32_LOAD_MEM8_S +000001b: 22 ; OPCODE_I32_LOAD_MEM16_S 000001c: 00 ; load access byte 000001d: 09 ; OPCODE_I8_CONST 000001e: 00 ; u8 literal @@ -76,7 +79,7 @@ 0000028: 00 ; load access byte 0000029: 09 ; OPCODE_I8_CONST 000002a: 00 ; u8 literal -000002b: 22 ; OPCODE_I32_LOAD_MEM16_S +000002b: 2a ; OPCODE_I32_LOAD_MEM 000002c: 00 ; load access byte 000002d: 09 ; OPCODE_I8_CONST 000002e: 00 ; u8 literal @@ -92,7 +95,7 @@ 0000038: 00 ; load access byte 0000039: 09 ; OPCODE_I8_CONST 000003a: 00 ; u8 literal -000003b: 2a ; OPCODE_I32_LOAD_MEM +000003b: 2b ; OPCODE_I64_LOAD_MEM 000003c: 00 ; load access byte 000003d: 09 ; OPCODE_I8_CONST 000003e: 00 ; u8 literal @@ -108,7 +111,7 @@ 0000048: 00 ; load access byte 0000049: 09 ; OPCODE_I8_CONST 000004a: 00 ; u8 literal -000004b: 2b ; OPCODE_I64_LOAD_MEM +000004b: 24 ; OPCODE_I64_LOAD_MEM8_S 000004c: 00 ; load access byte 000004d: 09 ; OPCODE_I8_CONST 000004e: 00 ; u8 literal @@ -124,7 +127,7 @@ 0000058: 00 ; load access byte 0000059: 09 ; OPCODE_I8_CONST 000005a: 00 ; u8 literal -000005b: 24 ; OPCODE_I64_LOAD_MEM8_S +000005b: 26 ; OPCODE_I64_LOAD_MEM16_S 000005c: 00 ; load access byte 000005d: 09 ; OPCODE_I8_CONST 000005e: 00 ; u8 literal @@ -140,7 +143,7 @@ 0000068: 00 ; load access byte 0000069: 09 ; OPCODE_I8_CONST 000006a: 00 ; u8 literal -000006b: 26 ; OPCODE_I64_LOAD_MEM16_S +000006b: 28 ; OPCODE_I64_LOAD_MEM32_S 000006c: 00 ; load access byte 000006d: 09 ; OPCODE_I8_CONST 000006e: 00 ; u8 literal @@ -156,10 +159,6 @@ 0000078: 00 ; load access byte 0000079: 09 ; OPCODE_I8_CONST 000007a: 00 ; u8 literal -000007b: 28 ; OPCODE_I64_LOAD_MEM32_S -000007c: 00 ; load access byte -000007d: 09 ; OPCODE_I8_CONST -000007e: 00 ; u8 literal -000000d: 7000 ; FIXUP func body size -000007f: 06 ; WASM_SECTION_END +0000009: 7000 ; FIXUP func body size +000007b: 06 ; WASM_SECTION_END ;;; STDOUT ;;) diff --git a/test/dump/load.txt b/test/dump/load.txt index b2d1dfc5..617ad804 100644 --- a/test/dump/load.txt +++ b/test/dump/load.txt @@ -24,66 +24,65 @@ 0000004: 02 ; WASM_SECTION_FUNCTIONS 0000005: 01 ; num functions ; function 0 -0000006: 01 ; func flags +0000006: 00 ; func flags 0000007: 0000 ; func signature index -0000009: 0000 0000 ; func name offset -000000d: 0000 ; func body size -000000f: 2a ; OPCODE_I32_LOAD_MEM +0000009: 0000 ; func body size +000000b: 2a ; OPCODE_I32_LOAD_MEM +000000c: 00 ; load access byte +000000d: 09 ; OPCODE_I8_CONST +000000e: 00 ; u8 literal +000000f: 20 ; OPCODE_I32_LOAD_MEM8_S 0000010: 00 ; load access byte 0000011: 09 ; OPCODE_I8_CONST 0000012: 00 ; u8 literal -0000013: 20 ; OPCODE_I32_LOAD_MEM8_S +0000013: 22 ; OPCODE_I32_LOAD_MEM16_S 0000014: 00 ; load access byte 0000015: 09 ; OPCODE_I8_CONST 0000016: 00 ; u8 literal -0000017: 22 ; OPCODE_I32_LOAD_MEM16_S +0000017: 21 ; OPCODE_I32_LOAD_MEM8_U 0000018: 00 ; load access byte 0000019: 09 ; OPCODE_I8_CONST 000001a: 00 ; u8 literal -000001b: 21 ; OPCODE_I32_LOAD_MEM8_U +000001b: 23 ; OPCODE_I32_LOAD_MEM16_U 000001c: 00 ; load access byte 000001d: 09 ; OPCODE_I8_CONST 000001e: 00 ; u8 literal -000001f: 23 ; OPCODE_I32_LOAD_MEM16_U +000001f: 2b ; OPCODE_I64_LOAD_MEM 0000020: 00 ; load access byte 0000021: 09 ; OPCODE_I8_CONST 0000022: 00 ; u8 literal -0000023: 2b ; OPCODE_I64_LOAD_MEM +0000023: 24 ; OPCODE_I64_LOAD_MEM8_S 0000024: 00 ; load access byte 0000025: 09 ; OPCODE_I8_CONST 0000026: 00 ; u8 literal -0000027: 24 ; OPCODE_I64_LOAD_MEM8_S +0000027: 26 ; OPCODE_I64_LOAD_MEM16_S 0000028: 00 ; load access byte 0000029: 09 ; OPCODE_I8_CONST 000002a: 00 ; u8 literal -000002b: 26 ; OPCODE_I64_LOAD_MEM16_S +000002b: 28 ; OPCODE_I64_LOAD_MEM32_S 000002c: 00 ; load access byte 000002d: 09 ; OPCODE_I8_CONST 000002e: 00 ; u8 literal -000002f: 28 ; OPCODE_I64_LOAD_MEM32_S +000002f: 25 ; OPCODE_I64_LOAD_MEM8_U 0000030: 00 ; load access byte 0000031: 09 ; OPCODE_I8_CONST 0000032: 00 ; u8 literal -0000033: 25 ; OPCODE_I64_LOAD_MEM8_U +0000033: 27 ; OPCODE_I64_LOAD_MEM16_U 0000034: 00 ; load access byte 0000035: 09 ; OPCODE_I8_CONST 0000036: 00 ; u8 literal -0000037: 27 ; OPCODE_I64_LOAD_MEM16_U +0000037: 29 ; OPCODE_I64_LOAD_MEM32_U 0000038: 00 ; load access byte 0000039: 09 ; OPCODE_I8_CONST 000003a: 00 ; u8 literal -000003b: 29 ; OPCODE_I64_LOAD_MEM32_U +000003b: 2c ; OPCODE_F32_LOAD_MEM 000003c: 00 ; load access byte 000003d: 09 ; OPCODE_I8_CONST 000003e: 00 ; u8 literal -000003f: 2c ; OPCODE_F32_LOAD_MEM +000003f: 2d ; OPCODE_F64_LOAD_MEM 0000040: 00 ; load access byte 0000041: 09 ; OPCODE_I8_CONST 0000042: 00 ; u8 literal -0000043: 2d ; OPCODE_F64_LOAD_MEM -0000044: 00 ; load access byte -0000045: 09 ; OPCODE_I8_CONST -0000046: 00 ; u8 literal -000000d: 3800 ; FIXUP func body size -0000047: 06 ; WASM_SECTION_END +0000009: 3800 ; FIXUP func body size +0000043: 06 ; WASM_SECTION_END ;;; STDOUT ;;) diff --git a/test/dump/loadglobal.txt b/test/dump/loadglobal.txt index 445b31b3..87615528 100644 --- a/test/dump/loadglobal.txt +++ b/test/dump/loadglobal.txt @@ -33,18 +33,17 @@ 000001e: 02 ; WASM_SECTION_FUNCTIONS 000001f: 01 ; num functions ; function 0 -0000020: 01 ; func flags +0000020: 00 ; func flags 0000021: 0000 ; func signature index -0000023: 0000 0000 ; func name offset -0000027: 0000 ; func body size +0000023: 0000 ; func body size +0000025: 10 ; OPCODE_LOAD_GLOBAL +0000026: 00 ; global index +0000027: 10 ; OPCODE_LOAD_GLOBAL +0000028: 01 ; global index 0000029: 10 ; OPCODE_LOAD_GLOBAL -000002a: 00 ; global index +000002a: 02 ; global index 000002b: 10 ; OPCODE_LOAD_GLOBAL -000002c: 01 ; global index -000002d: 10 ; OPCODE_LOAD_GLOBAL -000002e: 02 ; global index -000002f: 10 ; OPCODE_LOAD_GLOBAL -0000030: 03 ; global index -0000027: 0800 ; FIXUP func body size -0000031: 06 ; WASM_SECTION_END +000002c: 03 ; global index +0000023: 0800 ; FIXUP func body size +000002d: 06 ; WASM_SECTION_END ;;; STDOUT ;;) diff --git a/test/dump/locals.txt b/test/dump/locals.txt index 6979667b..27de417d 100644 --- a/test/dump/locals.txt +++ b/test/dump/locals.txt @@ -10,14 +10,13 @@ 0000004: 02 ; WASM_SECTION_FUNCTIONS 0000005: 01 ; num functions ; function 0 -0000006: 05 ; func flags +0000006: 04 ; func flags 0000007: 0000 ; func signature index -0000009: 0000 0000 ; func name offset -000000d: 0100 ; num local i32 -000000f: 0200 ; num local i64 -0000011: 0300 ; num local f32 -0000013: 0400 ; num local f64 -0000015: 0000 ; func body size -0000015: 0000 ; FIXUP func body size -0000017: 06 ; WASM_SECTION_END +0000009: 0100 ; num local i32 +000000b: 0200 ; num local i64 +000000d: 0300 ; num local f32 +000000f: 0400 ; num local f64 +0000011: 0000 ; func body size +0000011: 0000 ; FIXUP func body size +0000013: 06 ; WASM_SECTION_END ;;; STDOUT ;;) diff --git a/test/dump/loop.txt b/test/dump/loop.txt index 87024491..e6c87138 100644 --- a/test/dump/loop.txt +++ b/test/dump/loop.txt @@ -13,14 +13,13 @@ 0000004: 02 ; WASM_SECTION_FUNCTIONS 0000005: 01 ; num functions ; function 0 -0000006: 01 ; func flags +0000006: 00 ; func flags 0000007: 0000 ; func signature index -0000009: 0000 0000 ; func name offset -000000d: 0000 ; func body size -000000f: 02 ; OPCODE_LOOP -0000010: 02 ; num expressions -0000011: 00 ; OPCODE_NOP -0000012: 00 ; OPCODE_NOP -000000d: 0400 ; FIXUP func body size -0000013: 06 ; WASM_SECTION_END +0000009: 0000 ; func body size +000000b: 02 ; OPCODE_LOOP +000000c: 02 ; num expressions +000000d: 00 ; OPCODE_NOP +000000e: 00 ; OPCODE_NOP +0000009: 0400 ; FIXUP func body size +000000f: 06 ; WASM_SECTION_END ;;; STDOUT ;;) diff --git a/test/dump/memory-size.txt b/test/dump/memory-size.txt index 98db1f6e..5108201f 100644 --- a/test/dump/memory-size.txt +++ b/test/dump/memory-size.txt @@ -16,11 +16,10 @@ 0000008: 02 ; WASM_SECTION_FUNCTIONS 0000009: 01 ; num functions ; function 0 -000000a: 01 ; func flags +000000a: 00 ; func flags 000000b: 0000 ; func signature index -000000d: 0000 0000 ; func name offset -0000011: 0000 ; func body size -0000013: 3b ; OPCODE_MEMORY_SIZE -0000011: 0100 ; FIXUP func body size -0000014: 06 ; WASM_SECTION_END +000000d: 0000 ; func body size +000000f: 3b ; OPCODE_MEMORY_SIZE +000000d: 0100 ; FIXUP func body size +0000010: 06 ; WASM_SECTION_END ;;; STDOUT ;;) diff --git a/test/dump/nop.txt b/test/dump/nop.txt index 40dce957..2f67dfae 100644 --- a/test/dump/nop.txt +++ b/test/dump/nop.txt @@ -10,11 +10,10 @@ 0000004: 02 ; WASM_SECTION_FUNCTIONS 0000005: 01 ; num functions ; function 0 -0000006: 01 ; func flags +0000006: 00 ; func flags 0000007: 0000 ; func signature index -0000009: 0000 0000 ; func name offset -000000d: 0000 ; func body size -000000f: 00 ; OPCODE_NOP -000000d: 0100 ; FIXUP func body size -0000010: 06 ; WASM_SECTION_END +0000009: 0000 ; func body size +000000b: 00 ; OPCODE_NOP +0000009: 0100 ; FIXUP func body size +000000c: 06 ; WASM_SECTION_END ;;; STDOUT ;;) diff --git a/test/dump/param-multi.txt b/test/dump/param-multi.txt index 8f0ef774..0bd6975c 100644 --- a/test/dump/param-multi.txt +++ b/test/dump/param-multi.txt @@ -14,10 +14,9 @@ 0000008: 02 ; WASM_SECTION_FUNCTIONS 0000009: 01 ; num functions ; function 0 -000000a: 01 ; func flags +000000a: 00 ; func flags 000000b: 0000 ; func signature index -000000d: 0000 0000 ; func name offset -0000011: 0000 ; func body size -0000011: 0000 ; FIXUP func body size -0000013: 06 ; WASM_SECTION_END +000000d: 0000 ; func body size +000000d: 0000 ; FIXUP func body size +000000f: 06 ; WASM_SECTION_END ;;; STDOUT ;;) diff --git a/test/dump/resize-memory.txt b/test/dump/resize-memory.txt index f71d305b..eeb528f1 100644 --- a/test/dump/resize-memory.txt +++ b/test/dump/resize-memory.txt @@ -17,13 +17,12 @@ 0000009: 02 ; WASM_SECTION_FUNCTIONS 000000a: 01 ; num functions ; function 0 -000000b: 01 ; func flags +000000b: 00 ; func flags 000000c: 0000 ; func signature index -000000e: 0000 0000 ; func name offset -0000012: 0000 ; func body size -0000014: 39 ; OPCODE_RESIZE_MEM_L -0000015: 0e ; OPCODE_GET_LOCAL -0000016: 00 ; remapped local index -0000012: 0300 ; FIXUP func body size -0000017: 06 ; WASM_SECTION_END +000000e: 0000 ; func body size +0000010: 39 ; OPCODE_RESIZE_MEM_L +0000011: 0e ; OPCODE_GET_LOCAL +0000012: 00 ; remapped local index +000000e: 0300 ; FIXUP func body size +0000013: 06 ; WASM_SECTION_END ;;; STDOUT ;;) diff --git a/test/dump/result.txt b/test/dump/result.txt index 2709abae..896bf287 100644 --- a/test/dump/result.txt +++ b/test/dump/result.txt @@ -22,36 +22,32 @@ 000000a: 02 ; WASM_SECTION_FUNCTIONS 000000b: 04 ; num functions ; function 0 -000000c: 01 ; func flags +000000c: 00 ; func flags 000000d: 0000 ; func signature index -000000f: 0000 0000 ; func name offset -0000013: 0000 ; func body size -0000015: 09 ; OPCODE_I8_CONST -0000016: 00 ; u8 literal -0000013: 0200 ; FIXUP func body size +000000f: 0000 ; func body size +0000011: 09 ; OPCODE_I8_CONST +0000012: 00 ; u8 literal +000000f: 0200 ; FIXUP func body size ; function 1 -0000017: 01 ; func flags -0000018: 0100 ; func signature index -000001a: 0000 0000 ; func name offset -000001e: 0000 ; func body size -0000020: 0b ; OPCODE_I64_CONST -0000021: 0000 0000 0000 0000 ; u64 literal -000001e: 0900 ; FIXUP func body size +0000013: 00 ; func flags +0000014: 0100 ; func signature index +0000016: 0000 ; func body size +0000018: 0b ; OPCODE_I64_CONST +0000019: 0000 0000 0000 0000 ; u64 literal +0000016: 0900 ; FIXUP func body size ; function 2 -0000029: 01 ; func flags -000002a: 0200 ; func signature index -000002c: 0000 0000 ; func name offset -0000030: 0000 ; func body size -0000032: 0d ; OPCODE_F32_CONST -0000033: 0000 0000 ; f32 literal -0000030: 0500 ; FIXUP func body size +0000021: 00 ; func flags +0000022: 0200 ; func signature index +0000024: 0000 ; func body size +0000026: 0d ; OPCODE_F32_CONST +0000027: 0000 0000 ; f32 literal +0000024: 0500 ; FIXUP func body size ; function 3 -0000037: 01 ; func flags -0000038: 0300 ; func signature index -000003a: 0000 0000 ; func name offset -000003e: 0000 ; func body size -0000040: 0c ; OPCODE_F64_CONST -0000041: 0000 0000 0000 0000 ; f64 literal -000003e: 0900 ; FIXUP func body size -0000049: 06 ; WASM_SECTION_END +000002b: 00 ; func flags +000002c: 0300 ; func signature index +000002e: 0000 ; func body size +0000030: 0c ; OPCODE_F64_CONST +0000031: 0000 0000 0000 0000 ; f64 literal +000002e: 0900 ; FIXUP func body size +0000039: 06 ; WASM_SECTION_END ;;; STDOUT ;;) diff --git a/test/dump/return.txt b/test/dump/return.txt index cb02e14a..88721172 100644 --- a/test/dump/return.txt +++ b/test/dump/return.txt @@ -15,20 +15,18 @@ 0000006: 02 ; WASM_SECTION_FUNCTIONS 0000007: 02 ; num functions ; function 0 -0000008: 01 ; func flags +0000008: 00 ; func flags 0000009: 0000 ; func signature index -000000b: 0000 0000 ; func name offset -000000f: 0000 ; func body size -0000011: 14 ; OPCODE_RETURN -0000012: 09 ; OPCODE_I8_CONST -0000013: 2a ; u8 literal -000000f: 0300 ; FIXUP func body size +000000b: 0000 ; func body size +000000d: 14 ; OPCODE_RETURN +000000e: 09 ; OPCODE_I8_CONST +000000f: 2a ; u8 literal +000000b: 0300 ; FIXUP func body size ; function 1 -0000014: 01 ; func flags -0000015: 0100 ; func signature index -0000017: 0000 0000 ; func name offset -000001b: 0000 ; func body size -000001d: 14 ; OPCODE_RETURN -000001b: 0100 ; FIXUP func body size -000001e: 06 ; WASM_SECTION_END +0000010: 00 ; func flags +0000011: 0100 ; func signature index +0000013: 0000 ; func body size +0000015: 14 ; OPCODE_RETURN +0000013: 0100 ; FIXUP func body size +0000016: 06 ; WASM_SECTION_END ;;; STDOUT ;;) diff --git a/test/dump/select.txt b/test/dump/select.txt index aebaae33..c6d172c2 100644 --- a/test/dump/select.txt +++ b/test/dump/select.txt @@ -14,38 +14,37 @@ 0000004: 02 ; WASM_SECTION_FUNCTIONS 0000005: 01 ; num functions ; function 0 -0000006: 01 ; func flags +0000006: 00 ; func flags 0000007: 0000 ; func signature index -0000009: 0000 0000 ; func name offset -000000d: 0000 ; func body size -000000f: 05 ; OPCODE_SELECT +0000009: 0000 ; func body size +000000b: 05 ; OPCODE_SELECT +000000c: 09 ; OPCODE_I8_CONST +000000d: 01 ; u8 literal +000000e: 09 ; OPCODE_I8_CONST +000000f: 02 ; u8 literal 0000010: 09 ; OPCODE_I8_CONST -0000011: 01 ; u8 literal -0000012: 09 ; OPCODE_I8_CONST -0000013: 02 ; u8 literal -0000014: 09 ; OPCODE_I8_CONST -0000015: 03 ; u8 literal -0000016: 05 ; OPCODE_SELECT -0000017: 09 ; OPCODE_I8_CONST -0000018: 01 ; u8 literal -0000019: 0b ; OPCODE_I64_CONST -000001a: 0200 0000 0000 0000 ; u64 literal -0000022: 0b ; OPCODE_I64_CONST -0000023: 0300 0000 0000 0000 ; u64 literal -000002b: 05 ; OPCODE_SELECT -000002c: 09 ; OPCODE_I8_CONST -000002d: 01 ; u8 literal -000002e: 0d ; OPCODE_F32_CONST -000002f: 0000 0040 ; f32 literal -0000033: 0d ; OPCODE_F32_CONST -0000034: 0000 4040 ; f32 literal -0000038: 05 ; OPCODE_SELECT -0000039: 09 ; OPCODE_I8_CONST -000003a: 01 ; u8 literal -000003b: 0c ; OPCODE_F64_CONST -000003c: 0000 0000 0000 0040 ; f64 literal -0000044: 0c ; OPCODE_F64_CONST -0000045: 0000 0000 0000 0840 ; f64 literal -000000d: 3e00 ; FIXUP func body size -000004d: 06 ; WASM_SECTION_END +0000011: 03 ; u8 literal +0000012: 05 ; OPCODE_SELECT +0000013: 09 ; OPCODE_I8_CONST +0000014: 01 ; u8 literal +0000015: 0b ; OPCODE_I64_CONST +0000016: 0200 0000 0000 0000 ; u64 literal +000001e: 0b ; OPCODE_I64_CONST +000001f: 0300 0000 0000 0000 ; u64 literal +0000027: 05 ; OPCODE_SELECT +0000028: 09 ; OPCODE_I8_CONST +0000029: 01 ; u8 literal +000002a: 0d ; OPCODE_F32_CONST +000002b: 0000 0040 ; f32 literal +000002f: 0d ; OPCODE_F32_CONST +0000030: 0000 4040 ; f32 literal +0000034: 05 ; OPCODE_SELECT +0000035: 09 ; OPCODE_I8_CONST +0000036: 01 ; u8 literal +0000037: 0c ; OPCODE_F64_CONST +0000038: 0000 0000 0000 0040 ; f64 literal +0000040: 0c ; OPCODE_F64_CONST +0000041: 0000 0000 0000 0840 ; f64 literal +0000009: 3e00 ; FIXUP func body size +0000049: 06 ; WASM_SECTION_END ;;; STDOUT ;;) diff --git a/test/dump/setlocal-param.txt b/test/dump/setlocal-param.txt index 992eae5c..090194fb 100644 --- a/test/dump/setlocal-param.txt +++ b/test/dump/setlocal-param.txt @@ -23,38 +23,37 @@ 0000006: 02 ; WASM_SECTION_FUNCTIONS 0000007: 01 ; num functions ; function 0 -0000008: 05 ; func flags +0000008: 04 ; func flags 0000009: 0000 ; func signature index -000000b: 0000 0000 ; func name offset -000000f: 0100 ; num local i32 -0000011: 0100 ; num local i64 -0000013: 0200 ; num local f32 -0000015: 0000 ; num local f64 -0000017: 0000 ; func body size +000000b: 0100 ; num local i32 +000000d: 0100 ; num local i64 +000000f: 0200 ; num local f32 +0000011: 0000 ; num local f64 +0000013: 0000 ; func body size +0000015: 0f ; OPCODE_SET_LOCAL +0000016: 00 ; remapped local index +0000017: 09 ; OPCODE_I8_CONST +0000018: 00 ; u8 literal 0000019: 0f ; OPCODE_SET_LOCAL -000001a: 00 ; remapped local index -000001b: 09 ; OPCODE_I8_CONST -000001c: 00 ; u8 literal -000001d: 0f ; OPCODE_SET_LOCAL -000001e: 01 ; remapped local index -000001f: 0d ; OPCODE_F32_CONST -0000020: 0000 0000 ; f32 literal -0000024: 0f ; OPCODE_SET_LOCAL -0000025: 03 ; remapped local index -0000026: 0b ; OPCODE_I64_CONST -0000027: 0000 0000 0000 0000 ; u64 literal -000002f: 0f ; OPCODE_SET_LOCAL -0000030: 04 ; remapped local index -0000031: 0d ; OPCODE_F32_CONST -0000032: 0000 0000 ; f32 literal +000001a: 01 ; remapped local index +000001b: 0d ; OPCODE_F32_CONST +000001c: 0000 0000 ; f32 literal +0000020: 0f ; OPCODE_SET_LOCAL +0000021: 03 ; remapped local index +0000022: 0b ; OPCODE_I64_CONST +0000023: 0000 0000 0000 0000 ; u64 literal +000002b: 0f ; OPCODE_SET_LOCAL +000002c: 04 ; remapped local index +000002d: 0d ; OPCODE_F32_CONST +000002e: 0000 0000 ; f32 literal +0000032: 0f ; OPCODE_SET_LOCAL +0000033: 02 ; remapped local index +0000034: 09 ; OPCODE_I8_CONST +0000035: 00 ; u8 literal 0000036: 0f ; OPCODE_SET_LOCAL -0000037: 02 ; remapped local index -0000038: 09 ; OPCODE_I8_CONST -0000039: 00 ; u8 literal -000003a: 0f ; OPCODE_SET_LOCAL -000003b: 05 ; remapped local index -000003c: 0d ; OPCODE_F32_CONST -000003d: 0000 0000 ; f32 literal -0000017: 2800 ; FIXUP func body size -0000041: 06 ; WASM_SECTION_END +0000037: 05 ; remapped local index +0000038: 0d ; OPCODE_F32_CONST +0000039: 0000 0000 ; f32 literal +0000013: 2800 ; FIXUP func body size +000003d: 06 ; WASM_SECTION_END ;;; STDOUT ;;) diff --git a/test/dump/setlocal.txt b/test/dump/setlocal.txt index ed367ddd..1a88a5d0 100644 --- a/test/dump/setlocal.txt +++ b/test/dump/setlocal.txt @@ -23,46 +23,45 @@ 0000004: 02 ; WASM_SECTION_FUNCTIONS 0000005: 01 ; num functions ; function 0 -0000006: 05 ; func flags +0000006: 04 ; func flags 0000007: 0000 ; func signature index -0000009: 0000 0000 ; func name offset -000000d: 0200 ; num local i32 -000000f: 0200 ; num local i64 -0000011: 0200 ; num local f32 -0000013: 0200 ; num local f64 -0000015: 0000 ; func body size -0000017: 0f ; OPCODE_SET_LOCAL -0000018: 06 ; remapped local index -0000019: 0c ; OPCODE_F64_CONST -000001a: 0000 0000 0000 0000 ; f64 literal -0000022: 0f ; OPCODE_SET_LOCAL -0000023: 04 ; remapped local index -0000024: 0d ; OPCODE_F32_CONST -0000025: 0000 0000 ; f32 literal -0000029: 0f ; OPCODE_SET_LOCAL -000002a: 02 ; remapped local index -000002b: 0b ; OPCODE_I64_CONST -000002c: 0000 0000 0000 0000 ; u64 literal +0000009: 0200 ; num local i32 +000000b: 0200 ; num local i64 +000000d: 0200 ; num local f32 +000000f: 0200 ; num local f64 +0000011: 0000 ; func body size +0000013: 0f ; OPCODE_SET_LOCAL +0000014: 06 ; remapped local index +0000015: 0c ; OPCODE_F64_CONST +0000016: 0000 0000 0000 0000 ; f64 literal +000001e: 0f ; OPCODE_SET_LOCAL +000001f: 04 ; remapped local index +0000020: 0d ; OPCODE_F32_CONST +0000021: 0000 0000 ; f32 literal +0000025: 0f ; OPCODE_SET_LOCAL +0000026: 02 ; remapped local index +0000027: 0b ; OPCODE_I64_CONST +0000028: 0000 0000 0000 0000 ; u64 literal +0000030: 0f ; OPCODE_SET_LOCAL +0000031: 00 ; remapped local index +0000032: 09 ; OPCODE_I8_CONST +0000033: 00 ; u8 literal 0000034: 0f ; OPCODE_SET_LOCAL -0000035: 00 ; remapped local index +0000035: 01 ; remapped local index 0000036: 09 ; OPCODE_I8_CONST 0000037: 00 ; u8 literal 0000038: 0f ; OPCODE_SET_LOCAL -0000039: 01 ; remapped local index -000003a: 09 ; OPCODE_I8_CONST -000003b: 00 ; u8 literal -000003c: 0f ; OPCODE_SET_LOCAL -000003d: 05 ; remapped local index -000003e: 0d ; OPCODE_F32_CONST -000003f: 0000 0000 ; f32 literal -0000043: 0f ; OPCODE_SET_LOCAL -0000044: 07 ; remapped local index -0000045: 0c ; OPCODE_F64_CONST -0000046: 0000 0000 0000 0000 ; f64 literal -000004e: 0f ; OPCODE_SET_LOCAL -000004f: 03 ; remapped local index -0000050: 0b ; OPCODE_I64_CONST -0000051: 0000 0000 0000 0000 ; u64 literal -0000015: 4200 ; FIXUP func body size -0000059: 06 ; WASM_SECTION_END +0000039: 05 ; remapped local index +000003a: 0d ; OPCODE_F32_CONST +000003b: 0000 0000 ; f32 literal +000003f: 0f ; OPCODE_SET_LOCAL +0000040: 07 ; remapped local index +0000041: 0c ; OPCODE_F64_CONST +0000042: 0000 0000 0000 0000 ; f64 literal +000004a: 0f ; OPCODE_SET_LOCAL +000004b: 03 ; remapped local index +000004c: 0b ; OPCODE_I64_CONST +000004d: 0000 0000 0000 0000 ; u64 literal +0000011: 4200 ; FIXUP func body size +0000055: 06 ; WASM_SECTION_END ;;; STDOUT ;;) diff --git a/test/dump/store-aligned.txt b/test/dump/store-aligned.txt index 774e17b3..8dd5ab5c 100644 --- a/test/dump/store-aligned.txt +++ b/test/dump/store-aligned.txt @@ -44,178 +44,177 @@ 0000004: 02 ; WASM_SECTION_FUNCTIONS 0000005: 01 ; num functions ; function 0 -0000006: 01 ; func flags +0000006: 00 ; func flags 0000007: 0000 ; func signature index -0000009: 0000 0000 ; func name offset -000000d: 0000 ; func body size -000000f: 2e ; OPCODE_I32_STORE_MEM8 -0000010: 00 ; store access byte -0000011: 09 ; OPCODE_I8_CONST -0000012: 00 ; u8 literal +0000009: 0000 ; func body size +000000b: 2e ; OPCODE_I32_STORE_MEM8 +000000c: 00 ; store access byte +000000d: 09 ; OPCODE_I8_CONST +000000e: 00 ; u8 literal +000000f: 09 ; OPCODE_I8_CONST +0000010: 00 ; u8 literal +0000011: 2e ; OPCODE_I32_STORE_MEM8 +0000012: 00 ; store access byte 0000013: 09 ; OPCODE_I8_CONST 0000014: 00 ; u8 literal -0000015: 2e ; OPCODE_I32_STORE_MEM8 -0000016: 00 ; store access byte -0000017: 09 ; OPCODE_I8_CONST -0000018: 00 ; u8 literal +0000015: 09 ; OPCODE_I8_CONST +0000016: 00 ; u8 literal +0000017: 2e ; OPCODE_I32_STORE_MEM8 +0000018: 00 ; store access byte 0000019: 09 ; OPCODE_I8_CONST 000001a: 00 ; u8 literal -000001b: 2e ; OPCODE_I32_STORE_MEM8 -000001c: 00 ; store access byte -000001d: 09 ; OPCODE_I8_CONST -000001e: 00 ; u8 literal +000001b: 09 ; OPCODE_I8_CONST +000001c: 00 ; u8 literal +000001d: 2e ; OPCODE_I32_STORE_MEM8 +000001e: 00 ; store access byte 000001f: 09 ; OPCODE_I8_CONST 0000020: 00 ; u8 literal -0000021: 2e ; OPCODE_I32_STORE_MEM8 -0000022: 00 ; store access byte -0000023: 09 ; OPCODE_I8_CONST -0000024: 00 ; u8 literal +0000021: 09 ; OPCODE_I8_CONST +0000022: 00 ; u8 literal +0000023: 2f ; OPCODE_I32_STORE_MEM16 +0000024: 00 ; store access byte 0000025: 09 ; OPCODE_I8_CONST 0000026: 00 ; u8 literal -0000027: 2f ; OPCODE_I32_STORE_MEM16 -0000028: 00 ; store access byte -0000029: 09 ; OPCODE_I8_CONST -000002a: 00 ; u8 literal +0000027: 09 ; OPCODE_I8_CONST +0000028: 00 ; u8 literal +0000029: 2f ; OPCODE_I32_STORE_MEM16 +000002a: 00 ; store access byte 000002b: 09 ; OPCODE_I8_CONST 000002c: 00 ; u8 literal -000002d: 2f ; OPCODE_I32_STORE_MEM16 -000002e: 00 ; store access byte -000002f: 09 ; OPCODE_I8_CONST -0000030: 00 ; u8 literal +000002d: 09 ; OPCODE_I8_CONST +000002e: 00 ; u8 literal +000002f: 2f ; OPCODE_I32_STORE_MEM16 +0000030: 00 ; store access byte 0000031: 09 ; OPCODE_I8_CONST 0000032: 00 ; u8 literal -0000033: 2f ; OPCODE_I32_STORE_MEM16 -0000034: 00 ; store access byte -0000035: 09 ; OPCODE_I8_CONST -0000036: 00 ; u8 literal +0000033: 09 ; OPCODE_I8_CONST +0000034: 00 ; u8 literal +0000035: 2f ; OPCODE_I32_STORE_MEM16 +0000036: 00 ; store access byte 0000037: 09 ; OPCODE_I8_CONST 0000038: 00 ; u8 literal -0000039: 2f ; OPCODE_I32_STORE_MEM16 -000003a: 00 ; store access byte -000003b: 09 ; OPCODE_I8_CONST -000003c: 00 ; u8 literal +0000039: 09 ; OPCODE_I8_CONST +000003a: 00 ; u8 literal +000003b: 33 ; OPCODE_I32_STORE_MEM +000003c: 00 ; store access byte 000003d: 09 ; OPCODE_I8_CONST 000003e: 00 ; u8 literal -000003f: 33 ; OPCODE_I32_STORE_MEM -0000040: 00 ; store access byte -0000041: 09 ; OPCODE_I8_CONST -0000042: 00 ; u8 literal +000003f: 09 ; OPCODE_I8_CONST +0000040: 00 ; u8 literal +0000041: 33 ; OPCODE_I32_STORE_MEM +0000042: 00 ; store access byte 0000043: 09 ; OPCODE_I8_CONST 0000044: 00 ; u8 literal -0000045: 33 ; OPCODE_I32_STORE_MEM -0000046: 00 ; store access byte -0000047: 09 ; OPCODE_I8_CONST -0000048: 00 ; u8 literal +0000045: 09 ; OPCODE_I8_CONST +0000046: 00 ; u8 literal +0000047: 33 ; OPCODE_I32_STORE_MEM +0000048: 00 ; store access byte 0000049: 09 ; OPCODE_I8_CONST 000004a: 00 ; u8 literal -000004b: 33 ; OPCODE_I32_STORE_MEM -000004c: 00 ; store access byte -000004d: 09 ; OPCODE_I8_CONST -000004e: 00 ; u8 literal +000004b: 09 ; OPCODE_I8_CONST +000004c: 00 ; u8 literal +000004d: 33 ; OPCODE_I32_STORE_MEM +000004e: 00 ; store access byte 000004f: 09 ; OPCODE_I8_CONST 0000050: 00 ; u8 literal -0000051: 33 ; OPCODE_I32_STORE_MEM -0000052: 00 ; store access byte -0000053: 09 ; OPCODE_I8_CONST -0000054: 00 ; u8 literal +0000051: 09 ; OPCODE_I8_CONST +0000052: 00 ; u8 literal +0000053: 34 ; OPCODE_I64_STORE_MEM +0000054: 00 ; store access byte 0000055: 09 ; OPCODE_I8_CONST 0000056: 00 ; u8 literal -0000057: 34 ; OPCODE_I64_STORE_MEM -0000058: 00 ; store access byte -0000059: 09 ; OPCODE_I8_CONST -000005a: 00 ; u8 literal -000005b: 0b ; OPCODE_I64_CONST -000005c: 0000 0000 0000 0000 ; u64 literal -0000064: 34 ; OPCODE_I64_STORE_MEM -0000065: 00 ; store access byte -0000066: 09 ; OPCODE_I8_CONST -0000067: 00 ; u8 literal -0000068: 0b ; OPCODE_I64_CONST -0000069: 0000 0000 0000 0000 ; u64 literal -0000071: 34 ; OPCODE_I64_STORE_MEM -0000072: 00 ; store access byte -0000073: 09 ; OPCODE_I8_CONST -0000074: 00 ; u8 literal -0000075: 0b ; OPCODE_I64_CONST -0000076: 0000 0000 0000 0000 ; u64 literal -000007e: 34 ; OPCODE_I64_STORE_MEM -000007f: 00 ; store access byte -0000080: 09 ; OPCODE_I8_CONST -0000081: 00 ; u8 literal -0000082: 0b ; OPCODE_I64_CONST -0000083: 0000 0000 0000 0000 ; u64 literal -000008b: 30 ; OPCODE_I64_STORE_MEM8 -000008c: 00 ; store access byte -000008d: 09 ; OPCODE_I8_CONST -000008e: 00 ; u8 literal -000008f: 0b ; OPCODE_I64_CONST -0000090: 0000 0000 0000 0000 ; u64 literal -0000098: 30 ; OPCODE_I64_STORE_MEM8 -0000099: 00 ; store access byte -000009a: 09 ; OPCODE_I8_CONST -000009b: 00 ; u8 literal -000009c: 0b ; OPCODE_I64_CONST -000009d: 0000 0000 0000 0000 ; u64 literal -00000a5: 30 ; OPCODE_I64_STORE_MEM8 -00000a6: 00 ; store access byte -00000a7: 09 ; OPCODE_I8_CONST -00000a8: 00 ; u8 literal -00000a9: 0b ; OPCODE_I64_CONST -00000aa: 0000 0000 0000 0000 ; u64 literal -00000b2: 30 ; OPCODE_I64_STORE_MEM8 -00000b3: 00 ; store access byte -00000b4: 09 ; OPCODE_I8_CONST -00000b5: 00 ; u8 literal -00000b6: 0b ; OPCODE_I64_CONST -00000b7: 0000 0000 0000 0000 ; u64 literal -00000bf: 31 ; OPCODE_I64_STORE_MEM16 -00000c0: 00 ; store access byte -00000c1: 09 ; OPCODE_I8_CONST -00000c2: 00 ; u8 literal -00000c3: 0b ; OPCODE_I64_CONST -00000c4: 0000 0000 0000 0000 ; u64 literal -00000cc: 31 ; OPCODE_I64_STORE_MEM16 -00000cd: 00 ; store access byte -00000ce: 09 ; OPCODE_I8_CONST -00000cf: 00 ; u8 literal -00000d0: 0b ; OPCODE_I64_CONST -00000d1: 0000 0000 0000 0000 ; u64 literal -00000d9: 31 ; OPCODE_I64_STORE_MEM16 -00000da: 00 ; store access byte -00000db: 09 ; OPCODE_I8_CONST -00000dc: 00 ; u8 literal -00000dd: 0b ; OPCODE_I64_CONST -00000de: 0000 0000 0000 0000 ; u64 literal -00000e6: 31 ; OPCODE_I64_STORE_MEM16 -00000e7: 00 ; store access byte -00000e8: 09 ; OPCODE_I8_CONST -00000e9: 00 ; u8 literal -00000ea: 0b ; OPCODE_I64_CONST -00000eb: 0000 0000 0000 0000 ; u64 literal -00000f3: 34 ; OPCODE_I64_STORE_MEM -00000f4: 00 ; store access byte -00000f5: 09 ; OPCODE_I8_CONST -00000f6: 00 ; u8 literal -00000f7: 0b ; OPCODE_I64_CONST -00000f8: 0000 0000 0000 0000 ; u64 literal -0000100: 34 ; OPCODE_I64_STORE_MEM -0000101: 00 ; store access byte -0000102: 09 ; OPCODE_I8_CONST -0000103: 00 ; u8 literal -0000104: 0b ; OPCODE_I64_CONST -0000105: 0000 0000 0000 0000 ; u64 literal -000010d: 34 ; OPCODE_I64_STORE_MEM -000010e: 00 ; store access byte -000010f: 09 ; OPCODE_I8_CONST -0000110: 00 ; u8 literal -0000111: 0b ; OPCODE_I64_CONST -0000112: 0000 0000 0000 0000 ; u64 literal -000011a: 34 ; OPCODE_I64_STORE_MEM -000011b: 00 ; store access byte -000011c: 09 ; OPCODE_I8_CONST -000011d: 00 ; u8 literal -000011e: 0b ; OPCODE_I64_CONST -000011f: 0000 0000 0000 0000 ; u64 literal -000000d: 1801 ; FIXUP func body size -0000127: 06 ; WASM_SECTION_END +0000057: 0b ; OPCODE_I64_CONST +0000058: 0000 0000 0000 0000 ; u64 literal +0000060: 34 ; OPCODE_I64_STORE_MEM +0000061: 00 ; store access byte +0000062: 09 ; OPCODE_I8_CONST +0000063: 00 ; u8 literal +0000064: 0b ; OPCODE_I64_CONST +0000065: 0000 0000 0000 0000 ; u64 literal +000006d: 34 ; OPCODE_I64_STORE_MEM +000006e: 00 ; store access byte +000006f: 09 ; OPCODE_I8_CONST +0000070: 00 ; u8 literal +0000071: 0b ; OPCODE_I64_CONST +0000072: 0000 0000 0000 0000 ; u64 literal +000007a: 34 ; OPCODE_I64_STORE_MEM +000007b: 00 ; store access byte +000007c: 09 ; OPCODE_I8_CONST +000007d: 00 ; u8 literal +000007e: 0b ; OPCODE_I64_CONST +000007f: 0000 0000 0000 0000 ; u64 literal +0000087: 30 ; OPCODE_I64_STORE_MEM8 +0000088: 00 ; store access byte +0000089: 09 ; OPCODE_I8_CONST +000008a: 00 ; u8 literal +000008b: 0b ; OPCODE_I64_CONST +000008c: 0000 0000 0000 0000 ; u64 literal +0000094: 30 ; OPCODE_I64_STORE_MEM8 +0000095: 00 ; store access byte +0000096: 09 ; OPCODE_I8_CONST +0000097: 00 ; u8 literal +0000098: 0b ; OPCODE_I64_CONST +0000099: 0000 0000 0000 0000 ; u64 literal +00000a1: 30 ; OPCODE_I64_STORE_MEM8 +00000a2: 00 ; store access byte +00000a3: 09 ; OPCODE_I8_CONST +00000a4: 00 ; u8 literal +00000a5: 0b ; OPCODE_I64_CONST +00000a6: 0000 0000 0000 0000 ; u64 literal +00000ae: 30 ; OPCODE_I64_STORE_MEM8 +00000af: 00 ; store access byte +00000b0: 09 ; OPCODE_I8_CONST +00000b1: 00 ; u8 literal +00000b2: 0b ; OPCODE_I64_CONST +00000b3: 0000 0000 0000 0000 ; u64 literal +00000bb: 31 ; OPCODE_I64_STORE_MEM16 +00000bc: 00 ; store access byte +00000bd: 09 ; OPCODE_I8_CONST +00000be: 00 ; u8 literal +00000bf: 0b ; OPCODE_I64_CONST +00000c0: 0000 0000 0000 0000 ; u64 literal +00000c8: 31 ; OPCODE_I64_STORE_MEM16 +00000c9: 00 ; store access byte +00000ca: 09 ; OPCODE_I8_CONST +00000cb: 00 ; u8 literal +00000cc: 0b ; OPCODE_I64_CONST +00000cd: 0000 0000 0000 0000 ; u64 literal +00000d5: 31 ; OPCODE_I64_STORE_MEM16 +00000d6: 00 ; store access byte +00000d7: 09 ; OPCODE_I8_CONST +00000d8: 00 ; u8 literal +00000d9: 0b ; OPCODE_I64_CONST +00000da: 0000 0000 0000 0000 ; u64 literal +00000e2: 31 ; OPCODE_I64_STORE_MEM16 +00000e3: 00 ; store access byte +00000e4: 09 ; OPCODE_I8_CONST +00000e5: 00 ; u8 literal +00000e6: 0b ; OPCODE_I64_CONST +00000e7: 0000 0000 0000 0000 ; u64 literal +00000ef: 34 ; OPCODE_I64_STORE_MEM +00000f0: 00 ; store access byte +00000f1: 09 ; OPCODE_I8_CONST +00000f2: 00 ; u8 literal +00000f3: 0b ; OPCODE_I64_CONST +00000f4: 0000 0000 0000 0000 ; u64 literal +00000fc: 34 ; OPCODE_I64_STORE_MEM +00000fd: 00 ; store access byte +00000fe: 09 ; OPCODE_I8_CONST +00000ff: 00 ; u8 literal +0000100: 0b ; OPCODE_I64_CONST +0000101: 0000 0000 0000 0000 ; u64 literal +0000109: 34 ; OPCODE_I64_STORE_MEM +000010a: 00 ; store access byte +000010b: 09 ; OPCODE_I8_CONST +000010c: 00 ; u8 literal +000010d: 0b ; OPCODE_I64_CONST +000010e: 0000 0000 0000 0000 ; u64 literal +0000116: 34 ; OPCODE_I64_STORE_MEM +0000117: 00 ; store access byte +0000118: 09 ; OPCODE_I8_CONST +0000119: 00 ; u8 literal +000011a: 0b ; OPCODE_I64_CONST +000011b: 0000 0000 0000 0000 ; u64 literal +0000009: 1801 ; FIXUP func body size +0000123: 06 ; WASM_SECTION_END ;;; STDOUT ;;) diff --git a/test/dump/store.txt b/test/dump/store.txt index 2e23d7f9..367ac486 100644 --- a/test/dump/store.txt +++ b/test/dump/store.txt @@ -19,64 +19,63 @@ 0000004: 02 ; WASM_SECTION_FUNCTIONS 0000005: 01 ; num functions ; function 0 -0000006: 01 ; func flags +0000006: 00 ; func flags 0000007: 0000 ; func signature index -0000009: 0000 0000 ; func name offset -000000d: 0000 ; func body size -000000f: 2e ; OPCODE_I32_STORE_MEM8 -0000010: 00 ; store access byte -0000011: 09 ; OPCODE_I8_CONST -0000012: 00 ; u8 literal +0000009: 0000 ; func body size +000000b: 2e ; OPCODE_I32_STORE_MEM8 +000000c: 00 ; store access byte +000000d: 09 ; OPCODE_I8_CONST +000000e: 00 ; u8 literal +000000f: 09 ; OPCODE_I8_CONST +0000010: 00 ; u8 literal +0000011: 2f ; OPCODE_I32_STORE_MEM16 +0000012: 00 ; store access byte 0000013: 09 ; OPCODE_I8_CONST 0000014: 00 ; u8 literal -0000015: 2f ; OPCODE_I32_STORE_MEM16 -0000016: 00 ; store access byte -0000017: 09 ; OPCODE_I8_CONST -0000018: 00 ; u8 literal +0000015: 09 ; OPCODE_I8_CONST +0000016: 00 ; u8 literal +0000017: 33 ; OPCODE_I32_STORE_MEM +0000018: 00 ; store access byte 0000019: 09 ; OPCODE_I8_CONST 000001a: 00 ; u8 literal -000001b: 33 ; OPCODE_I32_STORE_MEM -000001c: 00 ; store access byte -000001d: 09 ; OPCODE_I8_CONST -000001e: 00 ; u8 literal +000001b: 09 ; OPCODE_I8_CONST +000001c: 00 ; u8 literal +000001d: 34 ; OPCODE_I64_STORE_MEM +000001e: 00 ; store access byte 000001f: 09 ; OPCODE_I8_CONST 0000020: 00 ; u8 literal -0000021: 34 ; OPCODE_I64_STORE_MEM -0000022: 00 ; store access byte -0000023: 09 ; OPCODE_I8_CONST -0000024: 00 ; u8 literal -0000025: 0b ; OPCODE_I64_CONST -0000026: 0000 0000 0000 0000 ; u64 literal -000002e: 30 ; OPCODE_I64_STORE_MEM8 -000002f: 00 ; store access byte -0000030: 09 ; OPCODE_I8_CONST -0000031: 00 ; u8 literal -0000032: 0b ; OPCODE_I64_CONST -0000033: 0000 0000 0000 0000 ; u64 literal -000003b: 31 ; OPCODE_I64_STORE_MEM16 -000003c: 00 ; store access byte -000003d: 09 ; OPCODE_I8_CONST -000003e: 00 ; u8 literal -000003f: 0b ; OPCODE_I64_CONST -0000040: 0000 0000 0000 0000 ; u64 literal -0000048: 32 ; OPCODE_I64_STORE_MEM32 -0000049: 00 ; store access byte -000004a: 09 ; OPCODE_I8_CONST -000004b: 00 ; u8 literal -000004c: 0b ; OPCODE_I64_CONST -000004d: 0000 0000 0000 0000 ; u64 literal -0000055: 35 ; OPCODE_F32_STORE_MEM -0000056: 00 ; store access byte -0000057: 09 ; OPCODE_I8_CONST -0000058: 00 ; u8 literal -0000059: 0d ; OPCODE_F32_CONST -000005a: 0000 0000 ; f32 literal -000005e: 36 ; OPCODE_F64_STORE_MEM -000005f: 00 ; store access byte -0000060: 09 ; OPCODE_I8_CONST -0000061: 00 ; u8 literal -0000062: 0c ; OPCODE_F64_CONST -0000063: 0000 0000 0000 0000 ; f64 literal -000000d: 5c00 ; FIXUP func body size -000006b: 06 ; WASM_SECTION_END +0000021: 0b ; OPCODE_I64_CONST +0000022: 0000 0000 0000 0000 ; u64 literal +000002a: 30 ; OPCODE_I64_STORE_MEM8 +000002b: 00 ; store access byte +000002c: 09 ; OPCODE_I8_CONST +000002d: 00 ; u8 literal +000002e: 0b ; OPCODE_I64_CONST +000002f: 0000 0000 0000 0000 ; u64 literal +0000037: 31 ; OPCODE_I64_STORE_MEM16 +0000038: 00 ; store access byte +0000039: 09 ; OPCODE_I8_CONST +000003a: 00 ; u8 literal +000003b: 0b ; OPCODE_I64_CONST +000003c: 0000 0000 0000 0000 ; u64 literal +0000044: 32 ; OPCODE_I64_STORE_MEM32 +0000045: 00 ; store access byte +0000046: 09 ; OPCODE_I8_CONST +0000047: 00 ; u8 literal +0000048: 0b ; OPCODE_I64_CONST +0000049: 0000 0000 0000 0000 ; u64 literal +0000051: 35 ; OPCODE_F32_STORE_MEM +0000052: 00 ; store access byte +0000053: 09 ; OPCODE_I8_CONST +0000054: 00 ; u8 literal +0000055: 0d ; OPCODE_F32_CONST +0000056: 0000 0000 ; f32 literal +000005a: 36 ; OPCODE_F64_STORE_MEM +000005b: 00 ; store access byte +000005c: 09 ; OPCODE_I8_CONST +000005d: 00 ; u8 literal +000005e: 0c ; OPCODE_F64_CONST +000005f: 0000 0000 0000 0000 ; f64 literal +0000009: 5c00 ; FIXUP func body size +0000067: 06 ; WASM_SECTION_END ;;; STDOUT ;;) diff --git a/test/dump/storeglobal.txt b/test/dump/storeglobal.txt index ffc83804..8917eeea 100644 --- a/test/dump/storeglobal.txt +++ b/test/dump/storeglobal.txt @@ -33,26 +33,25 @@ 000001e: 02 ; WASM_SECTION_FUNCTIONS 000001f: 01 ; num functions ; function 0 -0000020: 01 ; func flags +0000020: 00 ; func flags 0000021: 0000 ; func signature index -0000023: 0000 0000 ; func name offset -0000027: 0000 ; func body size +0000023: 0000 ; func body size +0000025: 11 ; OPCODE_STORE_GLOBAL +0000026: 00 ; global index +0000027: 09 ; OPCODE_I8_CONST +0000028: 00 ; u8 literal 0000029: 11 ; OPCODE_STORE_GLOBAL -000002a: 00 ; global index -000002b: 09 ; OPCODE_I8_CONST -000002c: 00 ; u8 literal -000002d: 11 ; OPCODE_STORE_GLOBAL -000002e: 01 ; global index -000002f: 0b ; OPCODE_I64_CONST -0000030: 0100 0000 0000 0000 ; u64 literal -0000038: 11 ; OPCODE_STORE_GLOBAL -0000039: 02 ; global index -000003a: 0d ; OPCODE_F32_CONST -000003b: 0000 0040 ; f32 literal -000003f: 11 ; OPCODE_STORE_GLOBAL -0000040: 03 ; global index -0000041: 0c ; OPCODE_F64_CONST -0000042: 0000 0000 0000 0840 ; f64 literal -0000027: 2100 ; FIXUP func body size -000004a: 06 ; WASM_SECTION_END +000002a: 01 ; global index +000002b: 0b ; OPCODE_I64_CONST +000002c: 0100 0000 0000 0000 ; u64 literal +0000034: 11 ; OPCODE_STORE_GLOBAL +0000035: 02 ; global index +0000036: 0d ; OPCODE_F32_CONST +0000037: 0000 0040 ; f32 literal +000003b: 11 ; OPCODE_STORE_GLOBAL +000003c: 03 ; global index +000003d: 0c ; OPCODE_F64_CONST +000003e: 0000 0000 0000 0840 ; f64 literal +0000023: 2100 ; FIXUP func body size +0000046: 06 ; WASM_SECTION_END ;;; STDOUT ;;) diff --git a/test/dump/table.txt b/test/dump/table.txt index fb3b8d2e..f0b9968e 100644 --- a/test/dump/table.txt +++ b/test/dump/table.txt @@ -23,30 +23,27 @@ 000000b: 02 ; WASM_SECTION_FUNCTIONS 000000c: 03 ; num functions ; function 0 -000000d: 01 ; func flags +000000d: 00 ; func flags 000000e: 0000 ; func signature index -0000010: 0000 0000 ; func name offset -0000014: 0000 ; func body size -0000014: 0000 ; FIXUP func body size +0000010: 0000 ; func body size +0000010: 0000 ; FIXUP func body size ; function 1 -0000016: 01 ; func flags -0000017: 0100 ; func signature index -0000019: 0000 0000 ; func name offset -000001d: 0000 ; func body size -000001d: 0000 ; FIXUP func body size +0000012: 00 ; func flags +0000013: 0100 ; func signature index +0000015: 0000 ; func body size +0000015: 0000 ; FIXUP func body size ; function 2 -000001f: 01 ; func flags -0000020: 0200 ; func signature index -0000022: 0000 0000 ; func name offset -0000026: 0000 ; func body size -0000028: 0c ; OPCODE_F64_CONST -0000029: 0000 0000 0000 0000 ; f64 literal -0000026: 0900 ; FIXUP func body size -0000031: 05 ; WASM_SECTION_FUNCTION_TABLE -0000032: 04 ; num function table entries -0000033: 0000 ; function table entry -0000035: 0000 ; function table entry -0000037: 0100 ; function table entry -0000039: 0200 ; function table entry -000003b: 06 ; WASM_SECTION_END +0000017: 00 ; func flags +0000018: 0200 ; func signature index +000001a: 0000 ; func body size +000001c: 0c ; OPCODE_F64_CONST +000001d: 0000 0000 0000 0000 ; f64 literal +000001a: 0900 ; FIXUP func body size +0000025: 05 ; WASM_SECTION_FUNCTION_TABLE +0000026: 04 ; num function table entries +0000027: 0000 ; function table entry +0000029: 0000 ; function table entry +000002b: 0100 ; function table entry +000002d: 0200 ; function table entry +000002f: 06 ; WASM_SECTION_END ;;; STDOUT ;;) diff --git a/test/dump/tableswitch.txt b/test/dump/tableswitch.txt index d140eac9..3bcf894c 100644 --- a/test/dump/tableswitch.txt +++ b/test/dump/tableswitch.txt @@ -16,29 +16,28 @@ 0000004: 02 ; WASM_SECTION_FUNCTIONS 0000005: 01 ; num functions ; function 0 -0000006: 01 ; func flags +0000006: 00 ; func flags 0000007: 0000 ; func signature index -0000009: 0000 0000 ; func name offset -000000d: 0000 ; func body size -000000f: 01 ; OPCODE_BLOCK -0000010: 01 ; num expressions -0000011: 08 ; OPCODE_TABLESWITCH -0000012: 0300 ; num cases -0000014: 0300 ; num targets -0000016: 0000 ; case index -0000018: 0100 ; case index -000001a: 0180 ; br depth +0000009: 0000 ; func body size +000000b: 01 ; OPCODE_BLOCK +000000c: 01 ; num expressions +000000d: 08 ; OPCODE_TABLESWITCH +000000e: 0300 ; num cases +0000010: 0300 ; num targets +0000012: 0000 ; case index +0000014: 0100 ; case index +0000016: 0180 ; br depth +0000018: 09 ; OPCODE_I8_CONST +0000019: 00 ; u8 literal +000001a: 01 ; OPCODE_BLOCK +000001b: 02 ; num expressions 000001c: 09 ; OPCODE_I8_CONST -000001d: 00 ; u8 literal -000001e: 01 ; OPCODE_BLOCK -000001f: 02 ; num expressions -0000020: 09 ; OPCODE_I8_CONST -0000021: 01 ; u8 literal -0000022: 09 ; OPCODE_I8_CONST -0000023: 02 ; u8 literal -0000024: 00 ; WASM_OPCODE_NOP for fallthrough -0000025: 09 ; OPCODE_I8_CONST -0000026: 03 ; u8 literal -000000d: 1800 ; FIXUP func body size -0000027: 06 ; WASM_SECTION_END +000001d: 01 ; u8 literal +000001e: 09 ; OPCODE_I8_CONST +000001f: 02 ; u8 literal +0000020: 00 ; WASM_OPCODE_NOP for fallthrough +0000021: 09 ; OPCODE_I8_CONST +0000022: 03 ; u8 literal +0000009: 1800 ; FIXUP func body size +0000023: 06 ; WASM_SECTION_END ;;; STDOUT ;;) diff --git a/test/dump/unary.txt b/test/dump/unary.txt index 46efdd3e..bf6a9208 100644 --- a/test/dump/unary.txt +++ b/test/dump/unary.txt @@ -34,39 +34,38 @@ 0000004: 02 ; WASM_SECTION_FUNCTIONS 0000005: 01 ; num functions ; function 0 -0000006: 01 ; func flags +0000006: 00 ; func flags 0000007: 0000 ; func signature index -0000009: 0000 0000 ; func name offset -000000d: 0000 ; func body size -000000f: 5a ; OPCODE_BOOL_NOT -0000010: 57 ; OPCODE_I32_CLZ -0000011: 58 ; OPCODE_I32_CTZ -0000012: 59 ; OPCODE_I32_POPCNT -0000013: 09 ; OPCODE_I8_CONST -0000014: 00 ; u8 literal -0000015: 72 ; OPCODE_I64_CLZ -0000016: 73 ; OPCODE_I64_CTZ -0000017: 74 ; OPCODE_I64_POPCNT -0000018: 0b ; OPCODE_I64_CONST -0000019: 0000 0000 0000 0000 ; u64 literal -0000021: 7c ; OPCODE_F32_NEG -0000022: 7b ; OPCODE_F32_ABS -0000023: 82 ; OPCODE_F32_SQRT -0000024: 7e ; OPCODE_F32_CEIL -0000025: 7f ; OPCODE_F32_FLOOR -0000026: 80 ; OPCODE_F32_TRUNC -0000027: 81 ; OPCODE_F32_NEAREST_INT -0000028: 0d ; OPCODE_F32_CONST -0000029: 0000 0000 ; f32 literal -000002d: 90 ; OPCODE_F64_NEG -000002e: 8f ; OPCODE_F64_ABS -000002f: 96 ; OPCODE_F64_SQRT -0000030: 92 ; OPCODE_F64_CEIL -0000031: 93 ; OPCODE_F64_FLOOR -0000032: 94 ; OPCODE_F64_TRUNC -0000033: 95 ; OPCODE_F64_NEAREST_INT -0000034: 0c ; OPCODE_F64_CONST -0000035: 0000 0000 0000 0000 ; f64 literal -000000d: 2e00 ; FIXUP func body size -000003d: 06 ; WASM_SECTION_END +0000009: 0000 ; func body size +000000b: 5a ; OPCODE_BOOL_NOT +000000c: 57 ; OPCODE_I32_CLZ +000000d: 58 ; OPCODE_I32_CTZ +000000e: 59 ; OPCODE_I32_POPCNT +000000f: 09 ; OPCODE_I8_CONST +0000010: 00 ; u8 literal +0000011: 72 ; OPCODE_I64_CLZ +0000012: 73 ; OPCODE_I64_CTZ +0000013: 74 ; OPCODE_I64_POPCNT +0000014: 0b ; OPCODE_I64_CONST +0000015: 0000 0000 0000 0000 ; u64 literal +000001d: 7c ; OPCODE_F32_NEG +000001e: 7b ; OPCODE_F32_ABS +000001f: 82 ; OPCODE_F32_SQRT +0000020: 7e ; OPCODE_F32_CEIL +0000021: 7f ; OPCODE_F32_FLOOR +0000022: 80 ; OPCODE_F32_TRUNC +0000023: 81 ; OPCODE_F32_NEAREST_INT +0000024: 0d ; OPCODE_F32_CONST +0000025: 0000 0000 ; f32 literal +0000029: 90 ; OPCODE_F64_NEG +000002a: 8f ; OPCODE_F64_ABS +000002b: 96 ; OPCODE_F64_SQRT +000002c: 92 ; OPCODE_F64_CEIL +000002d: 93 ; OPCODE_F64_FLOOR +000002e: 94 ; OPCODE_F64_TRUNC +000002f: 95 ; OPCODE_F64_NEAREST_INT +0000030: 0c ; OPCODE_F64_CONST +0000031: 0000 0000 0000 0000 ; f64 literal +0000009: 2e00 ; FIXUP func body size +0000039: 06 ; WASM_SECTION_END ;;; STDOUT ;;) diff --git a/test/dump/unreachable.txt b/test/dump/unreachable.txt index 37813f24..e34fd5a1 100644 --- a/test/dump/unreachable.txt +++ b/test/dump/unreachable.txt @@ -11,11 +11,10 @@ 0000004: 02 ; WASM_SECTION_FUNCTIONS 0000005: 01 ; num functions ; function 0 -0000006: 01 ; func flags +0000006: 00 ; func flags 0000007: 0000 ; func signature index -0000009: 0000 0000 ; func name offset -000000d: 0000 ; func body size -000000f: 15 ; OPCODE_UNREACHABLE -000000d: 0100 ; FIXUP func body size -0000010: 06 ; WASM_SECTION_END +0000009: 0000 ; func body size +000000b: 15 ; OPCODE_UNREACHABLE +0000009: 0100 ; FIXUP func body size +000000c: 06 ; WASM_SECTION_END ;;; STDOUT ;;) |