Commit 59499d3
[dart2wasm] Add support for declaring functions as module elements.
Allows functions to be referenced in a constant context (via ref_func) without needing to bind the function to a global.
Uses format 3 supported by the element section:
https://webassembly.github.io/gc/core/binary/modules.html#element-section
Change-Id: Ifb68800c480b14acfa3432eae80396be4e9c8a6e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/400900
Commit-Queue: Nate Biggs <[email protected]>
Reviewed-by: Martin Kustermann <[email protected]>1 parent 96fbc26 commit 59499d3
File tree
4 files changed
+51
-11
lines changed- pkg/wasm_builder/lib/src
- builder
- ir
- serialize
4 files changed
+51
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| |||
61 | 62 | | |
62 | 63 | | |
63 | 64 | | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
64 | 71 | | |
65 | 72 | | |
66 | 73 | | |
67 | 74 | | |
68 | | - | |
| 75 | + | |
| 76 | + | |
69 | 77 | | |
70 | 78 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
22 | 25 | | |
23 | 26 | | |
24 | 27 | | |
25 | | - | |
| 28 | + | |
| 29 | + | |
26 | 30 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | | - | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
55 | 57 | | |
56 | 58 | | |
57 | 59 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
216 | 216 | | |
217 | 217 | | |
218 | 218 | | |
219 | | - | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
220 | 222 | | |
221 | 223 | | |
222 | 224 | | |
223 | 225 | | |
224 | | - | |
| 226 | + | |
225 | 227 | | |
226 | 228 | | |
227 | 229 | | |
| |||
250 | 252 | | |
251 | 253 | | |
252 | 254 | | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
253 | 273 | | |
254 | 274 | | |
255 | 275 | | |
| 276 | + | |
256 | 277 | | |
257 | | - | |
| 278 | + | |
| 279 | + | |
258 | 280 | | |
259 | 281 | | |
260 | 282 | | |
261 | 283 | | |
262 | 284 | | |
263 | 285 | | |
264 | 286 | | |
265 | | - | |
| 287 | + | |
| 288 | + | |
266 | 289 | | |
267 | 290 | | |
268 | 291 | | |
269 | 292 | | |
270 | 293 | | |
271 | 294 | | |
272 | 295 | | |
273 | | - | |
| 296 | + | |
274 | 297 | | |
275 | 298 | | |
276 | 299 | | |
277 | 300 | | |
278 | | - | |
| 301 | + | |
279 | 302 | | |
280 | 303 | | |
281 | 304 | | |
| |||
288 | 311 | | |
289 | 312 | | |
290 | 313 | | |
291 | | - | |
| 314 | + | |
292 | 315 | | |
293 | 316 | | |
294 | 317 | | |
295 | 318 | | |
296 | 319 | | |
297 | | - | |
| 320 | + | |
298 | 321 | | |
299 | 322 | | |
300 | 323 | | |
301 | 324 | | |
302 | 325 | | |
303 | 326 | | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
304 | 330 | | |
305 | 331 | | |
306 | 332 | | |
| |||
0 commit comments