Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Fix docs
  • Loading branch information
ShaharNaveh committed Mar 17, 2026
commit 2aef7fca1a65721eea5608a9883520780c5ba4bc
5 changes: 3 additions & 2 deletions crates/compiler-core/src/bytecode/instruction.rs
Copy link
Copy Markdown
Contributor Author

@ShaharNaveh ShaharNaveh Mar 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes to this file are purely "cosmetic". Altering the arms order (and variants order) so the generated output will match CPython

Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,8 @@ impl Instruction {
_ => return None,
})
}
/// Map a specialized or instrumented opcode back to its adaptive (base) variant.

/// Map a specialized opcode back to its adaptive (base) variant.
/// `_PyOpcode_Deopt`
pub const fn deopt(self) -> Option<Self> {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have extracted the specializations depot part of the deoptimize method into a separate one called deopt.
The behavior of deoptimize did not change

Some(match self {
Expand Down Expand Up @@ -681,7 +682,7 @@ impl Instruction {
})
}

/// Map a specialized opcode back to its adaptive (base) variant.
/// Map a specialized or instrumented opcode back to its adaptive (base) variant.
pub const fn deoptimize(self) -> Self {
match self.deopt() {
Some(v) => v,
Expand Down
Loading