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

Function compile

crates/jit/src/lib.rs:117–134  ·  view source on GitHub ↗
(
    bytecode: &bytecode::CodeObject<C>,
    args: &[JitType],
    ret: Option<JitType>,
)

Source from the content-addressed store, hash-verified

115}
116
117pub fn compile<C: bytecode::Constant>(
118 bytecode: &bytecode::CodeObject<C>,
119 args: &[JitType],
120 ret: Option<JitType>,
121) -> Result<CompiledCode, JitCompileError> {
122 let mut jit = Jit::new();
123
124 let (id, sig) = jit.build_function(bytecode, args, ret)?;
125
126 jit.module.finalize_definitions()?;
127
128 let code = jit.module.get_finalized_function(id);
129 Ok(CompiledCode {
130 sig,
131 code,
132 module: ManuallyDrop::new(jit.module),
133 })
134}
135
136pub struct CompiledCode {
137 sig: JitSig,

Callers 2

compileMethod · 0.50
compileMethod · 0.50

Calls 2

newFunction · 0.85
build_functionMethod · 0.45

Tested by 1

compileMethod · 0.40