Commit a5f7345
[ddc] Updating representation for virtual and lazy fields.
This restructures all fields as accessor/value-store pairs, providing a level of indirection required for hot reload.
Major updates include:
- All fields (top-level, lazy, virtual, etc.) now have a value store (represented as a private top-level symbol). The value store is initialized on first access for the initializer.
- Lazy value stores are prefixed with '_#v_' to indicate that they are not replaced on a hot reload.
- `declareClass` and `declareTopLevelProperties` are introduced to append classes/members to libraries. These functions extend the 'original' entity/class with fields introduced by a properties object, ignoring the special lazy value stores mentioned above.
- `defineLazy` is replaced with the above operations.
- Virtual/instance fields are still initialized by inside their constructor on first load (so their getter forwards to its value store). On hot reload, however, uninitialized fields are lazily initialized.
- Final fields now use a sentinel value to check for late initialization errors during the initialization loop.
- The JS AST is extended to support class properties.
Change-Id: I5cc3548477d83897273f3b993b304a804754ec0e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/386971
Reviewed-by: Nicholas Shahan <[email protected]>1 parent 6fd34c9 commit a5f7345
File tree
7 files changed
+424
-216
lines changed- pkg/dev_compiler/lib/src
- js_ast
- kernel
- sdk/lib/_internal/js_dev_runtime/private/ddc_runtime
7 files changed
+424
-216
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1802 | 1802 | | |
1803 | 1803 | | |
1804 | 1804 | | |
| 1805 | + | |
| 1806 | + | |
1805 | 1807 | | |
1806 | | - | |
| 1808 | + | |
| 1809 | + | |
1807 | 1810 | | |
1808 | 1811 | | |
1809 | 1812 | | |
| |||
1815 | 1818 | | |
1816 | 1819 | | |
1817 | 1820 | | |
1818 | | - | |
| 1821 | + | |
| 1822 | + | |
1819 | 1823 | | |
1820 | 1824 | | |
1821 | 1825 | | |
| |||
1925 | 1929 | | |
1926 | 1930 | | |
1927 | 1931 | | |
1928 | | - | |
| 1932 | + | |
1929 | 1933 | | |
1930 | | - | |
| 1934 | + | |
1931 | 1935 | | |
1932 | 1936 | | |
1933 | 1937 | | |
| |||
1936 | 1940 | | |
1937 | 1941 | | |
1938 | 1942 | | |
1939 | | - | |
| 1943 | + | |
1940 | 1944 | | |
1941 | 1945 | | |
1942 | 1946 | | |
| |||
1945 | 1949 | | |
1946 | 1950 | | |
1947 | 1951 | | |
1948 | | - | |
| 1952 | + | |
1949 | 1953 | | |
1950 | 1954 | | |
1951 | 1955 | | |
| |||
1957 | 1961 | | |
1958 | 1962 | | |
1959 | 1963 | | |
| 1964 | + | |
| 1965 | + | |
1960 | 1966 | | |
1961 | 1967 | | |
| 1968 | + | |
| 1969 | + | |
| 1970 | + | |
1962 | 1971 | | |
1963 | 1972 | | |
1964 | 1973 | | |
| |||
2121 | 2130 | | |
2122 | 2131 | | |
2123 | 2132 | | |
| 2133 | + | |
| 2134 | + | |
2124 | 2135 | | |
2125 | 2136 | | |
2126 | 2137 | | |
| |||
2561 | 2572 | | |
2562 | 2573 | | |
2563 | 2574 | | |
2564 | | - | |
| 2575 | + | |
2565 | 2576 | | |
2566 | 2577 | | |
2567 | | - | |
| 2578 | + | |
2568 | 2579 | | |
2569 | 2580 | | |
2570 | | - | |
| 2581 | + | |
2571 | 2582 | | |
2572 | 2583 | | |
2573 | 2584 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1149 | 1149 | | |
1150 | 1150 | | |
1151 | 1151 | | |
| 1152 | + | |
| 1153 | + | |
| 1154 | + | |
1152 | 1155 | | |
1153 | | - | |
| 1156 | + | |
| 1157 | + | |
| 1158 | + | |
| 1159 | + | |
| 1160 | + | |
1154 | 1161 | | |
1155 | 1162 | | |
1156 | 1163 | | |
| 1164 | + | |
| 1165 | + | |
| 1166 | + | |
1157 | 1167 | | |
1158 | 1168 | | |
1159 | 1169 | | |
| |||
1198 | 1208 | | |
1199 | 1209 | | |
1200 | 1210 | | |
1201 | | - | |
| 1211 | + | |
1202 | 1212 | | |
1203 | 1213 | | |
1204 | 1214 | | |
1205 | | - | |
| 1215 | + | |
1206 | 1216 | | |
1207 | | - | |
| 1217 | + | |
1208 | 1218 | | |
1209 | 1219 | | |
1210 | 1220 | | |
| |||
1503 | 1513 | | |
1504 | 1514 | | |
1505 | 1515 | | |
1506 | | - | |
| 1516 | + | |
1507 | 1517 | | |
1508 | 1518 | | |
1509 | 1519 | | |
| |||
1813 | 1823 | | |
1814 | 1824 | | |
1815 | 1825 | | |
1816 | | - | |
| 1826 | + | |
1817 | 1827 | | |
1818 | 1828 | | |
1819 | 1829 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
726 | 726 | | |
727 | 727 | | |
728 | 728 | | |
729 | | - | |
| 729 | + | |
| 730 | + | |
730 | 731 | | |
731 | 732 | | |
732 | 733 | | |
| |||
756 | 757 | | |
757 | 758 | | |
758 | 759 | | |
759 | | - | |
| 760 | + | |
760 | 761 | | |
761 | 762 | | |
762 | 763 | | |
763 | 764 | | |
764 | 765 | | |
765 | | - | |
| 766 | + | |
766 | 767 | | |
767 | 768 | | |
768 | 769 | | |
| |||
0 commit comments