(&self, ip: usize, cache: &mut OpcodeCache, recv: Val, name: &str, arity: u8)
| 133 | /* Post-success recording for the instance-dunder IC; ignored when the receiver isn't an instance or the method isn't on its class. */ |
| 134 | #[inline] |
| 135 | pub(crate) fn record_dunder_hit(&self, ip: usize, cache: &mut OpcodeCache, recv: Val, name: &str, arity: u8) { |
| 136 | if !recv.is_heap() { return; } |
| 137 | // try_get is a backstop; callers root operands across the dunder call. |
| 138 | let Some(HeapObj::Instance(cls, _)) = self.heap.try_get(recv) else { return; }; |
| 139 | let cls = *cls; |
| 140 | let Some((method, _)) = self.lookup_class_member(cls, name) else { return; }; |
| 141 | cache.record_inst(ip, cls.as_heap(), method, arity); |
| 142 | } |
| 143 | |
| 144 | /* Main dispatch loop. Walks the fused instruction stream (LoadAttr+Call already collapsed to CallMethod+CallMethodArgs); checks the IC inline for hot arith/compare opcodes. */ |
| 145 | pub(crate) fn exec(&mut self, chunk: &SSAChunk, slots: &mut [Val]) -> Result<Val, VmErr> { |
no test coverage detected