Commit 3304a18
committed
[Wasm-GC] Add missing type expansion for arrays, structs
https://bugs.webkit.org/show_bug.cgi?id=250489
Reviewed by Justin Michaud.
Adds `expand()` calls where necessary to ensure that recursive/subtype
types work with array and struct operations. Also add tests to exercise
these cases.
* JSTests/wasm/gc/arrays.js:
(testArrayNewDefault):
(testArrayGet):
* JSTests/wasm/gc/structs.js:
(testStructNewDefault):
* Source/JavaScriptCore/wasm/WasmAirIRGeneratorBase.h:
(JSC::Wasm::ExpressionType>::addArrayNew):
(JSC::Wasm::ExpressionType>::addArrayNewDefault):
(JSC::Wasm::ExpressionType>::addArrayGet):
(JSC::Wasm::ExpressionType>::addStructNew):
(JSC::Wasm::ExpressionType>::addStructNewDefault):
* Source/JavaScriptCore/wasm/WasmB3IRGenerator.cpp:
(JSC::Wasm::B3IRGenerator::addArrayNew):
(JSC::Wasm::B3IRGenerator::addArrayNewDefault):
(JSC::Wasm::B3IRGenerator::addArrayGet):
(JSC::Wasm::B3IRGenerator::addArraySet):
(JSC::Wasm::B3IRGenerator::addStructNew):
(JSC::Wasm::B3IRGenerator::addStructNewDefault):
* Source/JavaScriptCore/wasm/WasmFunctionParser.h:
(JSC::Wasm::FunctionParser<Context>::parseStructTypeIndex):
(JSC::Wasm::FunctionParser<Context>::parseStructTypeIndexAndFieldIndex):
(JSC::Wasm::FunctionParser<Context>::parseStructFieldManipulation):
(JSC::Wasm::FunctionParser<Context>::parseExpression):
* Source/JavaScriptCore/wasm/WasmOperationsInlines.h:
(JSC::Wasm::arrayNew):
(JSC::Wasm::arrayGet):
(JSC::Wasm::arraySet):
(JSC::Wasm::structNew):
* Source/JavaScriptCore/wasm/WasmSlowPaths.cpp:
(JSC::LLInt::WASM_SLOW_PATH_DECL):
* Source/JavaScriptCore/wasm/js/JSWebAssemblyStruct.cpp:
(JSC::JSWebAssemblyStruct::JSWebAssemblyStruct):
(JSC::JSWebAssemblyStruct::tryCreate):
* Source/JavaScriptCore/wasm/js/JSWebAssemblyStruct.h:
Canonical link: https://commits.webkit.org/259042@main1 parent 69bce7a commit 3304a18
File tree
9 files changed
+183
-36
lines changed- JSTests/wasm/gc
- Source/JavaScriptCore/wasm
- js
9 files changed
+183
-36
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
171 | 171 | | |
172 | 172 | | |
173 | 173 | | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
174 | 184 | | |
175 | 185 | | |
176 | 186 | | |
| |||
181 | 191 | | |
182 | 192 | | |
183 | 193 | | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
184 | 204 | | |
185 | 205 | | |
186 | 206 | | |
| |||
197 | 217 | | |
198 | 218 | | |
199 | 219 | | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
200 | 235 | | |
201 | 236 | | |
202 | 237 | | |
| |||
370 | 405 | | |
371 | 406 | | |
372 | 407 | | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
373 | 427 | | |
374 | 428 | | |
375 | 429 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
228 | 228 | | |
229 | 229 | | |
230 | 230 | | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
231 | 244 | | |
232 | 245 | | |
233 | 246 | | |
| |||
318 | 331 | | |
319 | 332 | | |
320 | 333 | | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
321 | 347 | | |
322 | 348 | | |
323 | 349 | | |
| |||
420 | 446 | | |
421 | 447 | | |
422 | 448 | | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
423 | 465 | | |
424 | 466 | | |
425 | 467 | | |
| |||
778 | 820 | | |
779 | 821 | | |
780 | 822 | | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
781 | 874 | | |
782 | 875 | | |
783 | 876 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2476 | 2476 | | |
2477 | 2477 | | |
2478 | 2478 | | |
2479 | | - | |
| 2479 | + | |
2480 | 2480 | | |
2481 | 2481 | | |
2482 | 2482 | | |
| |||
2492 | 2492 | | |
2493 | 2493 | | |
2494 | 2494 | | |
2495 | | - | |
| 2495 | + | |
2496 | 2496 | | |
2497 | 2497 | | |
2498 | 2498 | | |
| |||
2517 | 2517 | | |
2518 | 2518 | | |
2519 | 2519 | | |
2520 | | - | |
| 2520 | + | |
2521 | 2521 | | |
2522 | 2522 | | |
2523 | 2523 | | |
| |||
2606 | 2606 | | |
2607 | 2607 | | |
2608 | 2608 | | |
2609 | | - | |
| 2609 | + | |
2610 | 2610 | | |
2611 | 2611 | | |
2612 | 2612 | | |
| |||
2624 | 2624 | | |
2625 | 2625 | | |
2626 | 2626 | | |
2627 | | - | |
| 2627 | + | |
2628 | 2628 | | |
2629 | 2629 | | |
2630 | 2630 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2608 | 2608 | | |
2609 | 2609 | | |
2610 | 2610 | | |
2611 | | - | |
| 2611 | + | |
2612 | 2612 | | |
2613 | 2613 | | |
2614 | 2614 | | |
| |||
2631 | 2631 | | |
2632 | 2632 | | |
2633 | 2633 | | |
2634 | | - | |
| 2634 | + | |
2635 | 2635 | | |
2636 | 2636 | | |
2637 | 2637 | | |
| |||
2647 | 2647 | | |
2648 | 2648 | | |
2649 | 2649 | | |
2650 | | - | |
| 2650 | + | |
2651 | 2651 | | |
2652 | 2652 | | |
2653 | 2653 | | |
| |||
2728 | 2728 | | |
2729 | 2729 | | |
2730 | 2730 | | |
2731 | | - | |
| 2731 | + | |
2732 | 2732 | | |
2733 | 2733 | | |
2734 | 2734 | | |
| |||
2797 | 2797 | | |
2798 | 2798 | | |
2799 | 2799 | | |
2800 | | - | |
| 2800 | + | |
2801 | 2801 | | |
2802 | 2802 | | |
2803 | 2803 | | |
| |||
2816 | 2816 | | |
2817 | 2817 | | |
2818 | 2818 | | |
2819 | | - | |
| 2819 | + | |
2820 | 2820 | | |
2821 | 2821 | | |
2822 | 2822 | | |
| |||
0 commit comments