-
Notifications
You must be signed in to change notification settings - Fork 854
Expand file tree
/
Copy pathshared_longjmp.wat
More file actions
151 lines (150 loc) · 3.5 KB
/
shared_longjmp.wat
File metadata and controls
151 lines (150 loc) · 3.5 KB
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
(module $shared_longjmp.wasm
(type $0 (func))
(type $1 (func (param i32 i32 i32)))
(type $2 (func (param i32 i32)))
(type $3 (func (param i32 i32) (result i32)))
(type $4 (func (param i32)))
(type $5 (func (result i32)))
(import "env" "memory" (memory $mimport$0 1))
(import "env" "__indirect_function_table" (table $timport$0 0 funcref))
(import "env" "__stack_pointer" (global $__stack_pointer (mut i32)))
(import "env" "__memory_base" (global $__memory_base i32))
(import "env" "__table_base" (global $__table_base i32))
(import "GOT.mem" "__THREW__" (global $__THREW__ (mut i32)))
(import "GOT.func" "emscripten_longjmp" (global $emscripten_longjmp (mut i32)))
(import "GOT.mem" "__threwValue" (global $__threwValue (mut i32)))
(import "env" "__wasm_setjmp" (func $__wasm_setjmp (param i32 i32 i32)))
(import "env" "emscripten_longjmp" (func $emscripten_longjmp (param i32 i32)))
(import "env" "invoke_vii" (func $invoke_vii (param i32 i32 i32)))
(import "env" "__wasm_setjmp_test" (func $__wasm_setjmp_test (param i32 i32) (result i32)))
(import "env" "setTempRet0" (func $setTempRet0 (param i32)))
(import "env" "getTempRet0" (func $getTempRet0 (result i32)))
(global $global$0 i32 (i32.const 0))
(global $global$1 i32 (i32.const 4))
(export "__wasm_call_ctors" (func $__wasm_call_ctors))
(export "_start" (func $_start))
(export "__THREW__" (global $global$0))
(export "__threwValue" (global $global$1))
(start $__wasm_init_memory)
(func $__wasm_call_ctors
)
(func $__wasm_init_memory
(memory.fill
(i32.add
(i32.const 0)
(global.get $__memory_base)
)
(i32.const 0)
(i32.const 8)
)
)
(func $_start
(local $0 i32)
(local $1 i32)
(local $2 i32)
(global.set $__stack_pointer
(local.tee $0
(i32.sub
(global.get $__stack_pointer)
(i32.const 16)
)
)
)
(call $__wasm_setjmp
(local.get $1)
(i32.const 1)
(i32.add
(local.get $0)
(i32.const 12)
)
)
(local.set $1
(i32.const 0)
)
(block $block2
(block $block
(loop $label
(br_if $block
(local.get $1)
)
(i32.store
(local.tee $1
(global.get $__THREW__)
)
(i32.const 0)
)
(call $invoke_vii
(global.get $emscripten_longjmp)
(local.get $1)
(i32.const 1)
)
(local.set $2
(i32.load
(local.get $1)
)
)
(i32.store
(local.get $1)
(i32.const 0)
)
(local.set $1
(global.get $__threwValue)
)
(block $block1
(br_if $block1
(i32.eqz
(local.get $2)
)
)
(br_if $block1
(i32.eqz
(local.tee $1
(i32.load
(local.get $1)
)
)
)
)
(br_if $block2
(i32.eqz
(call $__wasm_setjmp_test
(local.get $2)
(i32.add
(local.get $0)
(i32.const 12)
)
)
)
)
(call $setTempRet0
(local.get $1)
)
)
(local.set $1
(call $getTempRet0)
)
(br $label)
)
)
(global.set $__stack_pointer
(i32.add
(local.get $0)
(i32.const 16)
)
)
(return)
)
(call $emscripten_longjmp
(local.get $2)
(local.get $1)
)
(unreachable)
)
;; dylink section
;; memorysize: 8
;; memoryalignment: 2
;; tablesize: 0
;; tablealignment: 0
;; custom section "producers", size 115
;; features section: mutable-globals, nontrapping-float-to-int, bulk-memory, sign-ext, reference-types, multivalue, bulk-memory-opt, call-indirect-overlong
)