blob: 207198d1d50adf76ddd9509ecd6c8c08ef82442b (
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
|
;;; TOOL: run-wasmdump
;;; FLAGS: -v
(module
(func
i32.const 1
if
nop
end
i32.const 0
if f32
f32.const 1.0
else
f32.const 2.0
end
drop)
(func
i32.const 1
if
return
else
return
end))
(;; STDOUT ;;;
0000000: 0061 736d ; WASM_BINARY_MAGIC
0000004: 0c00 0000 ; WASM_BINARY_VERSION
; section "TYPE" (1)
0000008: 01 ; section code
0000009: 00 ; section size (guess)
000000a: 01 ; num types
; type 0
000000b: 40 ; function form
000000c: 00 ; num params
000000d: 00 ; num results
0000009: 04 ; FIXUP section size
; section "FUNCTION" (3)
000000e: 03 ; section code
000000f: 00 ; section size (guess)
0000010: 02 ; num functions
0000011: 00 ; function 0 signature index
0000012: 00 ; function 1 signature index
000000f: 03 ; FIXUP section size
; section "CODE" (10)
0000013: 0a ; section code
0000014: 00 ; section size (guess)
0000015: 02 ; num functions
; function body 0
0000016: 00 ; func body size (guess)
0000017: 00 ; local decl count
0000018: 10 ; i32.const
0000019: 01 ; i32 literal
000001a: 03 ; if
000001b: 00 ; WASM_TYPE_VOID
000001c: 0a ; nop
000001d: 0f ; end
000001e: 10 ; i32.const
000001f: 00 ; i32 literal
0000020: 03 ; if
0000021: 03 ; WASM_TYPE_F32
0000022: 13 ; f32.const
0000023: 0000 803f ; f32 literal
0000027: 04 ; else
0000028: 13 ; f32.const
0000029: 0000 0040 ; f32 literal
000002d: 0f ; end
000002e: 0b ; drop
000002f: 0f ; end
0000016: 19 ; FIXUP func body size
; function body 1
0000030: 00 ; func body size (guess)
0000031: 00 ; local decl count
0000032: 10 ; i32.const
0000033: 01 ; i32 literal
0000034: 03 ; if
0000035: 00 ; WASM_TYPE_VOID
0000036: 09 ; return
0000037: 04 ; else
0000038: 09 ; return
0000039: 0f ; end
000003a: 0f ; end
0000030: 0a ; FIXUP func body size
0000014: 26 ; FIXUP section size
func 0
000018: 10 01 | i32.const 0x1
00001a: 03 00 | if
00001c: 0a | nop
00001d: 0f | end
00001e: 10 00 | i32.const 0
000020: 03 03 | if f32
000022: 13 00 00 80 3f | f32.const 0x3f800000
000027: 04 | else
000028: 13 00 00 00 40 | f32.const 0x40000000
00002d: 0f | end
00002e: 0b | drop
func 1
000032: 10 01 | i32.const 0x1
000034: 03 00 | if
000036: 09 | return
000037: 04 | else
000038: 09 | return
000039: 0f | end
;;; STDOUT ;;)
|