Commit ea5a6cd
authored
Bytecode parity (#7481)
* Bytecode parity
Compiler changes:
- Remove PUSH_NULL from decorator cal
ls, use CALL 0
- Collect __static_attributes__ from self.xxx = patterns
- Sort __static_attributes__ alphabetically
- Move __classdict__ init before __doc__ in class prologue
- Fold unary negative constants
- Fold constant list/set literals (3+ elements)
- Use BUILD_MAP 0 + MAP_ADD for 16+ dict pairs
- Always run peephole optimizer for s
uperinstructions
- Emit RETURN_GENERATOR for generator
functions
- Add is_generator flag to SymbolTabl
e
* Fix formatting and collapsible_if clippy warnings in compile.rs
* Fix clippy, fold_unary_negative chaining, and generator line tracing
- Replace irrefutable if-let with let for ExceptHandler
- Remove folded UNARY_NEGATIVE instead of replacing with NOP,
enabling chained negation folding
- Initialize prev_line to def line for generators/coroutines
to suppress spurious LINE events from preamble instructions
- Remove expectedFailure markers for now-passing tests
* Fix JIT StoreFastStoreFast, format, and remove expectedFailure markers
- Add StoreFastStoreFast handling in JIT instructions
- Fix cargo fmt in frame.rs
- Remove 11 expectedFailure markers for async jump tests in
test_sys_settrace that now pass
* Fix peephole optimizer: use NOP replacement instead of remove()
Using remove() shifts instruction indices and corrupts subsequent
references, causing "pop stackref but null found" panics at runtime.
Replace folded/combined instructions with NOP instead, which are
cleaned up by the existing remove_nops pass.
* Revert peephole_optimize to use remove() for chaining support
NOP replacement broke chaining of peephole optimizations (e.g.
LOAD_CONST+TO_BOOL then LOAD_CONST+UNARY_NOT for 'not True').
The remove() approach is used by upstream and works correctly here;
fold_unary_negative keeps NOP replacement since it doesn't need chaining.
* Fix StoreFastStoreFast to handle NULL from LoadFastAndClear
StoreFast uses pop_value_opt() to allow NULL values from
LoadFastAndClear in inlined comprehension cleanup paths.
StoreFastStoreFast must do the same, otherwise the peephole
optimizer's fusion of two StoreFast instructions panics when
restoring unbound locals after an inlined comprehension.1 parent 6b5c5a9 commit ea5a6cd
File tree
12 files changed
+519
-209
lines changed- Lib/test
- crates
- codegen/src
- snapshots
- jit/src
- vm/src
12 files changed
+519
-209
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2486 | 2486 | | |
2487 | 2487 | | |
2488 | 2488 | | |
2489 | | - | |
2490 | 2489 | | |
2491 | 2490 | | |
2492 | 2491 | | |
| |||
2518 | 2517 | | |
2519 | 2518 | | |
2520 | 2519 | | |
2521 | | - | |
2522 | 2520 | | |
2523 | 2521 | | |
2524 | 2522 | | |
| |||
2533 | 2531 | | |
2534 | 2532 | | |
2535 | 2533 | | |
2536 | | - | |
2537 | 2534 | | |
2538 | 2535 | | |
2539 | 2536 | | |
| |||
2593 | 2590 | | |
2594 | 2591 | | |
2595 | 2592 | | |
2596 | | - | |
2597 | 2593 | | |
2598 | 2594 | | |
2599 | 2595 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
862 | 862 | | |
863 | 863 | | |
864 | 864 | | |
865 | | - | |
866 | 865 | | |
867 | 866 | | |
868 | 867 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1420 | 1420 | | |
1421 | 1421 | | |
1422 | 1422 | | |
1423 | | - | |
1424 | | - | |
1425 | 1423 | | |
1426 | 1424 | | |
1427 | 1425 | | |
| |||
1430 | 1428 | | |
1431 | 1429 | | |
1432 | 1430 | | |
1433 | | - | |
1434 | | - | |
1435 | 1431 | | |
1436 | 1432 | | |
1437 | 1433 | | |
| |||
1539 | 1535 | | |
1540 | 1536 | | |
1541 | 1537 | | |
1542 | | - | |
1543 | | - | |
1544 | 1538 | | |
1545 | 1539 | | |
1546 | 1540 | | |
| |||
1553 | 1547 | | |
1554 | 1548 | | |
1555 | 1549 | | |
1556 | | - | |
1557 | | - | |
1558 | 1550 | | |
1559 | 1551 | | |
1560 | 1552 | | |
| |||
1624 | 1616 | | |
1625 | 1617 | | |
1626 | 1618 | | |
1627 | | - | |
1628 | | - | |
1629 | 1619 | | |
1630 | 1620 | | |
1631 | 1621 | | |
| |||
1643 | 1633 | | |
1644 | 1634 | | |
1645 | 1635 | | |
1646 | | - | |
1647 | | - | |
1648 | 1636 | | |
1649 | 1637 | | |
1650 | 1638 | | |
| |||
1663 | 1651 | | |
1664 | 1652 | | |
1665 | 1653 | | |
1666 | | - | |
1667 | | - | |
1668 | 1654 | | |
1669 | 1655 | | |
1670 | 1656 | | |
| |||
1684 | 1670 | | |
1685 | 1671 | | |
1686 | 1672 | | |
1687 | | - | |
1688 | | - | |
1689 | 1673 | | |
1690 | 1674 | | |
1691 | 1675 | | |
| |||
1719 | 1703 | | |
1720 | 1704 | | |
1721 | 1705 | | |
1722 | | - | |
1723 | | - | |
1724 | 1706 | | |
1725 | 1707 | | |
1726 | 1708 | | |
| |||
1768 | 1750 | | |
1769 | 1751 | | |
1770 | 1752 | | |
1771 | | - | |
1772 | | - | |
1773 | 1753 | | |
1774 | 1754 | | |
1775 | 1755 | | |
| |||
2053 | 2033 | | |
2054 | 2034 | | |
2055 | 2035 | | |
2056 | | - | |
2057 | | - | |
2058 | 2036 | | |
2059 | 2037 | | |
2060 | 2038 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1200 | 1200 | | |
1201 | 1201 | | |
1202 | 1202 | | |
1203 | | - | |
1204 | | - | |
| 1203 | + | |
| 1204 | + | |
| 1205 | + | |
| 1206 | + | |
1205 | 1207 | | |
1206 | 1208 | | |
1207 | 1209 | | |
| |||
2758 | 2760 | | |
2759 | 2761 | | |
2760 | 2762 | | |
2761 | | - | |
2762 | 2763 | | |
2763 | 2764 | | |
2764 | 2765 | | |
2765 | 2766 | | |
2766 | | - | |
2767 | | - | |
2768 | | - | |
2769 | | - | |
| 2767 | + | |
| 2768 | + | |
2770 | 2769 | | |
2771 | 2770 | | |
2772 | | - | |
| 2771 | + | |
2773 | 2772 | | |
2774 | 2773 | | |
2775 | 2774 | | |
| |||
4510 | 4509 | | |
4511 | 4510 | | |
4512 | 4511 | | |
| 4512 | + | |
| 4513 | + | |
| 4514 | + | |
| 4515 | + | |
| 4516 | + | |
| 4517 | + | |
| 4518 | + | |
| 4519 | + | |
| 4520 | + | |
| 4521 | + | |
| 4522 | + | |
| 4523 | + | |
| 4524 | + | |
| 4525 | + | |
| 4526 | + | |
| 4527 | + | |
| 4528 | + | |
| 4529 | + | |
| 4530 | + | |
| 4531 | + | |
| 4532 | + | |
| 4533 | + | |
| 4534 | + | |
| 4535 | + | |
| 4536 | + | |
| 4537 | + | |
| 4538 | + | |
| 4539 | + | |
| 4540 | + | |
| 4541 | + | |
| 4542 | + | |
| 4543 | + | |
| 4544 | + | |
| 4545 | + | |
| 4546 | + | |
| 4547 | + | |
| 4548 | + | |
| 4549 | + | |
| 4550 | + | |
| 4551 | + | |
| 4552 | + | |
| 4553 | + | |
| 4554 | + | |
| 4555 | + | |
| 4556 | + | |
| 4557 | + | |
| 4558 | + | |
| 4559 | + | |
| 4560 | + | |
| 4561 | + | |
| 4562 | + | |
| 4563 | + | |
| 4564 | + | |
| 4565 | + | |
| 4566 | + | |
| 4567 | + | |
| 4568 | + | |
| 4569 | + | |
| 4570 | + | |
| 4571 | + | |
| 4572 | + | |
| 4573 | + | |
| 4574 | + | |
| 4575 | + | |
| 4576 | + | |
| 4577 | + | |
| 4578 | + | |
| 4579 | + | |
| 4580 | + | |
| 4581 | + | |
| 4582 | + | |
| 4583 | + | |
| 4584 | + | |
| 4585 | + | |
| 4586 | + | |
| 4587 | + | |
| 4588 | + | |
| 4589 | + | |
| 4590 | + | |
| 4591 | + | |
| 4592 | + | |
| 4593 | + | |
| 4594 | + | |
| 4595 | + | |
| 4596 | + | |
| 4597 | + | |
| 4598 | + | |
4513 | 4599 | | |
4514 | 4600 | | |
4515 | 4601 | | |
| |||
4617 | 4703 | | |
4618 | 4704 | | |
4619 | 4705 | | |
| 4706 | + | |
| 4707 | + | |
| 4708 | + | |
| 4709 | + | |
| 4710 | + | |
| 4711 | + | |
| 4712 | + | |
4620 | 4713 | | |
4621 | 4714 | | |
4622 | 4715 | | |
| |||
4645 | 4738 | | |
4646 | 4739 | | |
4647 | 4740 | | |
4648 | | - | |
4649 | | - | |
4650 | | - | |
4651 | | - | |
4652 | | - | |
4653 | | - | |
4654 | | - | |
4655 | 4741 | | |
4656 | 4742 | | |
4657 | 4743 | | |
| |||
4669 | 4755 | | |
4670 | 4756 | | |
4671 | 4757 | | |
| 4758 | + | |
| 4759 | + | |
| 4760 | + | |
| 4761 | + | |
| 4762 | + | |
| 4763 | + | |
| 4764 | + | |
| 4765 | + | |
| 4766 | + | |
| 4767 | + | |
4672 | 4768 | | |
4673 | 4769 | | |
4674 | 4770 | | |
| |||
4684 | 4780 | | |
4685 | 4781 | | |
4686 | 4782 | | |
4687 | | - | |
| 4783 | + | |
4688 | 4784 | | |
4689 | 4785 | | |
4690 | 4786 | | |
4691 | 4787 | | |
4692 | 4788 | | |
4693 | 4789 | | |
4694 | 4790 | | |
| 4791 | + | |
4695 | 4792 | | |
4696 | 4793 | | |
4697 | 4794 | | |
| |||
5091 | 5188 | | |
5092 | 5189 | | |
5093 | 5190 | | |
5094 | | - | |
5095 | | - | |
| 5191 | + | |
5096 | 5192 | | |
5097 | 5193 | | |
5098 | 5194 | | |
| |||
5112 | 5208 | | |
5113 | 5209 | | |
5114 | 5210 | | |
5115 | | - | |
5116 | | - | |
| 5211 | + | |
5117 | 5212 | | |
5118 | 5213 | | |
5119 | 5214 | | |
| |||
5168 | 5263 | | |
5169 | 5264 | | |
5170 | 5265 | | |
5171 | | - | |
5172 | | - | |
| 5266 | + | |
| 5267 | + | |
5173 | 5268 | | |
5174 | 5269 | | |
5175 | 5270 | | |
| |||
6894 | 6989 | | |
6895 | 6990 | | |
6896 | 6991 | | |
6897 | | - | |
6898 | | - | |
6899 | | - | |
6900 | | - | |
6901 | | - | |
6902 | | - | |
6903 | | - | |
6904 | | - | |
6905 | | - | |
| 6992 | + | |
| 6993 | + | |
| 6994 | + | |
| 6995 | + | |
| 6996 | + | |
| 6997 | + | |
| 6998 | + | |
| 6999 | + | |
| 7000 | + | |
6906 | 7001 | | |
6907 | | - | |
| 7002 | + | |
| 7003 | + | |
| 7004 | + | |
| 7005 | + | |
| 7006 | + | |
| 7007 | + | |
| 7008 | + | |
| 7009 | + | |
| 7010 | + | |
| 7011 | + | |
| 7012 | + | |
| 7013 | + | |
6908 | 7014 | | |
6909 | 7015 | | |
6910 | 7016 | | |
| |||
0 commit comments