From 753d650f1a4f0654517cd8337235a745a9074a33 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Thu, 2 Aug 2018 20:50:28 -0700 Subject: [PATCH] Update to cranelift 0.18.1. --- Cargo.toml | 10 +++++----- fuzz/Cargo.toml | 6 +++--- lib/execute/Cargo.toml | 4 ++-- lib/obj/Cargo.toml | 4 ++-- lib/runtime/Cargo.toml | 4 ++-- lib/runtime/src/lib.rs | 13 +++++++++---- 6 files changed, 23 insertions(+), 18 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index fa868edd33..cc04736e85 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,11 +17,11 @@ name = "wasm2obj" path = "src/wasm2obj.rs" [dependencies] -cranelift-codegen = "0.16.1" -cranelift-frontend = "0.16.1" -cranelift-reader = "0.16.1" -cranelift-wasm = "0.16.1" -cranelift-native = "0.16.1" +cranelift-codegen = "0.18.1" +cranelift-frontend = "0.18.1" +cranelift-reader = "0.18.1" +cranelift-wasm = "0.18.1" +cranelift-native = "0.18.1" wasmtime-runtime = { path = "lib/runtime" } wasmtime-execute = { path = "lib/execute" } wasmtime-obj = { path = "lib/obj" } diff --git a/fuzz/Cargo.toml b/fuzz/Cargo.toml index 559250e06c..24ac25240f 100644 --- a/fuzz/Cargo.toml +++ b/fuzz/Cargo.toml @@ -10,9 +10,9 @@ cargo-fuzz = true [dependencies] wasmtime-runtime = { path = "../lib/runtime" } wasmtime-execute = { path = "../lib/execute" } -cranelift-codegen = "0.16.1" -cranelift-wasm = "0.16.1" -cranelift-native = "0.16.1" +cranelift-codegen = "0.18.1" +cranelift-wasm = "0.18.1" +cranelift-native = "0.18.1" libfuzzer-sys = { git = "https://github.com/rust-fuzz/libfuzzer-sys.git" } wasmparser = { version = "0.17.2", default-features = false } diff --git a/lib/execute/Cargo.toml b/lib/execute/Cargo.toml index e7622a5537..471f047df0 100644 --- a/lib/execute/Cargo.toml +++ b/lib/execute/Cargo.toml @@ -8,7 +8,7 @@ repository = "https://github.com/sunfishcode/wasmtime" license = "Apache-2.0 WITH LLVM-exception" [dependencies] -cranelift-codegen = "0.16.1" -cranelift-wasm = "0.16.1" +cranelift-codegen = "0.18.1" +cranelift-wasm = "0.18.1" region = "0.3.0" wasmtime-runtime = { path = "../runtime" } diff --git a/lib/obj/Cargo.toml b/lib/obj/Cargo.toml index c140958312..4c7e72b776 100644 --- a/lib/obj/Cargo.toml +++ b/lib/obj/Cargo.toml @@ -6,7 +6,7 @@ publish = false license = "Apache-2.0 WITH LLVM-exception" [dependencies] -cranelift-codegen = "0.16.1" -cranelift-wasm = "0.16.1" +cranelift-codegen = "0.18.1" +cranelift-wasm = "0.18.1" wasmtime-runtime = { path = "../runtime" } faerie = "0.4.4" diff --git a/lib/runtime/Cargo.toml b/lib/runtime/Cargo.toml index 6c6e4199e4..fdb224390e 100644 --- a/lib/runtime/Cargo.toml +++ b/lib/runtime/Cargo.toml @@ -8,7 +8,7 @@ repository = "https://github.com/sunfishcode/wasmtime" license = "Apache-2.0 WITH LLVM-exception" [dependencies] -cranelift-codegen = "0.16.1" -cranelift-wasm = "0.16.1" +cranelift-codegen = "0.18.1" +cranelift-wasm = "0.18.1" wasmparser = "0.17.2" target-lexicon = "0.0.3" diff --git a/lib/runtime/src/lib.rs b/lib/runtime/src/lib.rs index 22e768162a..15e479109e 100644 --- a/lib/runtime/src/lib.rs +++ b/lib/runtime/src/lib.rs @@ -166,9 +166,9 @@ impl<'data, 'module> ModuleEnvironment<'data, 'module> { FuncEnvironment::new(self.isa, &self.module) } - fn native_pointer(&self) -> ir::Type { + fn pointer_type(&self) -> ir::Type { use cranelift_wasm::FuncEnvironment; - self.func_env().native_pointer() + self.func_env().pointer_type() } /// Declare that translation of the module is complete. This consumes the @@ -282,7 +282,7 @@ impl<'module_environment> cranelift_wasm::FuncEnvironment for FuncEnvironment<'m offset: Offset32::new(0), }); func.create_heap(ir::HeapData { - base: ir::HeapBase::GlobalValue(heap_base), + base: heap_base, min_size: 0.into(), guard_size: 0x8000_0000.into(), style: ir::HeapStyle::Static { @@ -291,6 +291,10 @@ impl<'module_environment> cranelift_wasm::FuncEnvironment for FuncEnvironment<'m }) } + fn make_table(&mut self, _func: &mut ir::Function, _index: TableIndex) -> ir::Table { + unimplemented!("make_table"); + } + fn make_indirect_sig(&mut self, func: &mut ir::Function, index: SignatureIndex) -> ir::SigRef { func.import_signature(self.module.signatures[index].clone()) } @@ -313,6 +317,7 @@ impl<'module_environment> cranelift_wasm::FuncEnvironment for FuncEnvironment<'m &mut self, mut pos: FuncCursor, table_index: TableIndex, + _table: ir::Table, _sig_index: SignatureIndex, sig_ref: ir::SigRef, callee: ir::Value, @@ -414,7 +419,7 @@ impl<'data, 'module> cranelift_wasm::ModuleEnvironment<'data> fn declare_signature(&mut self, sig: &ir::Signature) { let mut sig = sig.clone(); sig.params.push(AbiParam { - value_type: self.native_pointer(), + value_type: self.pointer_type(), purpose: ArgumentPurpose::VMContext, extension: ArgumentExtension::None, location: ArgumentLoc::Unassigned,