Skip to content

Commit cbd229c

Browse files
committed
Update cranelift deps
1 parent 0fe96f1 commit cbd229c

File tree

3 files changed

+48
-47
lines changed

3 files changed

+48
-47
lines changed

Cargo.lock

+38-37
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

jit/Cargo.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ edition = "2018"
1010
autotests = false
1111

1212
[dependencies]
13-
cranelift = "0.68.0"
14-
cranelift-module = "0.68.0"
15-
cranelift-simplejit = "0.68.0"
13+
cranelift = "0.69.0"
14+
cranelift-module = "0.69.0"
15+
cranelift-jit = "0.69.0"
1616
num-traits = "0.2"
1717
libffi = "1.0"
1818
rustpython-bytecode = { path = "../bytecode", version = "0.1.2" }

jit/src/lib.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
use std::fmt;
22

33
use cranelift::prelude::*;
4+
use cranelift_jit::{JITBuilder, JITModule};
45
use cranelift_module::{FuncId, Linkage, Module, ModuleError};
5-
use cranelift_simplejit::{SimpleJITBuilder, SimpleJITModule, SimpleJITProduct};
66

77
use rustpython_bytecode as bytecode;
88

@@ -32,13 +32,13 @@ pub enum JitArgumentError {
3232
struct Jit {
3333
builder_context: FunctionBuilderContext,
3434
ctx: codegen::Context,
35-
module: SimpleJITModule,
35+
module: JITModule,
3636
}
3737

3838
impl Jit {
3939
fn new() -> Self {
40-
let builder = SimpleJITBuilder::new(cranelift_module::default_libcall_names());
41-
let module = SimpleJITModule::new(builder);
40+
let builder = JITBuilder::new(cranelift_module::default_libcall_names());
41+
let module = JITModule::new(builder);
4242
Self {
4343
builder_context: FunctionBuilderContext::new(),
4444
ctx: module.make_context(),
@@ -105,14 +105,14 @@ pub fn compile<C: bytecode::Constant>(
105105
Ok(CompiledCode {
106106
sig,
107107
code,
108-
memory: jit.module.finish(),
108+
module: jit.module,
109109
})
110110
}
111111

112112
pub struct CompiledCode {
113113
sig: JitSig,
114114
code: *const u8,
115-
memory: SimpleJITProduct,
115+
module: JITModule,
116116
}
117117

118118
impl CompiledCode {
@@ -287,7 +287,7 @@ unsafe impl Sync for CompiledCode {}
287287
impl Drop for CompiledCode {
288288
fn drop(&mut self) {
289289
// SAFETY: The only pointer that this memory will also be dropped now
290-
unsafe { self.memory.free_memory() }
290+
unsafe { self.module.free_memory() }
291291
}
292292
}
293293

0 commit comments

Comments
 (0)