Commit df693c2
[vm,dyn_modules] Add flags to bytecode source positions.
There are two possible flags for each source position currently:
a flag that marks the source position as synthetic and a flag that
marks the source position as within a yield point.
Synthetic source positions in bytecode are treated the same as synthetic
source positions in compiled code. That is, they encode the source
position in the text that caused them to be synthesized, but denote that
the covered instructions are internal and not to be used for debugger
pause points or for call site/branch coverage information.
Adding these flags allow us to mark appropriate parts of the async
machinery as synthetic, and also allow us to mark all the bytecode
involved in yield points as having the same token position.
The latter fixes tests where the code would step over a previous
expression, thus being paused at the start of the await bytecode,
and would record the fp and token position there as the ones to
ignore. However, since a new source position wasn't emitted until the
direct call to the await method, the recorded token position would
be the token position prior to the await call, and so the change
in token position at the await call would trigger an early pause.
TEST=pkg/vm_service/test/async_single_step_exception_test
pkg/vm_service/test/async_single_step_into_test
pkg/vm_service/test/async_single_step_out_test
pkg/vm_service/test/async_star_single_step_into_test
pkg/vm_service/test/async_step_out_test
pkg/vm_service/test/positive_token_pos_test
pkg/vm_service/test/step_into_async_no_await_test
Cq-Include-Trybots: luci.dart.try:vm-dyn-linux-debug-x64-try,vm-aot-dyn-linux-debug-x64-try,vm-aot-dyn-linux-product-x64-try,vm-dyn-mac-debug-arm64-try,vm-aot-linux-debug-x64-try,vm-aot-linux-product-x64-try
Change-Id: Ic7642a74fb76227a473f461f360e84dd3d5a45a1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/453322
Reviewed-by: Alexander Markov <[email protected]>
Commit-Queue: Tess Strickland <[email protected]>1 parent bdf620c commit df693c2
File tree
10 files changed
+392
-242
lines changed- pkg/dart2bytecode
- docs
- lib
- runtime/vm
- compiler/assembler
10 files changed
+392
-242
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
850 | 850 | | |
851 | 851 | | |
852 | 852 | | |
853 | | - | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
854 | 872 | | |
855 | | - | |
| 873 | + | |
856 | 874 | | |
857 | 875 | | |
858 | 876 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| 66 | + | |
66 | 67 | | |
67 | 68 | | |
68 | 69 | | |
| |||
81 | 82 | | |
82 | 83 | | |
83 | 84 | | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
84 | 97 | | |
85 | 98 | | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
| 99 | + | |
| 100 | + | |
90 | 101 | | |
91 | 102 | | |
92 | 103 | | |
| |||
95 | 106 | | |
96 | 107 | | |
97 | 108 | | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
| 109 | + | |
107 | 110 | | |
108 | 111 | | |
109 | 112 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1021 | 1021 | | |
1022 | 1022 | | |
1023 | 1023 | | |
1024 | | - | |
| 1024 | + | |
1025 | 1025 | | |
| 1026 | + | |
| 1027 | + | |
| 1028 | + | |
1026 | 1029 | | |
1027 | 1030 | | |
1028 | 1031 | | |
| |||
1031 | 1034 | | |
1032 | 1035 | | |
1033 | 1036 | | |
1034 | | - | |
| 1037 | + | |
| 1038 | + | |
1035 | 1039 | | |
1036 | 1040 | | |
| 1041 | + | |
1037 | 1042 | | |
1038 | 1043 | | |
1039 | 1044 | | |
| |||
1216 | 1221 | | |
1217 | 1222 | | |
1218 | 1223 | | |
| 1224 | + | |
| 1225 | + | |
| 1226 | + | |
1219 | 1227 | | |
1220 | 1228 | | |
1221 | 1229 | | |
| |||
1633 | 1641 | | |
1634 | 1642 | | |
1635 | 1643 | | |
1636 | | - | |
1637 | | - | |
1638 | | - | |
1639 | | - | |
1640 | | - | |
1641 | | - | |
1642 | | - | |
1643 | 1644 | | |
1644 | 1645 | | |
1645 | 1646 | | |
1646 | 1647 | | |
| 1648 | + | |
| 1649 | + | |
| 1650 | + | |
| 1651 | + | |
| 1652 | + | |
| 1653 | + | |
| 1654 | + | |
| 1655 | + | |
| 1656 | + | |
1647 | 1657 | | |
1648 | 1658 | | |
1649 | 1659 | | |
| |||
1677 | 1687 | | |
1678 | 1688 | | |
1679 | 1689 | | |
| 1690 | + | |
| 1691 | + | |
| 1692 | + | |
1680 | 1693 | | |
1681 | 1694 | | |
1682 | 1695 | | |
| |||
1696 | 1709 | | |
1697 | 1710 | | |
1698 | 1711 | | |
| 1712 | + | |
| 1713 | + | |
| 1714 | + | |
| 1715 | + | |
1699 | 1716 | | |
1700 | 1717 | | |
1701 | 1718 | | |
| |||
1710 | 1727 | | |
1711 | 1728 | | |
1712 | 1729 | | |
| 1730 | + | |
1713 | 1731 | | |
1714 | 1732 | | |
1715 | 1733 | | |
| |||
1729 | 1747 | | |
1730 | 1748 | | |
1731 | 1749 | | |
| 1750 | + | |
1732 | 1751 | | |
1733 | 1752 | | |
1734 | 1753 | | |
| |||
1744 | 1763 | | |
1745 | 1764 | | |
1746 | 1765 | | |
| 1766 | + | |
| 1767 | + | |
1747 | 1768 | | |
1748 | 1769 | | |
1749 | 1770 | | |
| |||
1765 | 1786 | | |
1766 | 1787 | | |
1767 | 1788 | | |
| 1789 | + | |
1768 | 1790 | | |
1769 | 1791 | | |
1770 | 1792 | | |
| |||
1954 | 1976 | | |
1955 | 1977 | | |
1956 | 1978 | | |
| 1979 | + | |
| 1980 | + | |
| 1981 | + | |
1957 | 1982 | | |
1958 | 1983 | | |
1959 | | - | |
1960 | 1984 | | |
1961 | 1985 | | |
1962 | 1986 | | |
| |||
2063 | 2087 | | |
2064 | 2088 | | |
2065 | 2089 | | |
2066 | | - | |
| 2090 | + | |
| 2091 | + | |
2067 | 2092 | | |
2068 | 2093 | | |
2069 | 2094 | | |
| |||
2417 | 2442 | | |
2418 | 2443 | | |
2419 | 2444 | | |
2420 | | - | |
| 2445 | + | |
2421 | 2446 | | |
2422 | 2447 | | |
2423 | 2448 | | |
| |||
2695 | 2720 | | |
2696 | 2721 | | |
2697 | 2722 | | |
2698 | | - | |
| 2723 | + | |
| 2724 | + | |
2699 | 2725 | | |
2700 | 2726 | | |
2701 | 2727 | | |
| |||
3413 | 3439 | | |
3414 | 3440 | | |
3415 | 3441 | | |
3416 | | - | |
3417 | | - | |
| 3442 | + | |
3418 | 3443 | | |
3419 | 3444 | | |
3420 | 3445 | | |
| |||
4147 | 4172 | | |
4148 | 4173 | | |
4149 | 4174 | | |
4150 | | - | |
| 4175 | + | |
| 4176 | + | |
| 4177 | + | |
| 4178 | + | |
| 4179 | + | |
| 4180 | + | |
| 4181 | + | |
4151 | 4182 | | |
4152 | 4183 | | |
4153 | 4184 | | |
| |||
4165 | 4196 | | |
4166 | 4197 | | |
4167 | 4198 | | |
| 4199 | + | |
4168 | 4200 | | |
4169 | 4201 | | |
4170 | 4202 | | |
| |||
4241 | 4273 | | |
4242 | 4274 | | |
4243 | 4275 | | |
4244 | | - | |
| 4276 | + | |
4245 | 4277 | | |
4246 | 4278 | | |
4247 | 4279 | | |
| |||
4277 | 4309 | | |
4278 | 4310 | | |
4279 | 4311 | | |
4280 | | - | |
| 4312 | + | |
4281 | 4313 | | |
4282 | 4314 | | |
4283 | 4315 | | |
| |||
4457 | 4489 | | |
4458 | 4490 | | |
4459 | 4491 | | |
| 4492 | + | |
| 4493 | + | |
| 4494 | + | |
| 4495 | + | |
| 4496 | + | |
| 4497 | + | |
| 4498 | + | |
| 4499 | + | |
4460 | 4500 | | |
4461 | 4501 | | |
4462 | 4502 | | |
| |||
4478 | 4518 | | |
4479 | 4519 | | |
4480 | 4520 | | |
| 4521 | + | |
4481 | 4522 | | |
4482 | 4523 | | |
4483 | 4524 | | |
| |||
0 commit comments