Skip to content

Commit 44ddb01

Browse files
committed
Use Opcode
1 parent 39c5bfe commit 44ddb01

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

crates/compiler-core/src/bytecode/instruction.rs

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -757,26 +757,26 @@ impl Instruction {
757757
///
758758
/// _PyOpcode_Caches
759759
pub const fn cache_entries(self) -> usize {
760-
match self.deoptimize() {
761-
Self::LoadAttr { .. } => 9,
762-
Self::BinaryOp { .. } => 5,
763-
Self::LoadGlobal { .. } => 4,
764-
Self::StoreAttr { .. } => 4,
765-
Self::Call { .. } => 3,
766-
Self::CallKw { .. } => 3,
767-
Self::ToBool => 3,
768-
Self::CompareOp { .. } => 1,
769-
Self::ContainsOp { .. } => 1,
770-
Self::ForIter { .. } => 1,
771-
Self::JumpBackward { .. } => 1,
772-
Self::LoadSuperAttr { .. } => 1,
773-
Self::Send { .. } => 1,
774-
Self::StoreSubscr => 1,
775-
Self::UnpackSequence { .. } => 1,
776-
Self::PopJumpIfTrue { .. } => 1,
777-
Self::PopJumpIfFalse { .. } => 1,
778-
Self::PopJumpIfNone { .. } => 1,
779-
Self::PopJumpIfNotNone { .. } => 1,
760+
match self.deoptimize().opcode() {
761+
Opcode::LoadAttr => 9,
762+
Opcode::BinaryOp => 5,
763+
Opcode::LoadGlobal => 4,
764+
Opcode::StoreAttr => 4,
765+
Opcode::Call => 3,
766+
Opcode::CallKw => 3,
767+
Opcode::ToBool => 3,
768+
Opcode::CompareOp => 1,
769+
Opcode::ContainsOp => 1,
770+
Opcode::ForIter => 1,
771+
Opcode::JumpBackward => 1,
772+
Opcode::LoadSuperAttr => 1,
773+
Opcode::Send => 1,
774+
Opcode::StoreSubscr => 1,
775+
Opcode::UnpackSequence => 1,
776+
Opcode::PopJumpIfTrue => 1,
777+
Opcode::PopJumpIfFalse => 1,
778+
Opcode::PopJumpIfNone => 1,
779+
Opcode::PopJumpIfNotNone => 1,
780780
_ => 0,
781781
}
782782
}

0 commit comments

Comments
 (0)