|
1 | 1 | (module
|
2 | 2 | (type $none_=>_none (func))
|
| 3 | + (type $none_=>_externref (func (result externref))) |
3 | 4 | (type $externref_=>_externref (func (param externref) (result externref)))
|
4 | 5 | (type $externref_=>_none (func (param externref)))
|
5 | 6 | (type $i32_i32_i32_i32_=>_none (func (param i32 i32 i32 i32)))
|
|
11 | 12 | (import "env" "abort" (func $~lib/builtins/abort (param i32 i32 i32 i32)))
|
12 | 13 | (import "console" "log" (func $~lib/bindings/console/log (param externref)))
|
13 | 14 | (import "Reflect" "get" (func $~lib/bindings/Reflect/get (param externref externref) (result externref)))
|
| 15 | + (import "reference-types" "somethingReal" (func $features/reference-types/somethingReal (result externref))) |
| 16 | + (import "reference-types" "somethingNull" (func $features/reference-types/somethingNull (result externref))) |
14 | 17 | (import "reference-types" "external" (func $features/reference-types/external (param externref) (result externref)))
|
15 | 18 | (memory $0 1)
|
16 | 19 | (data (i32.const 12) "L\00\00\00\00\00\00\00\00\00\00\00\01\00\00\006\00\00\00f\00e\00a\00t\00u\00r\00e\00s\00/\00r\00e\00f\00e\00r\00e\00n\00c\00e\00-\00t\00y\00p\00e\00s\00.\00t\00s\00\00\00\00\00\00\00")
|
|
26 | 29 | (global $~lib/memory/__stack_pointer (mut i32) (i32.const 16476))
|
27 | 30 | (global $~lib/memory/__heap_base i32 (i32.const 16476))
|
28 | 31 | (export "external" (func $features/reference-types/external))
|
| 32 | + (export "somethingReal" (func $features/reference-types/somethingReal)) |
| 33 | + (export "somethingNull" (func $features/reference-types/somethingNull)) |
29 | 34 | (export "internal" (func $features/reference-types/internal))
|
30 | 35 | (export "memory" (memory $0))
|
31 | 36 | (start $~start)
|
|
165 | 170 | nop
|
166 | 171 | )
|
167 | 172 | (func $start:features/reference-types
|
168 |
| - (local $0 funcref) |
169 | 173 | global.get $features/reference-types/someObject
|
170 | 174 | global.get $features/reference-types/someKey
|
171 | 175 | call $~lib/bindings/Reflect/has
|
|
175 | 179 | if
|
176 | 180 | i32.const 0
|
177 | 181 | i32.const 32
|
178 |
| - i32.const 19 |
| 182 | + i32.const 21 |
179 | 183 | i32.const 1
|
180 | 184 | call $~lib/builtins/abort
|
181 | 185 | unreachable
|
|
188 | 192 | global.get $features/reference-types/someKey
|
189 | 193 | call $~lib/bindings/Reflect/get
|
190 | 194 | call $~lib/bindings/console/log
|
191 |
| - global.get $features/reference-types/funcGlobal |
| 195 | + i32.const 1 |
| 196 | + call $features/reference-types/somethingReal |
192 | 197 | ref.is_null
|
193 |
| - i32.eqz |
| 198 | + i32.sub |
194 | 199 | i32.eqz
|
195 | 200 | if
|
196 | 201 | i32.const 0
|
197 |
| - i32.const 32 |
198 |
| - i32.const 32 |
199 |
| - i32.const 1 |
200 |
| - call $~lib/builtins/abort |
201 |
| - unreachable |
| 202 | + i32.eqz |
| 203 | + if |
| 204 | + i32.const 0 |
| 205 | + i32.const 32 |
| 206 | + i32.const 33 |
| 207 | + i32.const 3 |
| 208 | + call $~lib/builtins/abort |
| 209 | + unreachable |
| 210 | + end |
202 | 211 | end
|
203 |
| - ref.null func |
204 |
| - global.set $features/reference-types/funcGlobal |
205 |
| - global.get $features/reference-types/funcGlobal |
| 212 | + i32.const 1 |
| 213 | + call $features/reference-types/somethingNull |
206 | 214 | ref.is_null
|
207 |
| - i32.eqz |
| 215 | + i32.sub |
208 | 216 | i32.eqz
|
209 | 217 | if
|
| 218 | + nop |
| 219 | + else |
210 | 220 | i32.const 0
|
211 |
| - i32.const 32 |
212 |
| - i32.const 34 |
213 |
| - i32.const 1 |
214 |
| - call $~lib/builtins/abort |
215 |
| - unreachable |
| 221 | + i32.eqz |
| 222 | + if |
| 223 | + i32.const 0 |
| 224 | + i32.const 32 |
| 225 | + i32.const 38 |
| 226 | + i32.const 3 |
| 227 | + call $~lib/builtins/abort |
| 228 | + unreachable |
| 229 | + end |
216 | 230 | end
|
217 |
| - ref.null func |
218 |
| - global.set $features/reference-types/funcGlobalInit |
219 |
| - global.get $features/reference-types/funcGlobalInit |
| 231 | + i32.const 1 |
| 232 | + call $features/reference-types/somethingReal |
220 | 233 | ref.is_null
|
221 |
| - i32.eqz |
222 |
| - i32.eqz |
| 234 | + i32.sub |
223 | 235 | if
|
| 236 | + nop |
| 237 | + else |
224 | 238 | i32.const 0
|
225 |
| - i32.const 32 |
226 |
| - i32.const 36 |
227 |
| - i32.const 1 |
228 |
| - call $~lib/builtins/abort |
229 |
| - unreachable |
| 239 | + i32.eqz |
| 240 | + if |
| 241 | + i32.const 0 |
| 242 | + i32.const 32 |
| 243 | + i32.const 43 |
| 244 | + i32.const 3 |
| 245 | + call $~lib/builtins/abort |
| 246 | + unreachable |
| 247 | + end |
230 | 248 | end
|
231 |
| - global.get $features/reference-types/externGlobal |
| 249 | + i32.const 1 |
| 250 | + call $features/reference-types/somethingNull |
232 | 251 | ref.is_null
|
233 |
| - i32.eqz |
234 |
| - i32.eqz |
| 252 | + i32.sub |
235 | 253 | if
|
236 | 254 | i32.const 0
|
237 |
| - i32.const 32 |
238 |
| - i32.const 39 |
239 |
| - i32.const 1 |
240 |
| - call $~lib/builtins/abort |
241 |
| - unreachable |
| 255 | + i32.eqz |
| 256 | + if |
| 257 | + i32.const 0 |
| 258 | + i32.const 32 |
| 259 | + i32.const 46 |
| 260 | + i32.const 3 |
| 261 | + call $~lib/builtins/abort |
| 262 | + unreachable |
| 263 | + end |
242 | 264 | end
|
243 | 265 | ref.null extern
|
244 | 266 | global.set $features/reference-types/externGlobal
|
|
0 commit comments