Update rustpython_jit to work with codeobj.constants vec · RustPython/RustPython@3ebdeb7 · GitHub
Skip to content

Commit 3ebdeb7

Browse files
committed
Update rustpython_jit to work with codeobj.constants vec
1 parent 5176864 commit 3ebdeb7

3 files changed

Lines changed: 39 additions & 25 deletions

File tree

jit/src/instructions.rs

Lines changed: 22 additions & 12 deletions

jit/src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ impl Jit {
4646
}
4747
}
4848

49-
fn build_function(
49+
fn build_function<C: bytecode::Constant>(
5050
&mut self,
51-
bytecode: &bytecode::CodeObject,
51+
bytecode: &bytecode::CodeObject<C>,
5252
args: &[JitType],
5353
) -> Result<(FuncId, JitSig), JitCompileError> {
5454
for arg in args {
@@ -92,8 +92,8 @@ impl Jit {
9292
}
9393
}
9494

95-
pub fn compile(
96-
bytecode: &bytecode::CodeObject,
95+
pub fn compile<C: bytecode::Constant>(
96+
bytecode: &bytecode::CodeObject<C>,
9797
args: &[JitType],
9898
) -> Result<CompiledCode, JitCompileError> {
9999
let mut jit = Jit::new();

jit/tests/common.rs

Lines changed: 13 additions & 9 deletions

0 commit comments

Comments
 (0)