Commit 3706c53
authored
Bytecode parity (#7535)
* Add CFG block splitting, jump threading, backward jump normalization, genexpr StopIteration wrapper
- split_blocks_at_jumps: split blocks at branch points so each has one exit
- jump_threading: thread jumps through single-jump blocks (flowgraph.c jump_thread)
- Backward conditional jump normalization: invert and create NOT_TAKEN+JUMP block
- Follow empty blocks in jump-to-return optimization (next_nonempty_block)
- Add PEP 479 StopIteration handler to compile_comprehension for generators
* Add ConstantData::Slice and constant slice folding
- Add Slice variant to ConstantData and BorrowedConstant
- Fold constant slices (x[:3], x[1:4]) into LOAD_CONST(slice(...))
- Marshal serialization/deserialization for Slice type
- Box::leak in borrow_obj_constant for PySlice roundtrip
* Add ConstantData::Frozenset variant (type only, folding deferred)
Add Frozenset to ConstantData, BorrowedConstant, and marshal support.
Actual frozenset folding (BUILD_SET + CONTAINS_OP → LOAD_CONST frozenset)
requires VirtualMachine for element hashing and is deferred.
* Add duplicate_exits_without_lineno (disabled) and Block: Clone
Prepare infrastructure for exit block duplication optimization.
Currently disabled pending stackdepth integration.1 parent e6bcd64 commit 3706c53
File tree
6 files changed
+540
-58
lines changed- crates
- codegen/src
- snapshots
- compiler-core/src
- vm/src/builtins
6 files changed
+540
-58
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7574 | 7574 | | |
7575 | 7575 | | |
7576 | 7576 | | |
| 7577 | + | |
| 7578 | + | |
| 7579 | + | |
| 7580 | + | |
| 7581 | + | |
7577 | 7582 | | |
7578 | 7583 | | |
7579 | 7584 | | |
| |||
8407 | 8412 | | |
8408 | 8413 | | |
8409 | 8414 | | |
| 8415 | + | |
| 8416 | + | |
| 8417 | + | |
| 8418 | + | |
| 8419 | + | |
| 8420 | + | |
| 8421 | + | |
| 8422 | + | |
| 8423 | + | |
| 8424 | + | |
| 8425 | + | |
| 8426 | + | |
| 8427 | + | |
| 8428 | + | |
| 8429 | + | |
| 8430 | + | |
| 8431 | + | |
| 8432 | + | |
8410 | 8433 | | |
8411 | 8434 | | |
8412 | 8435 | | |
| |||
8496 | 8519 | | |
8497 | 8520 | | |
8498 | 8521 | | |
| 8522 | + | |
| 8523 | + | |
| 8524 | + | |
| 8525 | + | |
| 8526 | + | |
| 8527 | + | |
| 8528 | + | |
| 8529 | + | |
| 8530 | + | |
| 8531 | + | |
| 8532 | + | |
| 8533 | + | |
| 8534 | + | |
| 8535 | + | |
| 8536 | + | |
| 8537 | + | |
| 8538 | + | |
8499 | 8539 | | |
8500 | 8540 | | |
8501 | 8541 | | |
| |||
8949 | 8989 | | |
8950 | 8990 | | |
8951 | 8991 | | |
| 8992 | + | |
| 8993 | + | |
| 8994 | + | |
| 8995 | + | |
| 8996 | + | |
| 8997 | + | |
| 8998 | + | |
| 8999 | + | |
| 9000 | + | |
| 9001 | + | |
| 9002 | + | |
| 9003 | + | |
| 9004 | + | |
| 9005 | + | |
| 9006 | + | |
| 9007 | + | |
| 9008 | + | |
| 9009 | + | |
| 9010 | + | |
| 9011 | + | |
| 9012 | + | |
| 9013 | + | |
| 9014 | + | |
| 9015 | + | |
| 9016 | + | |
| 9017 | + | |
| 9018 | + | |
| 9019 | + | |
| 9020 | + | |
| 9021 | + | |
| 9022 | + | |
| 9023 | + | |
| 9024 | + | |
| 9025 | + | |
| 9026 | + | |
| 9027 | + | |
| 9028 | + | |
| 9029 | + | |
| 9030 | + | |
| 9031 | + | |
8952 | 9032 | | |
8953 | 9033 | | |
8954 | 9034 | | |
| |||
0 commit comments