MCPcopy Create free account
hub / github.com/dylan-sutton-chavez/edge-python / invalidate

Method invalidate

compiler/src/modules/vm/cache.rs:132–139  ·  view source on GitHub ↗
(&mut self, ip: usize)

Source from the content-addressed store, hash-verified

130 }
131
132 pub fn invalidate(&mut self, ip: usize) {
133 // Preserve `inst` so the instance-dunder cache survives a scalar specialisation miss at the same site.
134 if let Some(s) = self.slots.get_mut(ip) {
135 s.type_key = 0;
136 s.hits = 0;
137 s.fast = None;
138 }
139 }
140
141 /* Monomorphic instance-dunder hit counter, promotes after `QUICK_THRESH` consecutive hits with the same class + method pair. Polymorphic sites churn (`record_inst` overwrites on mismatch) but never wedge. */
142 pub fn record_inst(&mut self, ip: usize, class: u32, method: Val, arity: u8) {

Callers 1

exec_arith_or_compareMethod · 0.80

Calls 1

get_mutMethod · 0.80

Tested by

no test coverage detected