MCPcopy Index your code
hub / github.com/RustPython/RustPython / __jit__

Method __jit__

crates/vm/src/builtins/function.rs:1034–1046  ·  view source on GitHub ↗
(zelf: PyRef<Self>, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

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
1049impl GetDescriptor for PyFunction {

Callers 1

jit.pyFile · 0.80

Calls 7

get_jit_arg_typesFunction · 0.85
jit_ret_typeFunction · 0.85
new_jit_errorFunction · 0.85
to_stringMethod · 0.80
compileFunction · 0.50
SomeClass · 0.50
lockMethod · 0.45

Tested by

no test coverage detected