Files
wasmtime/crates/jit/src/native.rs
Alex Crichton 503129ad91 Add a method to share Config across machines (#2608)
With `Module::{serialize,deserialize}` it should be possible to share
wasmtime modules across machines or CPUs. Serialization, however, embeds
a hash of all configuration values, including cranelift compilation
settings. By default wasmtime's selection of the native ISA would enable
ISA flags according to CPU features available on the host, but the same
CPU features may not be available across two machines.

This commit adds a `Config::cranelift_clear_cpu_flags` method which
allows clearing the target-specific ISA flags that are automatically
inferred by default for the native CPU. Options can then be
incrementally built back up as-desired with teh `cranelift_other_flag`
method.
2021-01-26 15:59:12 -06:00

20 lines
601 B
Rust

#![allow(missing_docs)]
use cranelift_codegen;
pub fn builder() -> cranelift_codegen::isa::Builder {
cranelift_native::builder().expect("host machine is not a supported target")
}
pub fn builder_without_flags() -> cranelift_codegen::isa::Builder {
cranelift_native::builder_with_options(cranelift_codegen::isa::BackendVariant::Any, false)
.expect("host machine is not a supported target")
}
pub fn call_conv() -> cranelift_codegen::isa::CallConv {
use target_lexicon::HOST;
cranelift_codegen::isa::CallConv::triple_default(&HOST)
}
pub use cranelift_codegen::isa::lookup;