Skip to content
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
8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ name = "wasm2obj"
path = "src/wasm2obj.rs"

[dependencies]
cranelift-codegen = "0.26.0"
cranelift-native = "0.26.0"
cranelift-entity = "0.26.0"
cranelift-wasm = "0.26.0"
cranelift-codegen = "0.28.0"
cranelift-native = "0.28.0"
cranelift-entity = "0.28.0"
cranelift-wasm = "0.28.0"
wasmtime-environ = { path = "lib/environ" }
wasmtime-runtime = { path = "lib/runtime" }
wasmtime-jit = { path = "lib/jit" }
Expand Down
6 changes: 3 additions & 3 deletions fuzz/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ cargo-fuzz = true
[dependencies]
wasmtime-environ = { path = "../lib/environ" }
wasmtime-jit = { path = "../lib/jit" }
cranelift-codegen = "0.26.0"
cranelift-wasm = "0.26.0"
cranelift-native = "0.26.0"
cranelift-codegen = "0.28.0"
cranelift-wasm = "0.28.0"
cranelift-native = "0.28.0"
libfuzzer-sys = { git = "https://github.com/rust-fuzz/libfuzzer-sys.git" }
wasmparser = { version = "0.23.0", default-features = false }
binaryen = "0.5.0"
Expand Down
6 changes: 3 additions & 3 deletions lib/environ/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ readme = "README.md"
edition = "2018"

[dependencies]
cranelift-codegen = "0.26.0"
cranelift-entity = "0.26.0"
cranelift-wasm = "0.26.0"
cranelift-codegen = "0.28.0"
cranelift-entity = "0.28.0"
cranelift-wasm = "0.28.0"
cast = { version = "0.2.2", default-features = false }
failure = { version = "0.1.3", default-features = false }
failure_derive = { version = "0.1.3", default-features = false }
Expand Down
26 changes: 5 additions & 21 deletions lib/environ/src/module_environ.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use crate::func_environ::FuncEnvironment;
use crate::module::{Export, MemoryPlan, Module, TableElements, TablePlan};
use crate::tunables::Tunables;
use core::clone::Clone;
use cranelift_codegen::ir;
use cranelift_codegen::ir::{AbiParam, ArgumentPurpose};
use cranelift_codegen::isa::TargetFrontendConfig;
Expand All @@ -10,6 +9,7 @@ use cranelift_wasm::{
self, translate_module, DefinedFuncIndex, FuncIndex, Global, GlobalIndex, Memory, MemoryIndex,
SignatureIndex, Table, TableIndex, WasmResult,
};
use std::boxed::Box;
use std::string::String;
use std::vec::Vec;

Expand Down Expand Up @@ -80,16 +80,12 @@ impl<'data> cranelift_wasm::ModuleEnvironment<'data> for ModuleEnvironment<'data
self.result.target_config
}

fn declare_signature(&mut self, sig: &ir::Signature) {
let sig = translate_signature(sig.clone(), self.pointer_type());
fn declare_signature(&mut self, sig: ir::Signature) {
let sig = translate_signature(sig, self.pointer_type());
// TODO: Deduplicate signatures.
self.result.module.signatures.push(sig);
}

fn get_signature(&self, sig_index: SignatureIndex) -> &ir::Signature {
&self.result.module.signatures[sig_index]
}

fn declare_func_import(&mut self, sig_index: SignatureIndex, module: &str, field: &str) {
debug_assert_eq!(
self.result.module.functions.len(),
Expand All @@ -104,18 +100,10 @@ impl<'data> cranelift_wasm::ModuleEnvironment<'data> for ModuleEnvironment<'data
.push((String::from(module), String::from(field)));
}

fn get_num_func_imports(&self) -> usize {
self.result.module.imported_funcs.len()
}

fn declare_func_type(&mut self, sig_index: SignatureIndex) {
self.result.module.functions.push(sig_index);
}

fn get_func_type(&self, func_index: FuncIndex) -> SignatureIndex {
self.result.module.functions[func_index]
}

fn declare_global_import(&mut self, global: Global, module: &str, field: &str) {
debug_assert_eq!(
self.result.module.globals.len(),
Expand All @@ -134,10 +122,6 @@ impl<'data> cranelift_wasm::ModuleEnvironment<'data> for ModuleEnvironment<'data
self.result.module.globals.push(global);
}

fn get_global(&self, global_index: GlobalIndex) -> &Global {
&self.result.module.globals[global_index]
}

fn declare_table_import(&mut self, table: Table, module: &str, field: &str) {
debug_assert_eq!(
self.result.module.table_plans.len(),
Expand All @@ -163,13 +147,13 @@ impl<'data> cranelift_wasm::ModuleEnvironment<'data> for ModuleEnvironment<'data
table_index: TableIndex,
base: Option<GlobalIndex>,
offset: usize,
elements: Vec<FuncIndex>,
elements: Box<[FuncIndex]>,
) {
self.result.module.table_elements.push(TableElements {
table_index,
base,
offset,
elements,
elements: elements.to_vec(),
});
}

Expand Down
8 changes: 4 additions & 4 deletions lib/jit/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ readme = "README.md"
edition = "2018"

[dependencies]
cranelift-codegen = "0.26.0"
cranelift-entity = "0.26.0"
cranelift-wasm = "0.26.0"
cranelift-frontend = "0.26.0"
cranelift-codegen = "0.28.0"
cranelift-entity = "0.28.0"
cranelift-wasm = "0.28.0"
cranelift-frontend = "0.28.0"
wasmtime-environ = { path = "../environ", default-features = false }
wasmtime-runtime = { path = "../runtime", default-features = false }
region = "1.0.0"
Expand Down
4 changes: 2 additions & 2 deletions lib/obj/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ readme = "README.md"
edition = "2018"

[dependencies]
cranelift-codegen = "0.26.0"
cranelift-entity = "0.26.0"
cranelift-codegen = "0.28.0"
cranelift-entity = "0.28.0"
wasmtime-environ = { path = "../environ" }
faerie = "0.6.0"
6 changes: 3 additions & 3 deletions lib/runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ readme = "README.md"
edition = "2018"

[dependencies]
cranelift-codegen = "0.26.0"
cranelift-entity = "0.26.0"
cranelift-wasm = "0.26.0"
cranelift-codegen = "0.28.0"
cranelift-entity = "0.28.0"
cranelift-wasm = "0.28.0"
wasmtime-environ = { path = "../environ", default-features = false }
region = "1.0.0"
lazy_static = "1.2.0"
Expand Down
8 changes: 4 additions & 4 deletions lib/wast/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ readme = "README.md"
edition = "2018"

[dependencies]
cranelift-codegen = "0.26.0"
cranelift-native = "0.26.0"
cranelift-wasm = "0.26.0"
cranelift-entity = "0.26.0"
cranelift-codegen = "0.28.0"
cranelift-native = "0.28.0"
cranelift-wasm = "0.28.0"
cranelift-entity = "0.28.0"
wasmtime-jit = { path = "../jit" }
wasmtime-runtime = { path = "../runtime" }
wasmtime-environ = { path = "../environ" }
Expand Down