Remove SUBSCRIPT, JUMP_IF_{TRUE,FALSE}_OR_POP#6810
Remove SUBSCRIPT, JUMP_IF_{TRUE,FALSE}_OR_POP#6810youknowone merged 4 commits intoRustPython:mainfrom
Conversation
📝 WalkthroughWalkthroughThis PR refactors the instruction set by removing four RustPython-specific opcodes (JumpIfFalseOrPop, JumpIfTrueOrPop, LoadAssertionError, and Subscript) and replacing Subscript with BinarySubscr throughout the codegen layer. It also adjusts for-loop cleanup semantics to emit PopTop for non-async iteration paths. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
crates/codegen/src/compile.rs (1)
4928-4935: AddPopTopafterEndAsyncForto clean up the async iterator.The
EndAsyncForinstruction only pops exception handling items (awaitable, exc), not the iterator itself. The iterator remains on the stack after the instruction completes. APopTopmust follow to clean it up, matching the pattern used in comprehension loops at lines 7363-7368 and 7564-7568.if is_async { emit!(self, Instruction::EndAsyncFor); emit!(self, Instruction::PopTop); } else { // Pop the iterator after loop ends emit!(self, Instruction::PopTop); }
Summary by CodeRabbit
Release Notes
✏️ Tip: You can customize this high-level summary in your review settings.