diff --git a/Cargo.lock b/Cargo.lock index f7983559b..227a6d813 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -469,7 +469,7 @@ dependencies = [ "itertools", "log", "smallvec", - "wasmparser 0.215.0 (registry+https://github.com/rust-lang/crates.io-index)", + "wasmparser 0.215.0", "wasmtime-types", ] @@ -1441,10 +1441,10 @@ name = "test-helpers" version = "0.0.0" dependencies = [ "codegen-macro", - "wasm-encoder 0.215.0 (git+https://github.com/cpetig/wasm-tools?branch=symmetric)", + "wasm-encoder 0.216.0 (git+https://github.com/cpetig/wasm-tools?branch=symmetric)", "wit-bindgen-core", "wit-component", - "wit-parser 0.215.0 (git+https://github.com/cpetig/wasm-tools?branch=symmetric)", + "wit-parser 0.216.0", ] [[package]] @@ -1719,26 +1719,26 @@ dependencies = [ [[package]] name = "wasm-encoder" -version = "0.215.0" -source = "git+https://github.com/cpetig/wasm-tools?branch=symmetric#6df489f6d283a159aa6ecae866f22514d2643d34" +version = "0.216.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04c23aebea22c8a75833ae08ed31ccc020835b12a41999e58c31464271b94a88" dependencies = [ "leb128", - "wasmparser 0.215.0 (git+https://github.com/cpetig/wasm-tools?branch=symmetric)", ] [[package]] name = "wasm-encoder" version = "0.216.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04c23aebea22c8a75833ae08ed31ccc020835b12a41999e58c31464271b94a88" +source = "git+https://github.com/cpetig/wasm-tools?branch=symmetric#1e43a18af72c1fa79f2e6d9e3a9a726c0d1b2c27" dependencies = [ "leb128", + "wasmparser 0.216.0", ] [[package]] name = "wasm-metadata" -version = "0.215.0" -source = "git+https://github.com/cpetig/wasm-tools?branch=symmetric#6df489f6d283a159aa6ecae866f22514d2643d34" +version = "0.216.0" +source = "git+https://github.com/cpetig/wasm-tools?branch=symmetric#1e43a18af72c1fa79f2e6d9e3a9a726c0d1b2c27" dependencies = [ "anyhow", "indexmap", @@ -1746,8 +1746,8 @@ dependencies = [ "serde_derive", "serde_json", "spdx", - "wasm-encoder 0.215.0 (git+https://github.com/cpetig/wasm-tools?branch=symmetric)", - "wasmparser 0.215.0 (git+https://github.com/cpetig/wasm-tools?branch=symmetric)", + "wasm-encoder 0.216.0 (git+https://github.com/cpetig/wasm-tools?branch=symmetric)", + "wasmparser 0.216.0", ] [[package]] @@ -1766,8 +1766,8 @@ dependencies = [ [[package]] name = "wasmparser" -version = "0.215.0" -source = "git+https://github.com/cpetig/wasm-tools?branch=symmetric#6df489f6d283a159aa6ecae866f22514d2643d34" +version = "0.216.0" +source = "git+https://github.com/cpetig/wasm-tools?branch=symmetric#1e43a18af72c1fa79f2e6d9e3a9a726c0d1b2c27" dependencies = [ "ahash", "bitflags", @@ -1785,7 +1785,7 @@ checksum = "d8e9a325d85053408209b3d2ce5eaddd0dd6864d1cff7a007147ba073157defc" dependencies = [ "anyhow", "termcolor", - "wasmparser 0.215.0 (registry+https://github.com/rust-lang/crates.io-index)", + "wasmparser 0.215.0", ] [[package]] @@ -1826,8 +1826,8 @@ dependencies = [ "smallvec", "sptr", "target-lexicon", - "wasm-encoder 0.215.0 (registry+https://github.com/rust-lang/crates.io-index)", - "wasmparser 0.215.0 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-encoder 0.215.0", + "wasmparser 0.215.0", "wasmtime-asm-macros", "wasmtime-cache", "wasmtime-component-macro", @@ -1840,7 +1840,7 @@ dependencies = [ "wasmtime-slab", "wasmtime-versioned-export-macros", "wasmtime-winch", - "wat 1.216.0", + "wat 1.216.0 (registry+https://github.com/rust-lang/crates.io-index)", "windows-sys 0.52.0", ] @@ -1885,7 +1885,7 @@ dependencies = [ "syn", "wasmtime-component-util", "wasmtime-wit-bindgen", - "wit-parser 0.215.0 (registry+https://github.com/rust-lang/crates.io-index)", + "wit-parser 0.215.0", ] [[package]] @@ -1913,7 +1913,7 @@ dependencies = [ "object", "target-lexicon", "thiserror", - "wasmparser 0.215.0 (registry+https://github.com/rust-lang/crates.io-index)", + "wasmparser 0.215.0", "wasmtime-environ", "wasmtime-versioned-export-macros", ] @@ -1938,8 +1938,8 @@ dependencies = [ "serde", "serde_derive", "target-lexicon", - "wasm-encoder 0.215.0 (registry+https://github.com/rust-lang/crates.io-index)", - "wasmparser 0.215.0 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-encoder 0.215.0", + "wasmparser 0.215.0", "wasmprinter", "wasmtime-component-util", "wasmtime-types", @@ -2001,7 +2001,7 @@ dependencies = [ "serde", "serde_derive", "smallvec", - "wasmparser 0.215.0 (registry+https://github.com/rust-lang/crates.io-index)", + "wasmparser 0.215.0", ] [[package]] @@ -2057,7 +2057,7 @@ dependencies = [ "gimli", "object", "target-lexicon", - "wasmparser 0.215.0 (registry+https://github.com/rust-lang/crates.io-index)", + "wasmparser 0.215.0", "wasmtime-cranelift", "wasmtime-environ", "winch-codegen", @@ -2072,7 +2072,7 @@ dependencies = [ "anyhow", "heck 0.4.1", "indexmap", - "wit-parser 0.215.0 (registry+https://github.com/rust-lang/crates.io-index)", + "wit-parser 0.215.0", ] [[package]] @@ -2086,44 +2086,44 @@ dependencies = [ [[package]] name = "wast" -version = "215.0.0" -source = "git+https://github.com/cpetig/wasm-tools?branch=symmetric#6df489f6d283a159aa6ecae866f22514d2643d34" +version = "216.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7eb1f2eecd913fdde0dc6c3439d0f24530a98ac6db6cb3d14d92a5328554a08" dependencies = [ "bumpalo", "leb128", "memchr", "unicode-width", - "wasm-encoder 0.215.0 (git+https://github.com/cpetig/wasm-tools?branch=symmetric)", + "wasm-encoder 0.216.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "wast" version = "216.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7eb1f2eecd913fdde0dc6c3439d0f24530a98ac6db6cb3d14d92a5328554a08" +source = "git+https://github.com/cpetig/wasm-tools?branch=symmetric#1e43a18af72c1fa79f2e6d9e3a9a726c0d1b2c27" dependencies = [ "bumpalo", "leb128", "memchr", "unicode-width", - "wasm-encoder 0.216.0", + "wasm-encoder 0.216.0 (git+https://github.com/cpetig/wasm-tools?branch=symmetric)", ] [[package]] name = "wat" -version = "1.215.0" -source = "git+https://github.com/cpetig/wasm-tools?branch=symmetric#6df489f6d283a159aa6ecae866f22514d2643d34" +version = "1.216.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac0409090fb5154f95fb5ba3235675fd9e579e731524d63b6a2f653e1280c82a" dependencies = [ - "wast 215.0.0", + "wast 216.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "wat" version = "1.216.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac0409090fb5154f95fb5ba3235675fd9e579e731524d63b6a2f653e1280c82a" +source = "git+https://github.com/cpetig/wasm-tools?branch=symmetric#1e43a18af72c1fa79f2e6d9e3a9a726c0d1b2c27" dependencies = [ - "wast 216.0.0", + "wast 216.0.0 (git+https://github.com/cpetig/wasm-tools?branch=symmetric)", ] [[package]] @@ -2211,7 +2211,7 @@ dependencies = [ "regalloc2", "smallvec", "target-lexicon", - "wasmparser 0.215.0 (registry+https://github.com/rust-lang/crates.io-index)", + "wasmparser 0.215.0", "wasmtime-cranelift", "wasmtime-environ", ] @@ -2353,11 +2353,11 @@ dependencies = [ "clap", "heck 0.5.0", "test-helpers", - "wasm-encoder 0.215.0 (git+https://github.com/cpetig/wasm-tools?branch=symmetric)", + "wasm-encoder 0.216.0 (git+https://github.com/cpetig/wasm-tools?branch=symmetric)", "wasm-metadata", "wit-bindgen-core", "wit-component", - "wit-parser 0.215.0 (git+https://github.com/cpetig/wasm-tools?branch=symmetric)", + "wit-parser 0.216.0", ] [[package]] @@ -2368,8 +2368,8 @@ dependencies = [ "clap", "heck 0.5.0", "test-artifacts", - "wasm-encoder 0.215.0 (git+https://github.com/cpetig/wasm-tools?branch=symmetric)", - "wasmparser 0.215.0 (git+https://github.com/cpetig/wasm-tools?branch=symmetric)", + "wasm-encoder 0.216.0 (git+https://github.com/cpetig/wasm-tools?branch=symmetric)", + "wasmparser 0.216.0", "wasmtime", "wasmtime-wasi", "wit-bindgen-bridge", @@ -2383,7 +2383,7 @@ dependencies = [ "wit-bindgen-rust", "wit-bindgen-teavm-java", "wit-component", - "wit-parser 0.215.0 (git+https://github.com/cpetig/wasm-tools?branch=symmetric)", + "wit-parser 0.216.0", ] [[package]] @@ -2392,7 +2392,7 @@ version = "0.30.0" dependencies = [ "anyhow", "heck 0.5.0", - "wit-parser 0.215.0 (git+https://github.com/cpetig/wasm-tools?branch=symmetric)", + "wit-parser 0.216.0", ] [[package]] @@ -2403,7 +2403,7 @@ dependencies = [ "clap", "heck 0.5.0", "test-helpers", - "wasm-encoder 0.215.0 (git+https://github.com/cpetig/wasm-tools?branch=symmetric)", + "wasm-encoder 0.216.0 (git+https://github.com/cpetig/wasm-tools?branch=symmetric)", "wasm-metadata", "wit-bindgen-c", "wit-bindgen-core", @@ -2419,12 +2419,12 @@ dependencies = [ "heck 0.5.0", "indexmap", "test-helpers", - "wasm-encoder 0.215.0 (git+https://github.com/cpetig/wasm-tools?branch=symmetric)", + "wasm-encoder 0.216.0 (git+https://github.com/cpetig/wasm-tools?branch=symmetric)", "wasm-metadata", - "wasmparser 0.215.0 (git+https://github.com/cpetig/wasm-tools?branch=symmetric)", + "wasmparser 0.216.0", "wit-bindgen-core", "wit-component", - "wit-parser 0.215.0 (git+https://github.com/cpetig/wasm-tools?branch=symmetric)", + "wit-parser 0.216.0", ] [[package]] @@ -2518,8 +2518,8 @@ dependencies = [ [[package]] name = "wit-component" -version = "0.215.0" -source = "git+https://github.com/cpetig/wasm-tools?branch=symmetric#6df489f6d283a159aa6ecae866f22514d2643d34" +version = "0.216.0" +source = "git+https://github.com/cpetig/wasm-tools?branch=symmetric#1e43a18af72c1fa79f2e6d9e3a9a726c0d1b2c27" dependencies = [ "anyhow", "bitflags", @@ -2528,11 +2528,11 @@ dependencies = [ "serde", "serde_derive", "serde_json", - "wasm-encoder 0.215.0 (git+https://github.com/cpetig/wasm-tools?branch=symmetric)", + "wasm-encoder 0.216.0 (git+https://github.com/cpetig/wasm-tools?branch=symmetric)", "wasm-metadata", - "wasmparser 0.215.0 (git+https://github.com/cpetig/wasm-tools?branch=symmetric)", - "wat 1.215.0", - "wit-parser 0.215.0 (git+https://github.com/cpetig/wasm-tools?branch=symmetric)", + "wasmparser 0.216.0", + "wat 1.216.0 (git+https://github.com/cpetig/wasm-tools?branch=symmetric)", + "wit-parser 0.216.0", ] [[package]] @@ -2550,13 +2550,13 @@ dependencies = [ "serde_derive", "serde_json", "unicode-xid", - "wasmparser 0.215.0 (registry+https://github.com/rust-lang/crates.io-index)", + "wasmparser 0.215.0", ] [[package]] name = "wit-parser" -version = "0.215.0" -source = "git+https://github.com/cpetig/wasm-tools?branch=symmetric#6df489f6d283a159aa6ecae866f22514d2643d34" +version = "0.216.0" +source = "git+https://github.com/cpetig/wasm-tools?branch=symmetric#1e43a18af72c1fa79f2e6d9e3a9a726c0d1b2c27" dependencies = [ "anyhow", "id-arena", @@ -2567,7 +2567,7 @@ dependencies = [ "serde_derive", "serde_json", "unicode-xid", - "wasmparser 0.215.0 (git+https://github.com/cpetig/wasm-tools?branch=symmetric)", + "wasmparser 0.216.0", ] [[package]] diff --git a/crates/c/src/lib.rs b/crates/c/src/lib.rs index 4792d1f16..ac16dff6e 100644 --- a/crates/c/src/lib.rs +++ b/crates/c/src/lib.rs @@ -28,7 +28,7 @@ struct C { needs_union_double_int64: bool, prim_names: HashSet, world: String, - sizes: SizeAlign64, + sizes: SizeAlign, renamed_interfaces: HashMap, world_id: Option, @@ -2234,7 +2234,7 @@ impl<'a, 'b> FunctionBindgen<'a, 'b> { impl Bindgen for FunctionBindgen<'_, '_> { type Operand = String; - fn sizes(&self) -> &SizeAlign64 { + fn sizes(&self) -> &SizeAlign { &self.gen.gen.sizes } diff --git a/crates/core/src/abi.rs b/crates/core/src/abi.rs index 6bdf1adeb..411a6bece 100644 --- a/crates/core/src/abi.rs +++ b/crates/core/src/abi.rs @@ -1,7 +1,7 @@ pub use wit_parser::abi::{AbiVariant, WasmSignature, WasmType}; use wit_parser::{ align_to_arch, Alignment, ArchitectureSize, ElementInfo, Enum, Flags, FlagsRepr, Function, - Handle, Int, Record, Resolve, Result_, Results, SizeAlign64, Tuple, Type, TypeDefKind, TypeId, + Handle, Int, Record, Resolve, Result_, Results, SizeAlign, Tuple, Type, TypeDefKind, TypeId, Variant, }; @@ -709,7 +709,7 @@ pub trait Bindgen { fn finish_block(&mut self, operand: &mut Vec); /// Returns size information that was previously calculated for all types. - fn sizes(&self) -> &SizeAlign64; + fn sizes(&self) -> &SizeAlign; /// Returns whether or not the specified element type is represented in a /// "canonical" form for lists. This dictates whether the `ListCanonLower` @@ -1145,10 +1145,7 @@ impl<'a, B: Bindgen> Generator<'a, B> { .sizes() .record(func.params.iter().map(|t| &t.1)); self.emit(&Instruction::GetArg { nth: 0 }); - self.emit(&Instruction::GuestDeallocate { - size: info.size.size_wasm32(), - align: info.align.align_wasm32(), - }); + self.emit(&Instruction::GuestDeallocate { size, align }); } } diff --git a/crates/cpp/src/lib.rs b/crates/cpp/src/lib.rs index c1679694a..cf51ecfbb 100644 --- a/crates/cpp/src/lib.rs +++ b/crates/cpp/src/lib.rs @@ -12,7 +12,7 @@ use wit_bindgen_core::{ make_external_component, make_external_symbol, uwrite, uwriteln, wit_parser::{ Alignment, ArchitectureSize, Docs, Function, FunctionKind, Handle, Int, InterfaceId, - Resolve, Results, SizeAlign64, Stability, Type, TypeDefKind, TypeId, TypeOwner, WorldId, + Resolve, Results, SizeAlign, Stability, Type, TypeDefKind, TypeId, TypeOwner, WorldId, WorldKey, }, Files, InterfaceGenerator, Source, WorldGenerator, @@ -283,9 +283,9 @@ impl Cpp { wasm_import_module: Option, ) -> CppInterfaceGenerator<'a> { let mut sizes = if self.opts.symmetric { - SizeAlign64::new_symmetric() + SizeAlign::new_symmetric() } else { - SizeAlign64::default() + SizeAlign::default() }; sizes.fill(resolve); @@ -862,7 +862,7 @@ struct CppInterfaceGenerator<'a> { resolve: &'a Resolve, interface: Option, _name: Option<&'a WorldKey>, - sizes: SizeAlign64, + sizes: SizeAlign, in_guest_import: bool, // return_pointer_area_size: usize, // return_pointer_area_align: usize, @@ -3708,7 +3708,7 @@ impl<'a, 'b> Bindgen for FunctionBindgen<'a, 'b> { // uwriteln!(self.src, "// finish_block()"); } - fn sizes(&self) -> &wit_bindgen_core::wit_parser::SizeAlign64 { + fn sizes(&self) -> &wit_bindgen_core::wit_parser::SizeAlign { &self.gen.sizes } diff --git a/crates/rust/src/bindgen.rs b/crates/rust/src/bindgen.rs index e81ffda1f..56c7be9ca 100644 --- a/crates/rust/src/bindgen.rs +++ b/crates/rust/src/bindgen.rs @@ -292,7 +292,7 @@ impl Bindgen for FunctionBindgen<'_, '_> { format!("ptr{}", tmp) } - fn sizes(&self) -> &SizeAlign64 { + fn sizes(&self) -> &SizeAlign { &self.gen.sizes } diff --git a/crates/rust/src/interface.rs b/crates/rust/src/interface.rs index 6e9ed6da2..762ae2d18 100644 --- a/crates/rust/src/interface.rs +++ b/crates/rust/src/interface.rs @@ -18,7 +18,7 @@ pub struct InterfaceGenerator<'a> { pub src: Source, pub(super) identifier: Identifier<'a>, pub in_import: bool, - pub sizes: SizeAlign64, + pub sizes: SizeAlign, pub(super) gen: &'a mut RustWasm, pub wasm_import_module: &'a str, pub resolve: &'a Resolve, @@ -1011,7 +1011,9 @@ impl {async_support}::StreamPayload for {name} {{ }} " ); - } else if abi::guest_export_needs_post_return(self.resolve, func) && !self.gen.opts.symmetric { + } else if abi::guest_export_needs_post_return(self.resolve, func) + && !self.gen.opts.symmetric + { uwrite!( self.src, "\ @@ -1105,7 +1107,9 @@ impl {async_support}::StreamPayload for {name} {{ }} " ); - } else if abi::guest_export_needs_post_return(self.resolve, func) && !self.gen.opts.symmetric { + } else if abi::guest_export_needs_post_return(self.resolve, func) + && !self.gen.opts.symmetric + { let export_prefix = self.gen.opts.export_prefix.as_deref().unwrap_or(""); let external_name = make_external_component(export_prefix) + "cabi_post_" diff --git a/crates/rust/src/lib.rs b/crates/rust/src/lib.rs index c11e7e760..d9207aa51 100644 --- a/crates/rust/src/lib.rs +++ b/crates/rust/src/lib.rs @@ -302,9 +302,9 @@ impl RustWasm { in_import: bool, ) -> InterfaceGenerator<'a> { let mut sizes = if self.opts.symmetric { - SizeAlign64::new_symmetric() + SizeAlign::new_symmetric() } else { - SizeAlign64::default() + SizeAlign::default() }; sizes.fill(resolve);