Skip to content

Commit 1c39fdb

Browse files
authored
Bytecode parity (RustPython#7536)
* 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 duplicate_exits_without_lineno (disabled) and Block: Clone Prepare infrastructure for exit block duplication optimization. Currently disabled pending stackdepth integration. * Improve codegen bytecode parity
1 parent 3706c53 commit 1c39fdb

File tree

4 files changed

+791
-216
lines changed

4 files changed

+791
-216
lines changed

Lib/test/test_peepholer.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,6 @@ def f(x):
529529
self.assertEqual(len(returns), 1)
530530
self.check_lnotab(f)
531531

532-
@unittest.expectedFailure # TODO: RUSTPYTHON; KeyError: 20
533532
def test_elim_jump_to_return(self):
534533
# JUMP_FORWARD to RETURN --> RETURN
535534
def f(cond, true_value, false_value):

0 commit comments

Comments
 (0)