Move all trampoline compilation to wasmtime-cranelift (#3176)
* Move all trampoline compilation to `wasmtime-cranelift` This commit moves compilation of all the trampolines used in wasmtime behind the `Compiler` trait object to live in `wasmtime-cranelift`. The long-term goal of this is to enable depending on cranelift *only* from the `wasmtime-cranelift` crate, so by moving these dependencies we should make that a little more flexible. * Fix windows build
This commit is contained in:
@@ -4,7 +4,6 @@ use anyhow::{anyhow, Result};
|
||||
use std::str::FromStr;
|
||||
use structopt::StructOpt;
|
||||
use wasmtime_environ::settings::{self, Setting, SettingKind};
|
||||
use wasmtime_jit::native;
|
||||
|
||||
/// Displays available Cranelift settings for a target.
|
||||
#[derive(StructOpt)]
|
||||
@@ -19,10 +18,10 @@ impl SettingsCommand {
|
||||
/// Executes the command.
|
||||
pub fn execute(self) -> Result<()> {
|
||||
let settings = match &self.target {
|
||||
Some(target) => {
|
||||
native::lookup(target_lexicon::Triple::from_str(target).map_err(|e| anyhow!(e))?)?
|
||||
}
|
||||
None => native::builder(),
|
||||
Some(target) => wasmtime_environ::isa::lookup(
|
||||
target_lexicon::Triple::from_str(target).map_err(|e| anyhow!(e))?,
|
||||
)?,
|
||||
None => cranelift_native::builder().unwrap(),
|
||||
};
|
||||
|
||||
let mut enums = (Vec::new(), 0, "Enum settings:");
|
||||
|
||||
@@ -4,7 +4,7 @@ use target_lexicon::Triple;
|
||||
use wasmparser::WasmFeatures;
|
||||
use wasmtime::Strategy;
|
||||
use wasmtime_environ::{settings, settings::Configurable, ModuleEnvironment, Tunables};
|
||||
use wasmtime_jit::{native, Compiler};
|
||||
use wasmtime_jit::Compiler;
|
||||
|
||||
/// Creates object file from binary wasm data.
|
||||
pub fn compile_to_obj(
|
||||
@@ -16,8 +16,8 @@ pub fn compile_to_obj(
|
||||
debug_info: bool,
|
||||
) -> Result<Object> {
|
||||
let isa_builder = match target {
|
||||
Some(target) => native::lookup(target.clone())?,
|
||||
None => native::builder(),
|
||||
Some(target) => wasmtime_environ::isa::lookup(target.clone())?,
|
||||
None => cranelift_native::builder().unwrap(),
|
||||
};
|
||||
let mut flag_builder = settings::builder();
|
||||
let mut features = WasmFeatures::default();
|
||||
|
||||
Reference in New Issue
Block a user