(&mut self, opcode: OpCode, rip: usize, cache: &mut OpcodeCache, chunk: &SSAChunk, slots: &mut [Val])
| 750 | |
| 751 | #[inline(never)] |
| 752 | fn exec_arith_or_compare(&mut self, opcode: OpCode, rip: usize, cache: &mut OpcodeCache, chunk: &SSAChunk, slots: &mut [Val]) -> Result<(), VmErr> { |
| 753 | // Scalar IC fast-path (Div/Pow/Minus skip, Float-only / overflow-prone). |
| 754 | if !matches!(opcode, OpCode::Div | OpCode::Pow | OpCode::Minus | OpCode::Pos) |
| 755 | && let Some(fast) = cache.get_fast(rip) |
| 756 | { |
| 757 | match self.exec_fast(fast)? { |
| 758 | FastOutcome::Done => return Ok(()), |
| 759 | FastOutcome::Overflow => {} |
| 760 | FastOutcome::TypeMiss => cache.invalidate(rip), |
| 761 | } |
| 762 | } |
| 763 | // instance-dunder fast path. |
| 764 | if let Some(inst) = cache.get_inst(rip) { |
| 765 | match self.exec_inst(inst, chunk, slots)? { |
| 766 | FastOutcome::Done => return Ok(()), |
| 767 | FastOutcome::Overflow => {} |
| 768 | FastOutcome::TypeMiss => cache.invalidate_inst(rip), |
| 769 | } |
| 770 | } |
| 771 | if matches!(opcode, OpCode::Eq | OpCode::Lt | OpCode::NotEq | OpCode::Gt | OpCode::LtEq | OpCode::GtEq) { |
| 772 | self.handle_compare(opcode, rip, cache, chunk, slots) |
| 773 | } else { |
| 774 | self.handle_arith(opcode, rip, cache, chunk, slots) |
| 775 | } |
| 776 | } |
| 777 | |
| 778 | /* Charge one unit against the op budget; for native loops (custom-iterator drain, generator collect) that bypass the dispatch back-edge counter. */ |
| 779 | #[inline] |
no test coverage detected