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

Method commit_specialization

crates/vm/src/frame.rs:8110–8128  ·  view source on GitHub ↗
(
        &mut self,
        instr_idx: usize,
        cache_base: usize,
        new_op: Option<Instruction>,
    )

Source from the content-addressed store, hash-verified

8108 /// Commit a specialization result: replace op on success, backoff on failure.
8109 #[inline]
8110 fn commit_specialization(
8111 &mut self,
8112 instr_idx: usize,
8113 cache_base: usize,
8114 new_op: Option<Instruction>,
8115 ) {
8116 if let Some(new_op) = new_op {
8117 self.specialize_at(instr_idx, cache_base, new_op);
8118 } else {
8119 unsafe {
8120 self.code.instructions.write_adaptive_counter(
8121 cache_base,
8122 bytecode::adaptive_counter_backoff(
8123 self.code.instructions.read_adaptive_counter(cache_base),
8124 ),
8125 );
8126 }
8127 }
8128 }
8129
8130 /// Execute a specialized binary op on two int operands.
8131 /// Fallback to generic binary op if either operand is not an exact int.

Callers 7

specialize_binary_opMethod · 0.80
specialize_compare_opMethod · 0.80
specialize_to_boolMethod · 0.80
specialize_for_iterMethod · 0.80

Calls 4

adaptive_counter_backoffFunction · 0.85
specialize_atMethod · 0.80
read_adaptive_counterMethod · 0.80

Tested by

no test coverage detected