(
&mut self,
vm: &VirtualMachine,
oparg: LoadSuperAttr,
instr_idx: usize,
cache_base: usize,
)
| 8694 | } |
| 8695 | |
| 8696 | fn specialize_load_super_attr( |
| 8697 | &mut self, |
| 8698 | vm: &VirtualMachine, |
| 8699 | oparg: LoadSuperAttr, |
| 8700 | instr_idx: usize, |
| 8701 | cache_base: usize, |
| 8702 | ) { |
| 8703 | if !matches!( |
| 8704 | self.code.instructions.read_op(instr_idx), |
| 8705 | Instruction::LoadSuperAttr { .. } |
| 8706 | ) { |
| 8707 | return; |
| 8708 | } |
| 8709 | // Stack: [global_super, class, self] |
| 8710 | let global_super = self.nth_value(2); |
| 8711 | let class = self.nth_value(1); |
| 8712 | |
| 8713 | if !global_super.is(&vm.ctx.types.super_type.as_object()) |
| 8714 | || class.downcast_ref::<PyType>().is_none() |
| 8715 | { |
| 8716 | unsafe { |
| 8717 | self.code.instructions.write_adaptive_counter( |
| 8718 | cache_base, |
| 8719 | bytecode::adaptive_counter_backoff( |
| 8720 | self.code.instructions.read_adaptive_counter(cache_base), |
| 8721 | ), |
| 8722 | ); |
| 8723 | } |
| 8724 | return; |
| 8725 | } |
| 8726 | |
| 8727 | let new_op = if oparg.is_load_method() { |
| 8728 | Instruction::LoadSuperAttrMethod |
| 8729 | } else { |
| 8730 | Instruction::LoadSuperAttrAttr |
| 8731 | }; |
| 8732 | self.specialize_at(instr_idx, cache_base, new_op); |
| 8733 | } |
| 8734 | |
| 8735 | fn specialize_compare_op( |
| 8736 | &mut self, |
no test coverage detected