(&mut self, ip: usize)
| 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) { |
no test coverage detected