MCPcopy Index your code
hub / github.com/RustPython/RustPython / specialize_send

Method specialize_send

crates/vm/src/frame.rs:8671–8694  ·  view source on GitHub ↗
(&mut self, vm: &VirtualMachine, instr_idx: usize, cache_base: usize)

Source from the content-addressed store, hash-verified

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,

Callers 1

execute_instructionMethod · 0.80

Calls 6

adaptive_counter_backoffFunction · 0.85
nth_valueMethod · 0.80
specialize_atMethod · 0.80
read_adaptive_counterMethod · 0.80

Tested by

no test coverage detected