blob: 8ceda9357a491039b8b0fc5c882c8b7c6e75641a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
|
;;; FLAGS: -dv
(module
(func
(if (i32.const 1) (nop))
(if (i32.const 0) (f32.const 1.0) (f32.const 2.0)))
(func
(if (i32.const 1) (return) (return))))
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
0000004: 0b00 0000 ; WASM_BINARY_VERSION
; section "type"
0000008: 04 ; string length
0000009: 7479 7065 ; section id: "type"
000000d: 00 ; section size (guess)
000000e: 01 ; num types
; type 0
000000f: 40 ; function form
0000010: 00 ; num params
0000011: 00 ; num results
000000d: 04 ; FIXUP section size
; section "function"
0000012: 08 ; string length
0000013: 6675 6e63 7469 6f6e ; section id: "function"
000001b: 00 ; section size (guess)
000001c: 02 ; num functions
000001d: 00 ; function 0 signature index
000001e: 00 ; function 1 signature index
000001b: 03 ; FIXUP section size
; section "code"
000001f: 04 ; string length
0000020: 636f 6465 ; section id: "code"
0000024: 00 ; section size (guess)
0000025: 02 ; num functions
; function body 0
0000026: 00 ; func body size (guess)
0000027: 00 ; local decl count
0000028: 10 ; OPCODE_I32_CONST
0000029: 01 ; i32 literal
000002a: 03 ; OPCODE_IF
000002b: 00 ; OPCODE_NOP
000002c: 0f ; OPCODE_END
000002d: 10 ; OPCODE_I32_CONST
000002e: 00 ; i32 literal
000002f: 03 ; OPCODE_IF
0000030: 13 ; OPCODE_F32_CONST
0000031: 0000 803f ; f32 literal
0000035: 04 ; OPCODE_ELSE
0000036: 13 ; OPCODE_F32_CONST
0000037: 0000 0040 ; f32 literal
000003b: 0f ; OPCODE_END
0000026: 15 ; FIXUP func body size
; function body 1
000003c: 00 ; func body size (guess)
000003d: 00 ; local decl count
000003e: 10 ; OPCODE_I32_CONST
000003f: 01 ; i32 literal
0000040: 03 ; OPCODE_IF
0000041: 09 ; OPCODE_RETURN
0000042: 00 ; return arity
0000043: 04 ; OPCODE_ELSE
0000044: 09 ; OPCODE_RETURN
0000045: 00 ; return arity
0000046: 0f ; OPCODE_END
000003c: 0a ; FIXUP func body size
0000024: 22 ; FIXUP section size
;; dump
0000000: 0061 736d 0b00 0000 0474 7970 6504 0140
0000010: 0000 0866 756e 6374 696f 6e03 0200 0004
0000020: 636f 6465 2202 1500 1001 0300 0f10 0003
0000030: 1300 0080 3f04 1300 0000 400f 0a00 1001
0000040: 0309 0004 0900 0f
;;; STDOUT ;;)
|