diff --git a/crates/cli-support/Cargo.toml b/crates/cli-support/Cargo.toml index e0da35675c9..6ad7dab8506 100644 --- a/crates/cli-support/Cargo.toml +++ b/crates/cli-support/Cargo.toml @@ -13,7 +13,7 @@ Shared support for the wasm-bindgen-cli package, an internal dependency [dependencies] base64 = "0.9" failure = "0.1.2" -parity-wasm = "0.32" +parity-wasm = "0.34" serde = "1.0" serde_json = "1.0" tempfile = "3.0" diff --git a/crates/cli-support/src/lib.rs b/crates/cli-support/src/lib.rs index 246e6e7b331..6b9fe6964e9 100644 --- a/crates/cli-support/src/lib.rs +++ b/crates/cli-support/src/lib.rs @@ -8,7 +8,6 @@ extern crate wasm_bindgen_gc; extern crate failure; extern crate wasm_bindgen_wasm_interpreter as wasm_interpreter; -use std::any::Any; use std::collections::BTreeSet; use std::env; use std::fs; @@ -40,7 +39,6 @@ pub struct Bindgen { enum Input { Path(PathBuf), - Bytes(Vec, String), Module(Module, String), None, } @@ -68,33 +66,10 @@ impl Bindgen { } /// Explicitly specify the already parsed input module. - /// - /// Note that this API is a little wonky to avoid tying itself with a public - /// dependency on the `parity-wasm` crate, what we currently use to parse - /// wasm mdoules. - /// - /// If the `module` argument is a `parity_wasm::Module` then it will be used - /// directly. Otherwise it will be passed to `into_bytes` to serialize the - /// module to a vector of bytes, and this will deserialize the module later. - /// - /// Note that even if the argument passed in is a `parity_wasm::Module` it - /// doesn't mean that this won't invoke `into_bytes`, if the `parity_wasm` - /// crate versions are different we'll have to go through serialization. - pub fn input_module( - &mut self, - name: &str, - mut module: T, - into_bytes: impl FnOnce(T) -> Vec, - ) -> &mut Bindgen { + pub fn input_module(&mut self, name: &str, module: Module) -> &mut Bindgen { let name = name.to_string(); - if let Some(module) = (&mut module as &mut Any).downcast_mut::() { - let blank = Module::new(Vec::new()); - self.input = Input::Module(mem::replace(module, blank), name); - return self; - } - - self.input = Input::Bytes(into_bytes(module), name); - self + self.input = Input::Module(module, name); + return self; } pub fn nodejs(&mut self, node: bool) -> &mut Bindgen { @@ -153,11 +128,6 @@ impl Bindgen { let blank_module = Module::new(Vec::new()); (mem::replace(m, blank_module), &name[..]) } - Input::Bytes(ref b, ref name) => { - let module = parity_wasm::deserialize_buffer::(&b) - .context("failed to parse input file as wasm")?; - (module, &name[..]) - } Input::Path(ref path) => { let contents = fs::read(&path) .with_context(|_| format!("failed to read `{}`", path.display()))?; diff --git a/crates/cli/Cargo.toml b/crates/cli/Cargo.toml index c9fc84c5212..72ebf5f9f2b 100644 --- a/crates/cli/Cargo.toml +++ b/crates/cli/Cargo.toml @@ -18,7 +18,7 @@ docopt = "1.0" env_logger = "0.5" failure = "0.1.2" log = "0.4" -parity-wasm = "0.32" +parity-wasm = "0.34" rouille = { version = "2.1.0", default-features = false } serde = "1.0" serde_derive = "1.0" diff --git a/crates/cli/src/bin/wasm-bindgen-test-runner/main.rs b/crates/cli/src/bin/wasm-bindgen-test-runner/main.rs index bf1eaea611d..899a5666b18 100644 --- a/crates/cli/src/bin/wasm-bindgen-test-runner/main.rs +++ b/crates/cli/src/bin/wasm-bindgen-test-runner/main.rs @@ -126,7 +126,7 @@ fn rmain() -> Result<(), Error> { let mut b = Bindgen::new(); b.debug(debug) .nodejs(node) - .input_module(module, wasm, |w| parity_wasm::serialize(w).unwrap()) + .input_module(module, wasm) .keep_debug(false) .generate(&tmpdir) .context("executing `wasm-bindgen` over the wasm file")?; diff --git a/crates/gc/Cargo.toml b/crates/gc/Cargo.toml index 090d55311ac..6cd3a0c61c7 100644 --- a/crates/gc/Cargo.toml +++ b/crates/gc/Cargo.toml @@ -11,6 +11,6 @@ Support for removing unused items from a wasm executable """ [dependencies] -parity-wasm = "0.32" +parity-wasm = "0.34" log = "0.4" rustc-demangle = "0.1.9" diff --git a/crates/gc/src/lib.rs b/crates/gc/src/lib.rs index cdf04e6b5a5..4c7ea0b2686 100644 --- a/crates/gc/src/lib.rs +++ b/crates/gc/src/lib.rs @@ -354,6 +354,7 @@ impl<'a> LiveContext<'a> { ValueType::I64 => {} ValueType::F32 => {} ValueType::F64 => {} + ValueType::V128 => {} } } diff --git a/crates/wasm-interpreter/Cargo.toml b/crates/wasm-interpreter/Cargo.toml index 4c5eb15b50a..0306a3b3442 100644 --- a/crates/wasm-interpreter/Cargo.toml +++ b/crates/wasm-interpreter/Cargo.toml @@ -11,7 +11,7 @@ Micro-interpreter optimized for wasm-bindgen's use case """ [dependencies] -parity-wasm = "0.32" +parity-wasm = "0.34" [dev-dependencies] tempfile = "3"