(
&self,
new_obj: PyObjectRef,
init_func: &Py<PyFunction>,
pos_args: Vec<PyObjectRef>,
vm: &VirtualMachine,
)
| 1340 | } |
| 1341 | |
| 1342 | fn specialization_run_init_cleanup_shim( |
| 1343 | &self, |
| 1344 | new_obj: PyObjectRef, |
| 1345 | init_func: &Py<PyFunction>, |
| 1346 | pos_args: Vec<PyObjectRef>, |
| 1347 | vm: &VirtualMachine, |
| 1348 | ) -> PyResult<PyObjectRef> { |
| 1349 | let shim = self.specialization_new_init_cleanup_frame(vm); |
| 1350 | let shim_result = vm.with_frame_untraced(shim.clone(), |shim| { |
| 1351 | shim.with_exec(vm, |mut exec| exec.push_value(new_obj.clone())); |
| 1352 | |
| 1353 | let mut all_args = Vec::with_capacity(pos_args.len() + 1); |
| 1354 | all_args.push(new_obj.clone()); |
| 1355 | all_args.extend(pos_args); |
| 1356 | |
| 1357 | let init_frame = init_func.prepare_exact_args_frame(all_args, vm); |
| 1358 | let init_result = vm.run_frame(init_frame.clone()); |
| 1359 | release_datastack_frame(&init_frame, vm); |
| 1360 | let init_result = init_result?; |
| 1361 | |
| 1362 | shim.with_exec(vm, |mut exec| exec.push_value(init_result)); |
| 1363 | match shim.run(vm)? { |
| 1364 | ExecutionResult::Return(value) => Ok(value), |
| 1365 | ExecutionResult::Yield(_) => unreachable!("_Py_InitCleanup shim cannot yield"), |
| 1366 | } |
| 1367 | }); |
| 1368 | release_datastack_frame(&shim, vm); |
| 1369 | shim_result |
| 1370 | } |
| 1371 | |
| 1372 | #[inline(always)] |
| 1373 | fn update_lasti(&mut self, f: impl FnOnce(&mut u32)) { |
no test coverage detected