Repository navigation
Commit e21cabc
committed
Bytecode parity - folding, class prologue, except cleanup
Constant folding:
- Add string/bytes multiply and bytes concat folding in IR
- Add constant subscript folding (str, bytes, tuple indexing)
- Delegate list/set constant folding to IR passes
- Stream big non-const list/set via BUILD+LIST_APPEND
Class/generic compilation:
- Reorder class body prologue: __type_params__ before __classdict__
- Build class function before .generic_base in generic classes
- Register .type_params/.generic_base symbols in proper scopes
- Use load_name/store_name helpers for synthetic variables
Return block handling:
- Only duplicate return-None epilogues, not arbitrary returns
- Add inline_pop_except_return_blocks pass
- Add duplicate_named_except_cleanup_returns pass
Other fixes:
- Fix eliminate_dead_stores to only collapse adjacent duplicates
- Skip STORE_FAST_LOAD_FAST superinstruction in generators after FOR_ITER
- Thread jumps through NOP-only blocks
- Transfer NOP line info to following unconditional jumps
- Extract scope_needs_conditional_annotations_cell helper
- Register __conditional_annotations__ for module future annotations1 parent c79baa3 commit e21cabc
8 files changed
Lines changed: 598 additions & 163 deletions
File tree
- Lib/test
- crates
- codegen/src
- vm/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2576 | 2576 | | |
2577 | 2577 | | |
2578 | 2578 | | |
2579 | | - | |
2580 | 2579 | | |
2581 | 2580 | | |
2582 | 2581 | | |
2583 | 2582 | | |
2584 | 2583 | | |
2585 | 2584 | | |
2586 | 2585 | | |
2587 | | - | |
2588 | 2586 | | |
2589 | 2587 | | |
2590 | 2588 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
441 | 441 | | |
442 | 442 | | |
443 | 443 | | |
444 | | - | |
445 | 444 | | |
446 | 445 | | |
447 | 446 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
114 | | - | |
115 | 114 | | |
116 | 115 | | |
117 | 116 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4697 | 4697 | | |
4698 | 4698 | | |
4699 | 4699 | | |
4700 | | - | |
4701 | 4700 | | |
4702 | 4701 | | |
4703 | 4702 | | |
| |||
0 commit comments