mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-29 03:04:38 +08:00
Move cfg onto __jit__ method.
This commit is contained in:
1 parent
3e0673fe00
commit
7a4acdf40f
1 file changed
+5
-8
@@ -301,18 +301,15 @@ impl PyFunction {
|
||||
self.scope.globals.clone()
|
||||
}
|
||||
|
||||
#[allow(unused_variables)]
|
||||
#[cfg(feature = "jit")]
|
||||
#[pymethod(magic)]
|
||||
fn jit(&self, vm: &VirtualMachine) -> PyResult<()> {
|
||||
// TODO move cfg onto function when https://github.com/RustPython/RustPython/pull/2120 lands
|
||||
#[cfg(feature = "jit")]
|
||||
{
|
||||
self.jitted_code.get_or_try_init(|| {
|
||||
self.jitted_code
|
||||
.get_or_try_init(|| {
|
||||
rustpython_jit::compile(&self.code.code)
|
||||
.map_err(|err| vm.new_runtime_error(err.to_string()))
|
||||
})?;
|
||||
}
|
||||
Ok(())
|
||||
})
|
||||
.map(drop)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user