Repository navigation
Commit 460458b
Specialize ARM Thumb interface dispatch (microsoft#11339)
* Specialize thumb interface dispatch: skip arg-shuffling wrapper when safe, share dispatch thunks, fast-path string-map set
* Commit copilot suggestion
Remove unused method tryGetFieldInfo
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
* remove unused conditional
* Add codegen test corpus and native thumb test harness
tests/thumb-test compiles programs to native ARM Thumb in-process against a
captured micro:bit (mbcodal) CompileOptions fixture and asserts on the
generated assembly listing; runs offline via gulp testthumb.
lang-test0 gains three semantic files covering condition truthiness and
lowering and interface dispatch (including both sides of the call-site-count
thresholds that gate dispatch specialization), plus a deliberately disabled
repro of the default-parameters-on-dynamic-dispatch defect and a coverage map
(README-codegen.md) tying failure modes to tests and layers.
* Add hw-ab: hardware A/B comparison tooling for micro:bit
Cross-platform node scripts (macOS/Linux/Windows) to build candidate and
reference hexes, flash a micro:bit, capture serial, and diff the traces, with
a gcStats-based soak mode for leak detection. Driven by one wrapper:
npm run hwab -- ab truthiness.
* Harden hw-ab serial capture against stale and cross-case output
Findings from running the capture against a real micro:bit:
- DAPLink buffers serial while no host is reading, so a fresh capture can
open onto the previously flashed program's output, including its PASS
banner. Verdicts are now read only from the flashed program's own
HWAB START banner onward, and --expect <case> (passed by hwab) requires
the banner and verdict to name the flashed case. Timeout diagnostics
report ignored foreign output and point at FAIL.TXT when no banner
appears.
- Panic does not flush the serial FIFO, which truncated the assert id on
the wire. The generated device assert now drains for 250 ms between
logging the id and panicking.
* add 521 flash error guidance
* harden hw-ab capture and diff against flash failures and serial artifacts
* add checked-field-load baseline case
* Add noIfaceSpec switch and differential codegen tests
- gate the five dispatch specializations behind a noIfaceSpec compile switch; with it set, output matches the pre-specialization codegen and no helper text is emitted
- fix the typed index-signature store specialization leaking into the JS backend, which called a runtime entry that only exists on thumb (broke two language tests, one pre-existing)
- emit the index-signature store helper only when a program uses it, instead of in every build
- flip the ifacebaseline expectations to the specialized codegen; add a noIfaceSpec variant pinning the codegen the switch restores
- verified: testlang 57, testthumb 7, A/B hexes differ under the switch
* flip fieldbaseline to the specialized codegen
- flip the fieldbaseline expectations to the specialized codegen; add a noIfaceSpec variant pinning the codegen the switch restores
- verified: testthumb 9, testlang 57, floors fault-injected
---------
Co-authored-by: Eric Anderson <humanapp@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>1 parent 1eb6af3 commit 460458b
6 files changed
Lines changed: 499 additions & 85 deletions
File tree
- localtypings
- pxtcompiler/emitter
- tests/thumb-test
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
801 | 801 | | |
802 | 802 | | |
803 | 803 | | |
| 804 | + | |
804 | 805 | | |
805 | 806 | | |
806 | 807 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
576 | 576 | | |
577 | 577 | | |
578 | 578 | | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
579 | 584 | | |
580 | 585 | | |
581 | 586 | | |
| |||
596 | 601 | | |
597 | 602 | | |
598 | 603 | | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
599 | 633 | | |
600 | 634 | | |
601 | 635 | | |
| |||
839 | 873 | | |
840 | 874 | | |
841 | 875 | | |
842 | | - | |
843 | | - | |
844 | | - | |
| 876 | + | |
| 877 | + | |
845 | 878 | | |
846 | 879 | | |
847 | 880 | | |
848 | 881 | | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
| 914 | + | |
| 915 | + | |
| 916 | + | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
849 | 922 | | |
850 | 923 | | |
851 | 924 | | |
| |||
951 | 1024 | | |
952 | 1025 | | |
953 | 1026 | | |
| 1027 | + | |
| 1028 | + | |
954 | 1029 | | |
955 | 1030 | | |
956 | 1031 | | |
| |||
965 | 1040 | | |
966 | 1041 | | |
967 | 1042 | | |
| 1043 | + | |
| 1044 | + | |
968 | 1045 | | |
969 | 1046 | | |
970 | 1047 | | |
| |||
1071 | 1148 | | |
1072 | 1149 | | |
1073 | 1150 | | |
1074 | | - | |
| 1151 | + | |
| 1152 | + | |
| 1153 | + | |
1075 | 1154 | | |
1076 | 1155 | | |
1077 | 1156 | | |
| |||
1081 | 1160 | | |
1082 | 1161 | | |
1083 | 1162 | | |
| 1163 | + | |
| 1164 | + | |
| 1165 | + | |
| 1166 | + | |
| 1167 | + | |
| 1168 | + | |
| 1169 | + | |
| 1170 | + | |
| 1171 | + | |
| 1172 | + | |
| 1173 | + | |
| 1174 | + | |
| 1175 | + | |
| 1176 | + | |
| 1177 | + | |
| 1178 | + | |
| 1179 | + | |
| 1180 | + | |
| 1181 | + | |
| 1182 | + | |
| 1183 | + | |
| 1184 | + | |
| 1185 | + | |
| 1186 | + | |
| 1187 | + | |
1084 | 1188 | | |
1085 | 1189 | | |
1086 | 1190 | | |
1087 | 1191 | | |
1088 | 1192 | | |
1089 | 1193 | | |
1090 | | - | |
| 1194 | + | |
| 1195 | + | |
| 1196 | + | |
| 1197 | + | |
| 1198 | + | |
1091 | 1199 | | |
1092 | 1200 | | |
1093 | | - | |
1094 | | - | |
1095 | | - | |
1096 | | - | |
| 1201 | + | |
1097 | 1202 | | |
| 1203 | + | |
1098 | 1204 | | |
1099 | 1205 | | |
1100 | | - | |
| 1206 | + | |
| 1207 | + | |
| 1208 | + | |
| 1209 | + | |
| 1210 | + | |
| 1211 | + | |
| 1212 | + | |
| 1213 | + | |
| 1214 | + | |
1101 | 1215 | | |
1102 | 1216 | | |
1103 | 1217 | | |
1104 | 1218 | | |
| 1219 | + | |
| 1220 | + | |
| 1221 | + | |
| 1222 | + | |
| 1223 | + | |
1105 | 1224 | | |
1106 | 1225 | | |
1107 | 1226 | | |
| |||
1144 | 1263 | | |
1145 | 1264 | | |
1146 | 1265 | | |
1147 | | - | |
1148 | | - | |
1149 | | - | |
| 1266 | + | |
| 1267 | + | |
1150 | 1268 | | |
1151 | 1269 | | |
1152 | 1270 | | |
1153 | 1271 | | |
1154 | 1272 | | |
1155 | | - | |
1156 | | - | |
| 1273 | + | |
| 1274 | + | |
1157 | 1275 | | |
1158 | | - | |
1159 | | - | |
| 1276 | + | |
| 1277 | + | |
1160 | 1278 | | |
1161 | | - | |
1162 | | - | |
| 1279 | + | |
| 1280 | + | |
1163 | 1281 | | |
1164 | | - | |
| 1282 | + | |
1165 | 1283 | | |
1166 | | - | |
1167 | | - | |
1168 | | - | |
1169 | | - | |
1170 | | - | |
1171 | | - | |
| 1284 | + | |
| 1285 | + | |
| 1286 | + | |
| 1287 | + | |
| 1288 | + | |
| 1289 | + | |
1172 | 1290 | | |
1173 | 1291 | | |
1174 | 1292 | | |
1175 | 1293 | | |
1176 | | - | |
1177 | | - | |
| 1294 | + | |
| 1295 | + | |
1178 | 1296 | | |
1179 | 1297 | | |
1180 | 1298 | | |
1181 | | - | |
| 1299 | + | |
1182 | 1300 | | |
1183 | | - | |
| 1301 | + | |
1184 | 1302 | | |
1185 | 1303 | | |
1186 | 1304 | | |
| |||
1189 | 1307 | | |
1190 | 1308 | | |
1191 | 1309 | | |
1192 | | - | |
| 1310 | + | |
1193 | 1311 | | |
1194 | | - | |
| 1312 | + | |
1195 | 1313 | | |
1196 | | - | |
1197 | | - | |
1198 | | - | |
| 1314 | + | |
| 1315 | + | |
| 1316 | + | |
| 1317 | + | |
| 1318 | + | |
| 1319 | + | |
| 1320 | + | |
| 1321 | + | |
| 1322 | + | |
| 1323 | + | |
| 1324 | + | |
| 1325 | + | |
| 1326 | + | |
| 1327 | + | |
| 1328 | + | |
| 1329 | + | |
| 1330 | + | |
| 1331 | + | |
| 1332 | + | |
| 1333 | + | |
| 1334 | + | |
| 1335 | + | |
| 1336 | + | |
| 1337 | + | |
| 1338 | + | |
| 1339 | + | |
| 1340 | + | |
| 1341 | + | |
| 1342 | + | |
| 1343 | + | |
| 1344 | + | |
| 1345 | + | |
| 1346 | + | |
| 1347 | + | |
| 1348 | + | |
| 1349 | + | |
| 1350 | + | |
| 1351 | + | |
| 1352 | + | |
| 1353 | + | |
| 1354 | + | |
| 1355 | + | |
| 1356 | + | |
1199 | 1357 | | |
1200 | 1358 | | |
1201 | 1359 | | |
| |||
1292 | 1450 | | |
1293 | 1451 | | |
1294 | 1452 | | |
| 1453 | + | |
| 1454 | + | |
| 1455 | + | |
| 1456 | + | |
| 1457 | + | |
| 1458 | + | |
| 1459 | + | |
1295 | 1460 | | |
1296 | 1461 | | |
1297 | 1462 | | |
| |||
1659 | 1824 | | |
1660 | 1825 | | |
1661 | 1826 | | |
| 1827 | + | |
| 1828 | + | |
| 1829 | + | |
| 1830 | + | |
| 1831 | + | |
| 1832 | + | |
| 1833 | + | |
1662 | 1834 | | |
1663 | 1835 | | |
1664 | 1836 | | |
| |||
0 commit comments