wasmtime: Extract cranelift/lightbeam compilers to separate crates (#2117)
This commit extracts the two implementations of `Compiler` into two separate crates, `wasmtime-cranelfit` and `wasmtime-lightbeam`. The `wasmtime-jit` crate then depends on these two and instantiates them appropriately. The goal here is to start reducing the weight of the `wasmtime-environ` crate, which currently serves as a common set of types between all `wasmtime-*` crates. Long-term I'd like to remove the dependency on Cranelift from `wasmtime-environ`, but that's going to take a lot more work. In the meantime I figure it's a good way to get started by separating out the lightbeam/cranelift function compilers from the `wasmtime-environ` crate. We can continue to iterate on moving things out in the future, too.
This commit is contained in:
@@ -19,6 +19,8 @@ cranelift-native = { path = "../../cranelift/native", version = "0.66.0" }
|
||||
cranelift-frontend = { path = "../../cranelift/frontend", version = "0.66.0" }
|
||||
wasmtime-environ = { path = "../environ", version = "0.19.0" }
|
||||
wasmtime-runtime = { path = "../runtime", version = "0.19.0" }
|
||||
wasmtime-cranelift = { path = "../cranelift", version = "0.19.0" }
|
||||
wasmtime-lightbeam = { path = "../lightbeam/wasmtime", version = "0.19.0", optional = true }
|
||||
wasmtime-debug = { path = "../debug", version = "0.19.0" }
|
||||
wasmtime-profiling = { path = "../profiling", version = "0.19.0" }
|
||||
wasmtime-obj = { path = "../obj", version = "0.19.0" }
|
||||
@@ -39,7 +41,7 @@ serde = { version = "1.0.94", features = ["derive"] }
|
||||
winapi = { version = "0.3.8", features = ["winnt", "impl-default"] }
|
||||
|
||||
[features]
|
||||
lightbeam = ["wasmtime-environ/lightbeam"]
|
||||
lightbeam = ["wasmtime-lightbeam"]
|
||||
jitdump = ["wasmtime-profiling/jitdump"]
|
||||
vtune = ["wasmtime-profiling/vtune"]
|
||||
parallel-compilation = ["rayon"]
|
||||
|
||||
@@ -50,10 +50,10 @@ impl Compiler {
|
||||
strategy,
|
||||
compiler: match strategy {
|
||||
CompilationStrategy::Auto | CompilationStrategy::Cranelift => {
|
||||
Box::new(wasmtime_environ::cranelift::Cranelift::default())
|
||||
Box::new(wasmtime_cranelift::Cranelift::default())
|
||||
}
|
||||
#[cfg(feature = "lightbeam")]
|
||||
CompilationStrategy::Lightbeam => Box::new(wasmtime_environ::lightbeam::Lightbeam),
|
||||
CompilationStrategy::Lightbeam => Box::new(wasmtime_lightbeam::Lightbeam),
|
||||
},
|
||||
tunables,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user