Skip to content

Commit 20b2a14

Browse files
committed
Update wasm-tools to the latest revision
1 parent 812dd1e commit 20b2a14

14 files changed

Lines changed: 338 additions & 226 deletions

File tree

Cargo.lock

Lines changed: 84 additions & 64 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -303,16 +303,16 @@ wit-bindgen = { version = "0.39.0", default-features = false }
303303
wit-bindgen-rust-macro = { version = "0.39.0", default-features = false }
304304

305305
# wasm-tools family:
306-
wasmparser = { version = "0.226.0", default-features = false, features = ['simd'] }
307-
wat = "1.226.0"
308-
wast = "226.0.0"
309-
wasmprinter = "0.226.0"
310-
wasm-encoder = "0.226.0"
311-
wasm-smith = "0.226.0"
312-
wasm-mutate = "0.226.0"
313-
wit-parser = "0.226.0"
314-
wit-component = "0.226.0"
315-
wasm-wave = "0.226.0"
306+
wasmparser = { version = "0.227.0", default-features = false, features = ['simd'] }
307+
wat = "1.227.0"
308+
wast = "227.0.0"
309+
wasmprinter = "0.227.0"
310+
wasm-encoder = "0.227.0"
311+
wasm-smith = "0.227.0"
312+
wasm-mutate = "0.227.0"
313+
wit-parser = "0.227.0"
314+
wit-component = "0.227.0"
315+
wasm-wave = "0.227.0"
316316

317317
# Non-Bytecode Alliance maintained dependencies:
318318
# --------------------------

crates/cranelift/src/compiler/component.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ impl<'a> TrampolineCompiler<'a> {
114114
} => {
115115
self.translate_task_wait_or_poll_call(*instance, *async_, *memory, host::task_wait)
116116
}
117-
Trampoline::TaskPoll {
117+
Trampoline::WaitableSetPoll {
118118
instance,
119119
async_,
120120
memory,

crates/environ/src/component/dfg.rs

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ pub enum Trampoline {
283283
ResourceNew(TypeResourceTableIndex),
284284
ResourceRep(TypeResourceTableIndex),
285285
ResourceDrop(TypeResourceTableIndex),
286-
TaskBackpressure {
286+
BackpressureSet {
287287
instance: RuntimeComponentInstanceIndex,
288288
},
289289
TaskReturn {
@@ -294,12 +294,18 @@ pub enum Trampoline {
294294
async_: bool,
295295
memory: MemoryId,
296296
},
297-
TaskPoll {
297+
WaitableSetPoll {
298298
instance: RuntimeComponentInstanceIndex,
299299
async_: bool,
300300
memory: MemoryId,
301301
},
302-
TaskYield {
302+
WaitableSetDrop {
303+
instance: RuntimeComponentInstanceIndex,
304+
},
305+
WaitableJoin {
306+
instance: RuntimeComponentInstanceIndex,
307+
},
308+
Yield {
303309
async_: bool,
304310
},
305311
SubtaskDrop {
@@ -772,7 +778,7 @@ impl LinearizeDfg<'_> {
772778
Trampoline::ResourceNew(ty) => info::Trampoline::ResourceNew(*ty),
773779
Trampoline::ResourceDrop(ty) => info::Trampoline::ResourceDrop(*ty),
774780
Trampoline::ResourceRep(ty) => info::Trampoline::ResourceRep(*ty),
775-
Trampoline::TaskBackpressure { instance } => info::Trampoline::TaskBackpressure {
781+
Trampoline::BackpressureSet { instance } => info::Trampoline::BackpressureSet {
776782
instance: *instance,
777783
},
778784
Trampoline::TaskReturn { results } => {
@@ -782,21 +788,27 @@ impl LinearizeDfg<'_> {
782788
instance,
783789
async_,
784790
memory,
785-
} => info::Trampoline::TaskWait {
791+
} => info::Trampoline::WaitableSetWait {
786792
instance: *instance,
787793
async_: *async_,
788794
memory: self.runtime_memory(*memory),
789795
},
790-
Trampoline::TaskPoll {
796+
Trampoline::WaitableSetPoll {
791797
instance,
792798
async_,
793799
memory,
794-
} => info::Trampoline::TaskPoll {
800+
} => info::Trampoline::WaitableSetPoll {
795801
instance: *instance,
796802
async_: *async_,
797803
memory: self.runtime_memory(*memory),
798804
},
799-
Trampoline::TaskYield { async_ } => info::Trampoline::TaskYield { async_: *async_ },
805+
Trampoline::WaitableSetDrop { instance } => info::Trampoline::WaitableSetDrop {
806+
instance: *instance,
807+
},
808+
Trampoline::WaitableJoin { instance } => info::Trampoline::WaitableJoin {
809+
instance: *instance,
810+
},
811+
Trampoline::Yield { async_ } => info::Trampoline::Yield { async_: *async_ },
800812
Trampoline::SubtaskDrop { instance } => info::Trampoline::SubtaskDrop {
801813
instance: *instance,
802814
},

crates/environ/src/component/info.rs

Lines changed: 30 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -679,9 +679,9 @@ pub enum Trampoline {
679679
/// Same as `ResourceNew`, but for the `resource.drop` intrinsic.
680680
ResourceDrop(TypeResourceTableIndex),
681681

682-
/// A `task.backpressure` intrinsic, which tells the host to enable or
682+
/// A `backpressure.set` intrinsic, which tells the host to enable or
683683
/// disable backpressure for the caller's instance.
684-
TaskBackpressure {
684+
BackpressureSet {
685685
/// The specific component instance which is calling the intrinsic.
686686
instance: RuntimeComponentInstanceIndex,
687687
},
@@ -694,9 +694,16 @@ pub enum Trampoline {
694694
results: TypeTupleIndex,
695695
},
696696

697-
/// A `task.wait` intrinsic, which waits for at least one outstanding async
698-
/// task/stream/future to make progress, returning the first such event.
699-
TaskWait {
697+
/// A `waitable-set.new` intrinsic.
698+
WaitableSetNew {
699+
/// The specific component instance which is calling the intrinsic.
700+
instance: RuntimeComponentInstanceIndex,
701+
},
702+
703+
/// A `waitable-set.wait` intrinsic, which waits for at least one
704+
/// outstanding async task/stream/future to make progress, returning the
705+
/// first such event.
706+
WaitableSetWait {
700707
/// The specific component instance which is calling the intrinsic.
701708
instance: RuntimeComponentInstanceIndex,
702709
/// If `true`, indicates the caller instance maybe reentered.
@@ -705,10 +712,10 @@ pub enum Trampoline {
705712
memory: RuntimeMemoryIndex,
706713
},
707714

708-
/// A `task.poll` intrinsic, which checks whether any outstanding async
709-
/// task/stream/future has made progress. Unlike `task.wait`, this does not
710-
/// block and may return nothing if no such event has occurred.
711-
TaskPoll {
715+
/// A `waitable-set.poll` intrinsic, which checks whether any outstanding
716+
/// async task/stream/future has made progress. Unlike `task.wait`, this
717+
/// does not block and may return nothing if no such event has occurred.
718+
WaitableSetPoll {
712719
/// The specific component instance which is calling the intrinsic.
713720
instance: RuntimeComponentInstanceIndex,
714721
/// If `true`, indicates the caller instance maybe reentered.
@@ -717,9 +724,21 @@ pub enum Trampoline {
717724
memory: RuntimeMemoryIndex,
718725
},
719726

720-
/// A `task.yield` intrinsic, which yields control to the host so that other
727+
/// A `waitable-set.drop` intrinsic.
728+
WaitableSetDrop {
729+
/// The specific component instance which is calling the intrinsic.
730+
instance: RuntimeComponentInstanceIndex,
731+
},
732+
733+
/// A `waitable.join` intrinsic.
734+
WaitableJoin {
735+
/// The specific component instance which is calling the intrinsic.
736+
instance: RuntimeComponentInstanceIndex,
737+
},
738+
739+
/// A `yield` intrinsic, which yields control to the host so that other
721740
/// tasks are able to make progress, if any.
722-
TaskYield {
741+
Yield {
723742
/// If `true`, indicates the caller instance maybe reentered.
724743
async_: bool,
725744
},

crates/environ/src/component/translate.rs

Lines changed: 40 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -188,24 +188,33 @@ enum LocalInitializer<'data> {
188188
ResourceRep(AliasableResourceId, ModuleInternedTypeIndex),
189189
ResourceDrop(AliasableResourceId, ModuleInternedTypeIndex),
190190

191-
TaskBackpressure {
191+
BackpressureSet {
192192
func: ModuleInternedTypeIndex,
193193
},
194194
TaskReturn {
195195
func: ModuleInternedTypeIndex,
196196
result: Option<ComponentValType>,
197197
},
198-
TaskWait {
198+
WaitableSetNew {
199+
func: ModuleInternedTypeIndex,
200+
},
201+
WaitableSetWait {
199202
func: ModuleInternedTypeIndex,
200203
async_: bool,
201204
memory: MemoryIndex,
202205
},
203-
TaskPoll {
206+
WaitableSetPoll {
204207
func: ModuleInternedTypeIndex,
205208
async_: bool,
206209
memory: MemoryIndex,
207210
},
208-
TaskYield {
211+
WaitableSetDrop {
212+
func: ModuleInternedTypeIndex,
213+
},
214+
WaitableJoin {
215+
func: ModuleInternedTypeIndex,
216+
},
217+
Yield {
209218
func: ModuleInternedTypeIndex,
210219
async_: bool,
211220
},
@@ -618,6 +627,10 @@ impl<'a, 'data> Translator<'a, 'data> {
618627
core_func_index += 1;
619628
LocalInitializer::ResourceDrop(resource, ty)
620629
}
630+
wasmparser::CanonicalFunction::ResourceDropAsync { resource } => {
631+
let _ = resource;
632+
bail!("support for `resource.drop async` not implemented yet")
633+
}
621634
wasmparser::CanonicalFunction::ResourceRep { resource } => {
622635
let resource = types.component_any_type_at(resource).unwrap_resource();
623636
let ty = self.core_func_signature(core_func_index)?;
@@ -628,10 +641,10 @@ impl<'a, 'data> Translator<'a, 'data> {
628641
| wasmparser::CanonicalFunction::ThreadAvailableParallelism => {
629642
bail!("unsupported intrinsic")
630643
}
631-
wasmparser::CanonicalFunction::TaskBackpressure => {
644+
wasmparser::CanonicalFunction::BackpressureSet => {
632645
let core_type = self.core_func_signature(core_func_index)?;
633646
core_func_index += 1;
634-
LocalInitializer::TaskBackpressure { func: core_type }
647+
LocalInitializer::BackpressureSet { func: core_type }
635648
}
636649
wasmparser::CanonicalFunction::TaskReturn { result } => {
637650
let result = result.map(|ty| match ty {
@@ -646,28 +659,43 @@ impl<'a, 'data> Translator<'a, 'data> {
646659
core_func_index += 1;
647660
LocalInitializer::TaskReturn { func, result }
648661
}
649-
wasmparser::CanonicalFunction::TaskWait { async_, memory } => {
662+
wasmparser::CanonicalFunction::WaitableSetNew => {
663+
let func = self.core_func_signature(core_func_index)?;
664+
core_func_index += 1;
665+
LocalInitializer::WaitableSetNew { func }
666+
}
667+
wasmparser::CanonicalFunction::WaitableSetWait { async_, memory } => {
650668
let func = self.core_func_signature(core_func_index)?;
651669
core_func_index += 1;
652-
LocalInitializer::TaskWait {
670+
LocalInitializer::WaitableSetWait {
653671
func,
654672
async_,
655673
memory: MemoryIndex::from_u32(memory),
656674
}
657675
}
658-
wasmparser::CanonicalFunction::TaskPoll { async_, memory } => {
676+
wasmparser::CanonicalFunction::WaitableSetPoll { async_, memory } => {
659677
let func = self.core_func_signature(core_func_index)?;
660678
core_func_index += 1;
661-
LocalInitializer::TaskPoll {
679+
LocalInitializer::WaitableSetPoll {
662680
func,
663681
async_,
664682
memory: MemoryIndex::from_u32(memory),
665683
}
666684
}
667-
wasmparser::CanonicalFunction::TaskYield { async_ } => {
685+
wasmparser::CanonicalFunction::WaitableSetDrop => {
686+
let func = self.core_func_signature(core_func_index)?;
687+
core_func_index += 1;
688+
LocalInitializer::WaitableSetDrop { func }
689+
}
690+
wasmparser::CanonicalFunction::WaitableJoin => {
691+
let func = self.core_func_signature(core_func_index)?;
692+
core_func_index += 1;
693+
LocalInitializer::WaitableJoin { func }
694+
}
695+
wasmparser::CanonicalFunction::Yield { async_ } => {
668696
let func = self.core_func_signature(core_func_index)?;
669697
core_func_index += 1;
670-
LocalInitializer::TaskYield { func, async_ }
698+
LocalInitializer::Yield { func, async_ }
671699
}
672700
wasmparser::CanonicalFunction::SubtaskDrop => {
673701
let func = self.core_func_signature(core_func_index)?;

crates/environ/src/component/translate/inline.rs

Lines changed: 35 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -670,10 +670,10 @@ impl<'a> Inliner<'a> {
670670
.push((*ty, dfg::Trampoline::ResourceDrop(id)));
671671
frame.funcs.push(dfg::CoreDef::Trampoline(index));
672672
}
673-
TaskBackpressure { func } => {
673+
BackpressureSet { func } => {
674674
let index = self.result.trampolines.push((
675675
*func,
676-
dfg::Trampoline::TaskBackpressure {
676+
dfg::Trampoline::BackpressureSet {
677677
instance: frame.instance,
678678
},
679679
));
@@ -691,7 +691,16 @@ impl<'a> Inliner<'a> {
691691
.push((*func, dfg::Trampoline::TaskReturn { results }));
692692
frame.funcs.push(dfg::CoreDef::Trampoline(index));
693693
}
694-
TaskWait {
694+
WaitableSetNew { func } => {
695+
let index = self.result.trampolines.push((
696+
*func,
697+
dfg::Trampoline::WaitableSetNew {
698+
instance: frame.instance,
699+
},
700+
));
701+
frame.funcs.push(dfg::CoreDef::Trampoline(index));
702+
}
703+
WaitableSetWait {
695704
func,
696705
async_,
697706
memory,
@@ -700,15 +709,15 @@ impl<'a> Inliner<'a> {
700709
let memory = self.result.memories.push(memory);
701710
let index = self.result.trampolines.push((
702711
*func,
703-
dfg::Trampoline::TaskWait {
712+
dfg::Trampoline::WaitableSetWait {
704713
instance: frame.instance,
705714
async_: *async_,
706715
memory,
707716
},
708717
));
709718
frame.funcs.push(dfg::CoreDef::Trampoline(index));
710719
}
711-
TaskPoll {
720+
WaitableSetPoll {
712721
func,
713722
async_,
714723
memory,
@@ -717,19 +726,37 @@ impl<'a> Inliner<'a> {
717726
let memory = self.result.memories.push(memory);
718727
let index = self.result.trampolines.push((
719728
*func,
720-
dfg::Trampoline::TaskPoll {
729+
dfg::Trampoline::WaitableSetPoll {
721730
instance: frame.instance,
722731
async_: *async_,
723732
memory,
724733
},
725734
));
726735
frame.funcs.push(dfg::CoreDef::Trampoline(index));
727736
}
728-
TaskYield { func, async_ } => {
737+
WaitableSetDrop { func } => {
738+
let index = self.result.trampolines.push((
739+
*func,
740+
dfg::Trampoline::WaitableSetDrop {
741+
instance: frame.instance,
742+
},
743+
));
744+
frame.funcs.push(dfg::CoreDef::Trampoline(index));
745+
}
746+
WaitableJoin { func } => {
747+
let index = self.result.trampolines.push((
748+
*func,
749+
dfg::Trampoline::WaitableJoin {
750+
instance: frame.instance,
751+
},
752+
));
753+
frame.funcs.push(dfg::CoreDef::Trampoline(index));
754+
}
755+
Yield { func, async_ } => {
729756
let index = self
730757
.result
731758
.trampolines
732-
.push((*func, dfg::Trampoline::TaskYield { async_: *async_ }));
759+
.push((*func, dfg::Trampoline::Yield { async_: *async_ }));
733760
frame.funcs.push(dfg::CoreDef::Trampoline(index));
734761
}
735762
SubtaskDrop { func } => {

0 commit comments

Comments
 (0)