Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update cranelift-module #5094

Merged
merged 1 commit into from
Jan 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion datafusion/common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ pyarrow = ["pyo3", "arrow/pyarrow"]
apache-avro = { version = "0.14", default-features = false, features = ["snappy"], optional = true }
arrow = { version = "31.0.0", default-features = false }
chrono = { version = "0.4", default-features = false }
cranelift-module = { version = "0.89.0", optional = true }
cranelift-module = { version = "0.92.0", optional = true }
num_cpus = "1.13.0"
object_store = { version = "0.5.0", default-features = false, optional = true }
parquet = { version = "31.0.0", default-features = false, optional = true }
Expand Down
21 changes: 15 additions & 6 deletions datafusion/jit/src/jit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,17 +129,26 @@ impl JIT {

// Next, declare the function to jit. Functions must be declared
// before they can be called, or defined.
let id = self.module.declare_function(
&name,
Linkage::Export,
&self.ctx.func.signature,
)?;
let id = self
.module
.declare_function(&name, Linkage::Export, &self.ctx.func.signature)
.map_err(|e| {
DataFusionError::Internal(format!(
"failed in declare the function to jit: {e:?}"
))
})?;

// Define the function to jit. This finishes compilation, although
// there may be outstanding relocations to perform. Currently, jit
// cannot finish relocations until all functions to be called are
// defined. For now, we'll just finalize the function below.
self.module.define_function(id, &mut self.ctx)?;
self.module
.define_function(id, &mut self.ctx)
.map_err(|e| {
DataFusionError::Internal(format!(
"failed in define the function to jit: {e:?}"
))
})?;

// Now that compilation is finished, we can clear out the context state.
self.module.clear_context(&mut self.ctx);
Expand Down