Commit 8085a97
[vm] Fix JumpToFrame execution state transition
Instead of handling FFI related execution state and safepoint
in assembly handle it in runtime code.
The transition needs to be done before JumpToFrame unwinds
stack because unwinding destroys exit frame and this can't
be done at safepoint as GC might be traversing the stack.
An incorrect order of operation was manifesting as crashes in
GC when one isolate in a group was encountering a lot of
exceptions thrown from an FFI call and another isolate is
triggering GCs.
To catch this in the future added a bit of validation to
ExitSafepoint runtime call which triggers when --use-slow-path
is enabled. Though after refactoring this code does not
trigger this code path anymore because it was completely
removed - but it is better than nothing.
This CL also removes a lot of unnecessary complexity which
was associated with handling this transition in the stub
itself.
TEST=ffi/vmspecific_handle_test
Bug: b/408377905
Cq-Include-Trybots: dart/try:vm-aot-android-release-arm64c-try,vm-aot-android-release-arm_x64-try,vm-aot-asan-linux-release-x64-try,vm-aot-linux-debug-x64-try,vm-aot-linux-debug-x64c-try,vm-aot-mac-release-arm64-try,vm-aot-msan-linux-release-x64-try,vm-aot-obfuscate-linux-release-x64-try,vm-aot-optimization-level-linux-release-x64-try,vm-aot-tsan-linux-release-x64-try,vm-aot-ubsan-linux-release-x64-try,vm-aot-win-debug-x64-try,vm-aot-win-debug-x64c-try,vm-appjit-linux-debug-x64-try,vm-asan-linux-release-arm64-try,vm-asan-linux-release-x64-try,vm-checked-mac-release-arm64-try,vm-eager-optimization-linux-release-ia32-try,vm-eager-optimization-linux-release-x64-try,vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64c-try,vm-ffi-mac-debug-simarm64_arm64-try,vm-ffi-qemu-linux-release-arm-try,vm-ffi-qemu-linux-release-riscv64-try,vm-fuchsia-release-x64-try,vm-linux-debug-ia32-try,vm-linux-debug-x64-try,vm-linux-debug-x64c-try,vm-mac-debug-arm64-try,vm-mac-debug-x64-try,vm-msan-linux-release-arm64-try,vm-msan-linux-release-x64-try,vm-reload-linux-debug-x64-try,vm-reload-rollback-linux-debug-x64-try,vm-tsan-linux-release-arm64-try,vm-tsan-linux-release-x64-try,vm-ubsan-linux-release-arm64-try,vm-ubsan-linux-release-x64-try,vm-win-debug-x64-try,vm-win-debug-x64c-try,vm-win-release-ia32-try
Change-Id: Ia073cb6bb9e1b5a0ea8514c7e048cee6019b84d6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/420324
Commit-Queue: Slava Egorov <vegorov@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>1 parent d33c6c3 commit 8085a97
File tree
33 files changed
+2230
-2450
lines changed- runtime/vm
- compiler
- assembler
- backend
- tests/ffi
33 files changed
+2230
-2450
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
634 | 634 | | |
635 | 635 | | |
636 | 636 | | |
637 | | - | |
638 | | - | |
639 | | - | |
| 637 | + | |
640 | 638 | | |
641 | 639 | | |
642 | 640 | | |
| |||
664 | 662 | | |
665 | 663 | | |
666 | 664 | | |
667 | | - | |
668 | | - | |
669 | | - | |
670 | | - | |
671 | | - | |
672 | | - | |
673 | | - | |
674 | | - | |
| 665 | + | |
675 | 666 | | |
676 | 667 | | |
677 | 668 | | |
| |||
681 | 672 | | |
682 | 673 | | |
683 | 674 | | |
684 | | - | |
685 | 675 | | |
686 | 676 | | |
687 | | - | |
| 677 | + | |
688 | 678 | | |
689 | | - | |
690 | | - | |
691 | 679 | | |
692 | 680 | | |
693 | 681 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
621 | 621 | | |
622 | 622 | | |
623 | 623 | | |
624 | | - | |
625 | 624 | | |
626 | 625 | | |
627 | 626 | | |
628 | 627 | | |
629 | | - | |
630 | | - | |
631 | | - | |
| 628 | + | |
632 | 629 | | |
633 | 630 | | |
634 | 631 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1619 | 1619 | | |
1620 | 1620 | | |
1621 | 1621 | | |
1622 | | - | |
1623 | | - | |
| 1622 | + | |
1624 | 1623 | | |
1625 | 1624 | | |
1626 | 1625 | | |
| |||
1650 | 1649 | | |
1651 | 1650 | | |
1652 | 1651 | | |
1653 | | - | |
1654 | | - | |
1655 | | - | |
1656 | | - | |
1657 | | - | |
1658 | | - | |
1659 | | - | |
1660 | | - | |
| 1652 | + | |
1661 | 1653 | | |
1662 | 1654 | | |
1663 | 1655 | | |
| |||
1666 | 1658 | | |
1667 | 1659 | | |
1668 | 1660 | | |
1669 | | - | |
1670 | 1661 | | |
1671 | 1662 | | |
1672 | | - | |
| 1663 | + | |
1673 | 1664 | | |
1674 | | - | |
1675 | | - | |
1676 | 1665 | | |
1677 | 1666 | | |
1678 | 1667 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2111 | 2111 | | |
2112 | 2112 | | |
2113 | 2113 | | |
2114 | | - | |
2115 | 2114 | | |
2116 | 2115 | | |
2117 | 2116 | | |
2118 | 2117 | | |
2119 | | - | |
| 2118 | + | |
2120 | 2119 | | |
2121 | 2120 | | |
2122 | 2121 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2537 | 2537 | | |
2538 | 2538 | | |
2539 | 2539 | | |
2540 | | - | |
2541 | | - | |
| 2540 | + | |
2542 | 2541 | | |
2543 | 2542 | | |
2544 | 2543 | | |
| |||
2563 | 2562 | | |
2564 | 2563 | | |
2565 | 2564 | | |
2566 | | - | |
2567 | | - | |
2568 | | - | |
2569 | | - | |
2570 | | - | |
2571 | | - | |
2572 | | - | |
2573 | | - | |
| 2565 | + | |
2574 | 2566 | | |
2575 | 2567 | | |
2576 | 2568 | | |
| |||
2579 | 2571 | | |
2580 | 2572 | | |
2581 | 2573 | | |
2582 | | - | |
2583 | 2574 | | |
2584 | 2575 | | |
2585 | | - | |
| 2576 | + | |
2586 | 2577 | | |
2587 | | - | |
2588 | | - | |
2589 | 2578 | | |
2590 | 2579 | | |
2591 | 2580 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
901 | 901 | | |
902 | 902 | | |
903 | 903 | | |
904 | | - | |
905 | 904 | | |
906 | 905 | | |
907 | | - | |
| 906 | + | |
908 | 907 | | |
909 | 908 | | |
910 | 909 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4399 | 4399 | | |
4400 | 4400 | | |
4401 | 4401 | | |
4402 | | - | |
4403 | 4402 | | |
4404 | 4403 | | |
4405 | | - | |
| 4404 | + | |
4406 | 4405 | | |
4407 | | - | |
4408 | | - | |
4409 | 4406 | | |
4410 | 4407 | | |
4411 | 4408 | | |
| |||
4495 | 4492 | | |
4496 | 4493 | | |
4497 | 4494 | | |
4498 | | - | |
4499 | | - | |
| 4495 | + | |
4500 | 4496 | | |
4501 | 4497 | | |
4502 | 4498 | | |
| |||
4524 | 4520 | | |
4525 | 4521 | | |
4526 | 4522 | | |
4527 | | - | |
4528 | | - | |
4529 | | - | |
4530 | | - | |
4531 | | - | |
4532 | | - | |
4533 | | - | |
4534 | | - | |
| 4523 | + | |
4535 | 4524 | | |
4536 | 4525 | | |
4537 | 4526 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1452 | 1452 | | |
1453 | 1453 | | |
1454 | 1454 | | |
1455 | | - | |
1456 | 1455 | | |
1457 | 1456 | | |
1458 | 1457 | | |
1459 | 1458 | | |
1460 | | - | |
| 1459 | + | |
1461 | 1460 | | |
1462 | 1461 | | |
1463 | 1462 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
216 | 216 | | |
217 | 217 | | |
218 | 218 | | |
219 | | - | |
| 219 | + | |
220 | 220 | | |
221 | 221 | | |
222 | 222 | | |
| |||
243 | 243 | | |
244 | 244 | | |
245 | 245 | | |
246 | | - | |
247 | | - | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
253 | | - | |
| 246 | + | |
254 | 247 | | |
255 | 248 | | |
256 | 249 | | |
| |||
261 | 254 | | |
262 | 255 | | |
263 | 256 | | |
264 | | - | |
265 | | - | |
266 | | - | |
| 257 | + | |
267 | 258 | | |
268 | | - | |
| 259 | + | |
269 | 260 | | |
270 | | - | |
271 | | - | |
272 | 261 | | |
273 | 262 | | |
274 | 263 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
319 | 319 | | |
320 | 320 | | |
321 | 321 | | |
322 | | - | |
| 322 | + | |
323 | 323 | | |
324 | 324 | | |
325 | 325 | | |
326 | 326 | | |
327 | | - | |
328 | | - | |
329 | | - | |
| 327 | + | |
330 | 328 | | |
331 | 329 | | |
332 | 330 | | |
| |||
0 commit comments