(
&mut self,
vm: &VirtualMachine,
op: impl FnOnce(f64, f64) -> f64,
deopt_op: bytecode::BinaryOperator,
)
| 8156 | /// Fallback to generic binary op if either operand is not an exact float. |
| 8157 | #[inline] |
| 8158 | fn execute_binary_op_float( |
| 8159 | &mut self, |
| 8160 | vm: &VirtualMachine, |
| 8161 | op: impl FnOnce(f64, f64) -> f64, |
| 8162 | deopt_op: bytecode::BinaryOperator, |
| 8163 | ) -> FrameResult { |
| 8164 | let b = self.top_value(); |
| 8165 | let a = self.nth_value(1); |
| 8166 | if let (Some(a_f), Some(b_f)) = ( |
| 8167 | a.downcast_ref_if_exact::<PyFloat>(vm), |
| 8168 | b.downcast_ref_if_exact::<PyFloat>(vm), |
| 8169 | ) { |
| 8170 | let result = op(a_f.to_f64(), b_f.to_f64()); |
| 8171 | self.pop_value(); |
| 8172 | self.pop_value(); |
| 8173 | self.push_value(vm.ctx.new_float(result).into()); |
| 8174 | Ok(None) |
| 8175 | } else { |
| 8176 | self.execute_bin_op(vm, deopt_op) |
| 8177 | } |
| 8178 | } |
| 8179 | |
| 8180 | fn specialize_call( |
| 8181 | &mut self, |
no test coverage detected