Add newtype of CodeUnits - #6241
Conversation
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
Estimated code review effortπ― 3 (Moderate) | β±οΈ ~25 minutes
Possibly related PRs
Poem
Pre-merge checks and finishing touchesβ Failed checks (1 warning)
β Passed checks (2 passed)
β¨ Finishing touches
π§ͺ Generate unit tests (beta)
π Recent review detailsConfiguration used: Path: .coderabbit.yml Review profile: CHILL Plan: Pro π Files selected for processing (4)
π§° Additional context usedπ Path-based instructions (2)**/*.rsπ CodeRabbit inference engine (.github/copilot-instructions.md)
Files:
{vm,stdlib}/**/*.rsπ CodeRabbit inference engine (.github/copilot-instructions.md)
Files:
π§ Learnings (2)π Learning: 2025-09-11T05:06:59.971ZApplied to files:
π Learning: 2025-08-26T05:20:54.540ZApplied to files:
𧬠Code graph analysis (4)compiler/core/src/marshal.rs (1)
compiler/codegen/src/ir.rs (1)
vm/src/builtins/code.rs (1)
compiler/core/src/bytecode.rs (1)
β° 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. Comment |
| bytes | ||
| .chunks_exact(2) | ||
| .map(|cu| { | ||
| let op = Instruction::try_from(cu[0])?; |
There was a problem hiding this comment.
Where is this used in new code?
There was a problem hiding this comment.
|
π |
Summary by CodeRabbit
Release Notes