wasm-encoder
Advanced tools
| { | ||
| "git": { | ||
| "sha1": "d4e317f22c3bace76cb3205003bcc34b4929037d" | ||
| "sha1": "42127681cc850a4dc62824efc3786e25aa5f9910" | ||
| }, | ||
| "path_in_vcs": "crates/wasm-encoder" | ||
| } |
+9
-9
@@ -59,11 +59,11 @@ # This file is automatically @generated by Cargo. | ||
| name = "hashbrown" | ||
| version = "0.15.4" | ||
| version = "0.16.1" | ||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| checksum = "5971ac85611da7067dbfcabef3c70ebb5606018acd9e2a3903a0da507521e0d5" | ||
| checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100" | ||
| [[package]] | ||
| name = "indexmap" | ||
| version = "2.10.0" | ||
| version = "2.13.0" | ||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| checksum = "fe4cd85333e22411419a0bcae1297d25e58c9443848b11dc6a86fefe8c78a661" | ||
| checksum = "7714e70437a7dc3ac8eb7e6f8df75fd8eb422675fc7678aff7364301092b1017" | ||
| dependencies = [ | ||
@@ -156,3 +156,3 @@ "equivalent", | ||
| name = "wasm-encoder" | ||
| version = "0.244.0" | ||
| version = "0.245.0" | ||
| dependencies = [ | ||
@@ -168,5 +168,5 @@ "anyhow", | ||
| name = "wasmparser" | ||
| version = "0.244.0" | ||
| version = "0.245.0" | ||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| checksum = "47b807c72e1bac69382b3a6fb3dbe8ea4c0ed87ff5629b8685ae6b9a611028fe" | ||
| checksum = "48a767a48974f0c8b66f211b96e01aa77feed58b8ccce4e7f0cff0ae55b174d4" | ||
| dependencies = [ | ||
@@ -180,5 +180,5 @@ "bitflags", | ||
| name = "wasmprinter" | ||
| version = "0.244.0" | ||
| version = "0.245.0" | ||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||
| checksum = "09390d7b2bd7b938e563e4bff10aa345ef2e27a3bc99135697514ef54495e68f" | ||
| checksum = "6b79e39af628dc03572ecd42fab1265480d943db5858dab748142a5ce0644bb5" | ||
| dependencies = [ | ||
@@ -185,0 +185,0 @@ "anyhow", |
+9
-5
@@ -14,5 +14,5 @@ # THIS FILE IS AUTOMATICALLY GENERATED BY CARGO | ||
| edition = "2021" | ||
| rust-version = "1.81.0" | ||
| rust-version = "1.82.0" | ||
| name = "wasm-encoder" | ||
| version = "0.244.0" | ||
| version = "0.245.0" | ||
| authors = ["Nick Fitzgerald <fitzgen@gmail.com>"] | ||
@@ -54,3 +54,3 @@ build = false | ||
| [dependencies.wasmparser] | ||
| version = "0.244.0" | ||
| version = "0.245.0" | ||
| features = [ | ||
@@ -65,2 +65,3 @@ "simd", | ||
| version = "1.0.58" | ||
| default-features = false | ||
@@ -71,3 +72,3 @@ [dev-dependencies.tempfile] | ||
| [dev-dependencies.wasmprinter] | ||
| version = "0.244.0" | ||
| version = "0.245.0" | ||
| default-features = false | ||
@@ -108,2 +109,5 @@ | ||
| priority = 0 | ||
| check-cfg = ["cfg(fuzzing)"] | ||
| check-cfg = [ | ||
| "cfg(fuzzing)", | ||
| "cfg(debug_check_try_op)", | ||
| ] |
+20
-12
@@ -711,8 +711,15 @@ use crate::component::*; | ||
| /// Declares a new `thread.switch-to` intrinsic. | ||
| pub fn thread_switch_to(&mut self, cancellable: bool) -> u32 { | ||
| self.canonical_functions().thread_switch_to(cancellable); | ||
| self.core_funcs.add(Some("thread.switch-to")) | ||
| /// Declares a new `thread.suspend-to-suspended` intrinsic. | ||
| pub fn thread_suspend_to_suspended(&mut self, cancellable: bool) -> u32 { | ||
| self.canonical_functions() | ||
| .thread_suspend_to_suspended(cancellable); | ||
| self.core_funcs.add(Some("thread.suspend-to-suspended")) | ||
| } | ||
| /// Declares a new `thread.suspend-to` intrinsic. | ||
| pub fn thread_suspend_to(&mut self, cancellable: bool) -> u32 { | ||
| self.canonical_functions().thread_suspend_to(cancellable); | ||
| self.core_funcs.add(Some("thread.suspend-to")) | ||
| } | ||
| /// Declares a new `thread.suspend` intrinsic. | ||
@@ -724,12 +731,13 @@ pub fn thread_suspend(&mut self, cancellable: bool) -> u32 { | ||
| /// Declares a new `thread.resume-later` intrinsic. | ||
| pub fn thread_resume_later(&mut self) -> u32 { | ||
| self.canonical_functions().thread_resume_later(); | ||
| self.core_funcs.add(Some("thread.resume-later")) | ||
| /// Declares a new `thread.unsuspend` intrinsic. | ||
| pub fn thread_unsuspend(&mut self) -> u32 { | ||
| self.canonical_functions().thread_unsuspend(); | ||
| self.core_funcs.add(Some("thread.unsuspend")) | ||
| } | ||
| /// Declares a new `thread.yield-to` intrinsic. | ||
| pub fn thread_yield_to(&mut self, cancellable: bool) -> u32 { | ||
| self.canonical_functions().thread_yield_to(cancellable); | ||
| self.core_funcs.add(Some("thread.yield-to")) | ||
| /// Declares a new `thread.yield-to-suspended` intrinsic. | ||
| pub fn thread_yield_to_suspended(&mut self, cancellable: bool) -> u32 { | ||
| self.canonical_functions() | ||
| .thread_yield_to_suspended(cancellable); | ||
| self.core_funcs.add(Some("thread.yield-to-suspended")) | ||
| } | ||
@@ -736,0 +744,0 @@ |
@@ -525,5 +525,5 @@ use crate::{ComponentSection, ComponentSectionId, ComponentValType, Encode, encode_section}; | ||
| /// Declare a new `thread.switch-to` intrinsic, used to switch execution to | ||
| /// another thread. | ||
| pub fn thread_switch_to(&mut self, cancellable: bool) -> &mut Self { | ||
| /// Declare a new `thread.suspend-to-suspended` intrinsic, used to switch execution to | ||
| /// another suspended thread. | ||
| pub fn thread_suspend_to_suspended(&mut self, cancellable: bool) -> &mut Self { | ||
| self.bytes.push(0x28); | ||
@@ -544,5 +544,14 @@ self.bytes.push(if cancellable { 1 } else { 0 }); | ||
| /// Declare a new `thread.resume-later` intrinsic, used to resume execution | ||
| /// Declare a new `thread.suspend-to` intrinsic, used to suspend the current | ||
| /// thread and switch to another thread that might not be suspended. | ||
| pub fn thread_suspend_to(&mut self, cancellable: bool) -> &mut Self { | ||
| self.bytes.push(0x2c); | ||
| self.bytes.push(if cancellable { 1 } else { 0 }); | ||
| self.num_added += 1; | ||
| self | ||
| } | ||
| /// Declare a new `thread.unsuspend` intrinsic, used to resume execution | ||
| /// of the given thread. | ||
| pub fn thread_resume_later(&mut self) -> &mut Self { | ||
| pub fn thread_unsuspend(&mut self) -> &mut Self { | ||
| self.bytes.push(0x2a); | ||
@@ -553,5 +562,5 @@ self.num_added += 1; | ||
| /// Declare a new `thread.yield-to` intrinsic, used to yield execution to | ||
| /// a given thread. | ||
| pub fn thread_yield_to(&mut self, cancellable: bool) -> &mut Self { | ||
| /// Declare a new `thread.yield-to-suspended` intrinsic, used to yield execution to | ||
| /// a given suspended thread. | ||
| pub fn thread_yield_to_suspended(&mut self, cancellable: bool) -> &mut Self { | ||
| self.bytes.push(0x2b); | ||
@@ -558,0 +567,0 @@ self.bytes.push(if cancellable { 1 } else { 0 }); |
@@ -604,3 +604,3 @@ use super::CORE_TYPE_SORT; | ||
| where | ||
| C: IntoIterator<Item = (&'a str, Option<ComponentValType>, Option<u32>)>, | ||
| C: IntoIterator<Item = (&'a str, Option<ComponentValType>)>, | ||
| C::IntoIter: ExactSizeIterator, | ||
@@ -611,6 +611,6 @@ { | ||
| cases.len().encode(self.0); | ||
| for (name, ty, refines) in cases { | ||
| for (name, ty) in cases { | ||
| name.encode(self.0); | ||
| ty.encode(self.0); | ||
| refines.encode(self.0); | ||
| self.0.push(0x00); | ||
| } | ||
@@ -632,4 +632,4 @@ } | ||
| /// Define a fixed size list type. | ||
| pub fn fixed_size_list(self, ty: impl Into<ComponentValType>, elements: u32) { | ||
| /// Define a fixed-length list type. | ||
| pub fn fixed_length_list(self, ty: impl Into<ComponentValType>, elements: u32) { | ||
| self.0.push(0x67); | ||
@@ -636,0 +636,0 @@ ty.into().encode(self.0); |
@@ -761,9 +761,6 @@ use crate::reencode::{Error, Reencode, RoundtripReencoder}; | ||
| wasmparser::ComponentDefinedType::Variant(v) => { | ||
| defined.variant(v.iter().map(|case| { | ||
| ( | ||
| case.name, | ||
| case.ty.map(|t| reencoder.component_val_type(t)), | ||
| case.refines, | ||
| ) | ||
| })); | ||
| defined.variant( | ||
| v.iter() | ||
| .map(|case| (case.name, case.ty.map(|t| reencoder.component_val_type(t)))), | ||
| ); | ||
| } | ||
@@ -779,4 +776,4 @@ wasmparser::ComponentDefinedType::List(t) => { | ||
| } | ||
| wasmparser::ComponentDefinedType::FixedSizeList(t, elements) => { | ||
| defined.fixed_size_list(reencoder.component_val_type(t), elements); | ||
| wasmparser::ComponentDefinedType::FixedLengthList(t, elements) => { | ||
| defined.fixed_length_list(reencoder.component_val_type(t), elements); | ||
| } | ||
@@ -1126,4 +1123,4 @@ wasmparser::ComponentDefinedType::Tuple(t) => { | ||
| } | ||
| wasmparser::CanonicalFunction::ThreadSwitchTo { cancellable } => { | ||
| section.thread_switch_to(cancellable); | ||
| wasmparser::CanonicalFunction::ThreadSuspendToSuspended { cancellable } => { | ||
| section.thread_suspend_to_suspended(cancellable); | ||
| } | ||
@@ -1133,8 +1130,11 @@ wasmparser::CanonicalFunction::ThreadSuspend { cancellable } => { | ||
| } | ||
| wasmparser::CanonicalFunction::ThreadResumeLater => { | ||
| section.thread_resume_later(); | ||
| wasmparser::CanonicalFunction::ThreadSuspendTo { cancellable } => { | ||
| section.thread_suspend_to(cancellable); | ||
| } | ||
| wasmparser::CanonicalFunction::ThreadYieldTo { cancellable } => { | ||
| section.thread_yield_to(cancellable); | ||
| wasmparser::CanonicalFunction::ThreadUnsuspend => { | ||
| section.thread_unsuspend(); | ||
| } | ||
| wasmparser::CanonicalFunction::ThreadYieldToSuspended { cancellable } => { | ||
| section.thread_yield_to_suspended(cancellable); | ||
| } | ||
| } | ||
@@ -1141,0 +1141,0 @@ Ok(()) |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display