Add newtype of `CodeUnits` by ShaharNaveh ยท Pull Request #6241 ยท RustPython/RustPython
Repository navigation
Add newtype of CodeUnits - #6241
Merged
youknowone merged 3 commits into RustPython:main from ShaharNaveh:impl-codeunits Nov 10, 2025
Merged
Add newtype of CodeUnits #6241
youknowone merged 3 commits into
RustPython:main from
ShaharNaveh:impl-codeunits
Conversation
ShaharNaveh
commented
Nov 9, 2025
·
edited by coderabbitai
Bot
Loading
Copy link Copy Markdown
Contributor
Summary by CodeRabbit
Release Notes
- Refactor
- Improved internal bytecode instruction handling and storage mechanisms for better code organization and maintainability.
- Streamlined bytecode parsing and conversion processes across compiler components.
Base CodeUnits newtype
140ed86
Adjust code to use CodeUnits
8c7466d
coderabbitai
Bot
commented
Nov 9, 2025
·
edited
Loading
Copy link Copy Markdown
Contributor
WalkthroughA new Changes
Sequence DiagramsequenceDiagram
autonumber
participant Old as Old Flow
participant New as New Flow
rect rgba(200, 220, 240, 0.3)
Note over Old,New: Instruction Deserialization
Old->>Old: parse_instructions_from_bytes()
Old->>Old: Iterate chunks (2 bytes)
Old->>Old: Instruction::try_from() per chunk
Old->>Old: Collect to Box<[CodeUnit]>
Old-->>Old: Return Result<Box<[CodeUnit]>>
end
rect rgba(220, 240, 200, 0.3)
Note over New: (New Flow)
New->>New: CodeUnits::try_from(&[u8])
New->>New: Parse all bytes at once
New-->>New: Return Result<CodeUnits>
end
rect rgba(240, 230, 200, 0.3)
Note over Old,New: Usage
Old->>Old: CodeObject { instructions: Box<[...]> }
New->>New: CodeObject { instructions: CodeUnits(...) }
end
Loading
Estimated code review effort๐ฏ 3 (Moderate) | โฑ๏ธ ~25 minutes
Possibly related PRs
Poem
Pre-merge checks and finishing touchesโ Failed checks (1 warning)
๐ Recent review details Configuration used : Path: .coderabbit.yml Review profile : CHILL Plan : Pro ๐ฅ CommitsReviewing files that changed from the base of the PR and between ed9a61d and 8c7466d . ๐ Files selected for processing (4)
๐ CodeRabbit inference engine (.github/copilot-instructions.md)
Files:
๐ CodeRabbit inference engine (.github/copilot-instructions.md)
Files:
Applied to files:
Applied to files:
compiler/core/src/bytecode.rs (3)compiler/codegen/src/ir.rs (1) compiler/core/src/bytecode.rs (5)vm/src/builtins/code.rs (1) compiler/core/src/bytecode.rs (3)compiler/core/src/bytecode.rs (1) compiler/core/src/marshal.rs (4)โฐ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (10)
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. โค๏ธ ShareComment |
View reviewed changes
Comment thread compiler/core/src/marshal.rs
| bytes | ||
| .chunks_exact(2) | ||
| .map(|cu| { | ||
| let op = Instruction::try_from(cu[0])?; |
Trigger CI
7eb336d
youknowone
approved these changes
Nov 9, 2025
View reviewed changes
youknowone merged commit
9792001
into
RustPython : main
Nov 10, 2025
youknowone commented Nov 10, 2025
Copy link Copy Markdown
Member
|
๐ |
Bot
mentioned this pull request Mar 6, 2026 Suspend Python threads before fork() #7364 Merged Sign up for free to join this conversation on GitHub . Already have an account? Sign in to comment