-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Remove SUBSCRIPT, JUMP_IF_{TRUE,FALSE}_OR_POP #6810
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.