(&mut self, vm: &VirtualMachine, instr_idx: usize, cache_base: usize)
| 8669 | } |
| 8670 | |
| 8671 | fn specialize_send(&mut self, vm: &VirtualMachine, instr_idx: usize, cache_base: usize) { |
| 8672 | if !matches!( |
| 8673 | self.code.instructions.read_op(instr_idx), |
| 8674 | Instruction::Send { .. } |
| 8675 | ) { |
| 8676 | return; |
| 8677 | } |
| 8678 | // Stack: [receiver, val] — receiver is at position 1 |
| 8679 | let receiver = self.nth_value(1); |
| 8680 | let is_exact_gen_or_coro = receiver.downcast_ref_if_exact::<PyGenerator>(vm).is_some() |
| 8681 | || receiver.downcast_ref_if_exact::<PyCoroutine>(vm).is_some(); |
| 8682 | if is_exact_gen_or_coro && !self.specialization_eval_frame_active(vm) { |
| 8683 | self.specialize_at(instr_idx, cache_base, Instruction::SendGen); |
| 8684 | } else { |
| 8685 | unsafe { |
| 8686 | self.code.instructions.write_adaptive_counter( |
| 8687 | cache_base, |
| 8688 | bytecode::adaptive_counter_backoff( |
| 8689 | self.code.instructions.read_adaptive_counter(cache_base), |
| 8690 | ), |
| 8691 | ); |
| 8692 | } |
| 8693 | } |
| 8694 | } |
| 8695 | |
| 8696 | fn specialize_load_super_attr( |
| 8697 | &mut self, |
no test coverage detected