-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Bytecode pseudo opcodes #6715
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
Merged
youknowone
merged 43 commits into
RustPython:main
from
ShaharNaveh:bytecode-pseudo-opcodes
Jan 14, 2026
Merged
Bytecode pseudo opcodes #6715
Changes from 1 commit
Commits
Show all changes
43 commits
Select commit
Hold shift + click to select a range
fad76c6
save
ShaharNaveh af70361
Merge remote-tracking branch 'upstream/main' into bytecode-pseudo-opc…
ShaharNaveh ea53cec
save
ShaharNaveh 1ca20a9
Merge remote-tracking branch 'upstream/main' into bytecode-pseudo-opc…
ShaharNaveh 6f09ebe
Base compiler-core
ShaharNaveh 6805175
save
ShaharNaveh 046e17a
Codegen compile
ShaharNaveh d627623
Move LoadCloure back to RealInstruction
ShaharNaveh 697fe41
Fix opcode.rs
ShaharNaveh 11fc63f
Merge remote-tracking branch 'upstream/main' into bytecode-pseudo-opc…
ShaharNaveh 33b4554
Fix `TryFrom<u8>` for RealInstruction
ShaharNaveh 6140186
Fix script
ShaharNaveh 7acdc1a
Fix jit
ShaharNaveh 0fad43f
Fix typo
ShaharNaveh 24f5161
Fix typo
ShaharNaveh 6e91410
Remove popblock
ShaharNaveh 8751953
Fix docs
ShaharNaveh 8b73441
Fix more docs
ShaharNaveh d6e46f8
ok word `argty`
ShaharNaveh 0872cb6
Revert "ok word `argty`"
ShaharNaveh 0c7880d
Rename argty -> arg_ty
ShaharNaveh 1a5c72b
Merge remote-tracking branch 'upstream/main' into bytecode-pseudo-opc…
ShaharNaveh 761fa4a
Simplify `emit` macro
ShaharNaveh 4eed137
Trigger CI
ShaharNaveh 8f777d2
Trigger CI
ShaharNaveh bff25eb
Trigger CI
ShaharNaveh 91c01e6
Merge remote-tracking branch 'upstream/main' into bytecode-pseudo-opc…
ShaharNaveh f6a0b26
Merge remote-tracking branch 'upstream/main' into bytecode-pseudo-opc…
ShaharNaveh 118ecf3
Move docs
ShaharNaveh c517585
Fix oparg docs
ShaharNaveh 78958aa
Revert "Move docs"
ShaharNaveh a405cca
Merge remote-tracking branch 'upstream/main' into bytecode-pseudo-opc…
ShaharNaveh 8ae98b2
Remove `Eq` & `ParitalEq` for RealInstruction
ShaharNaveh 1453726
Simplify `match` arms
ShaharNaveh f207284
Trigger CI
ShaharNaveh a1555dc
Trigger CI
ShaharNaveh c443f8e
Remove `repr(u16)` for `Instruction`
ShaharNaveh 453212e
Fix doc
ShaharNaveh 1f8722a
Rename the enums
ShaharNaveh 0096a65
Restore fmt_dis for LoadClousure
ShaharNaveh 045d576
Fix script
ShaharNaveh b00f81f
Fix commet
ShaharNaveh 4823d17
Merge remote-tracking branch 'upstream/main' into bytecode-pseudo-opc…
ShaharNaveh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix opcode.rs
- Loading branch information
commit 697fe41c70b3d73d6eca271cc4b7d971e5ec351e
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Fix opcode classification gaps: add missing real jump ops (and likely
LoadSuperAttr) to predicates.has_jump(Line 103-118) should includeRealInstruction::JumpForward/JumpBackward/JumpBackwardNoInterrupt.has_name(Line 82-99) likely needsRealInstruction::LoadSuperAttr { .. }since it indexes intoco_namesvia packed oparg.Proposed fix (extend match arms)
pub fn has_name(opcode: i32) -> bool { matches!( Self::try_from(opcode).map(|op| op.inner()), Ok(Instruction::Real( RealInstruction::DeleteAttr { .. } | RealInstruction::DeleteGlobal(_) | RealInstruction::DeleteName(_) | RealInstruction::ImportFrom { .. } | RealInstruction::ImportName { .. } | RealInstruction::LoadAttr { .. } | RealInstruction::LoadGlobal(_) | RealInstruction::LoadName(_) + | RealInstruction::LoadSuperAttr { .. } | RealInstruction::StoreAttr { .. } | RealInstruction::StoreGlobal(_) | RealInstruction::StoreName(_) ) | Instruction::Pseudo(PseudoInstruction::LoadAttrMethod { .. })) ) } pub fn has_jump(opcode: i32) -> bool { matches!( Self::try_from(opcode).map(|op| op.inner()), Ok(Instruction::Real( RealInstruction::Break { .. } | RealInstruction::Continue { .. } | RealInstruction::ForIter { .. } + | RealInstruction::JumpForward { .. } + | RealInstruction::JumpBackward { .. } + | RealInstruction::JumpBackwardNoInterrupt { .. } | RealInstruction::JumpIfFalseOrPop { .. } | RealInstruction::JumpIfNotExcMatch(_) | RealInstruction::JumpIfTrueOrPop { .. } | RealInstruction::PopJumpIfFalse { .. } | RealInstruction::PopJumpIfTrue { .. } | RealInstruction::Send { .. } ) | Instruction::Pseudo(PseudoInstruction::Jump { .. })) ) }Also applies to: 103-118
🤖 Prompt for AI Agents