(zelf: PyRef<Self>, vm: &VirtualMachine)
| 1032 | #[cfg(feature = "jit")] |
| 1033 | #[pymethod] |
| 1034 | fn __jit__(zelf: PyRef<Self>, vm: &VirtualMachine) -> PyResult<()> { |
| 1035 | let mut jit_guard = zelf.jitted_code.lock(); |
| 1036 | if jit_guard.is_some() { |
| 1037 | return Ok(()); |
| 1038 | } |
| 1039 | let arg_types = jit::get_jit_arg_types(&zelf, vm)?; |
| 1040 | let ret_type = jit::jit_ret_type(&zelf, vm)?; |
| 1041 | let code: &Py<PyCode> = &zelf.code; |
| 1042 | let compiled = rustpython_jit::compile(&code.code, &arg_types, ret_type) |
| 1043 | .map_err(|err| jit::new_jit_error(err.to_string(), vm))?; |
| 1044 | *jit_guard = Some(compiled); |
| 1045 | Ok(()) |
| 1046 | } |
| 1047 | } |
| 1048 | |
| 1049 | impl GetDescriptor for PyFunction { |
no test coverage detected