Skip to content

Commit e747e49

Browse files
committed
Update wasm-tools to the latest revision
prtest:full
1 parent 6d028ab commit e747e49

File tree

12 files changed

+321
-221
lines changed

12 files changed

+321
-221
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 22 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
# --------------------------
@@ -566,3 +566,15 @@ opt-level = 's'
566566
inherits = "release"
567567
codegen-units = 1
568568
lto = true
569+
570+
[patch.crates-io]
571+
wasmparser = { git = 'https://github.com/bytecodealliance/wasm-tools', branch = 'ci/release-1.227.0' }
572+
wat = { git = 'https://github.com/bytecodealliance/wasm-tools', branch = 'ci/release-1.227.0' }
573+
wast = { git = 'https://github.com/bytecodealliance/wasm-tools', branch = 'ci/release-1.227.0' }
574+
wasmprinter = { git = 'https://github.com/bytecodealliance/wasm-tools', branch = 'ci/release-1.227.0' }
575+
wasm-encoder = { git = 'https://github.com/bytecodealliance/wasm-tools', branch = 'ci/release-1.227.0' }
576+
wasm-smith = { git = 'https://github.com/bytecodealliance/wasm-tools', branch = 'ci/release-1.227.0' }
577+
wasm-mutate = { git = 'https://github.com/bytecodealliance/wasm-tools', branch = 'ci/release-1.227.0' }
578+
wit-parser = { git = 'https://github.com/bytecodealliance/wasm-tools', branch = 'ci/release-1.227.0' }
579+
wit-component = { git = 'https://github.com/bytecodealliance/wasm-tools', branch = 'ci/release-1.227.0' }
580+
wasm-wave = { git = 'https://github.com/bytecodealliance/wasm-tools', branch = 'ci/release-1.227.0' }

crates/cranelift/src/compiler/component.rs

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,28 +94,40 @@ impl<'a> TrampolineCompiler<'a> {
9494
Trampoline::AlwaysTrap => {
9595
self.translate_always_trap();
9696
}
97-
Trampoline::TaskBackpressure { instance } => {
97+
Trampoline::BackpressureSet { instance } => {
9898
_ = instance;
9999
todo!()
100100
}
101101
Trampoline::TaskReturn => todo!(),
102-
Trampoline::TaskWait {
102+
Trampoline::WaitableSetNew { instance } => {
103+
_ = instance;
104+
todo!()
105+
}
106+
Trampoline::WaitableSetWait {
103107
instance,
104108
async_,
105109
memory,
106110
} => {
107111
_ = (instance, async_, memory);
108112
todo!()
109113
}
110-
Trampoline::TaskPoll {
114+
Trampoline::WaitableSetPoll {
111115
instance,
112116
async_,
113117
memory,
114118
} => {
115119
_ = (instance, async_, memory);
116120
todo!()
117121
}
118-
Trampoline::TaskYield { async_ } => {
122+
Trampoline::WaitableSetDrop { instance } => {
123+
_ = instance;
124+
todo!()
125+
}
126+
Trampoline::WaitableJoin { instance } => {
127+
_ = instance;
128+
todo!()
129+
}
130+
Trampoline::Yield { async_ } => {
119131
_ = async_;
120132
todo!()
121133
}

crates/environ/src/component/dfg.rs

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -283,21 +283,30 @@ pub enum Trampoline {
283283
ResourceNew(TypeResourceTableIndex),
284284
ResourceRep(TypeResourceTableIndex),
285285
ResourceDrop(TypeResourceTableIndex),
286-
TaskBackpressure {
286+
BackpressureSet {
287287
instance: RuntimeComponentInstanceIndex,
288288
},
289289
TaskReturn,
290-
TaskWait {
290+
WaitableSetNew {
291+
instance: RuntimeComponentInstanceIndex,
292+
},
293+
WaitableSetWait {
291294
instance: RuntimeComponentInstanceIndex,
292295
async_: bool,
293296
memory: MemoryId,
294297
},
295-
TaskPoll {
298+
WaitableSetPoll {
296299
instance: RuntimeComponentInstanceIndex,
297300
async_: bool,
298301
memory: MemoryId,
299302
},
300-
TaskYield {
303+
WaitableSetDrop {
304+
instance: RuntimeComponentInstanceIndex,
305+
},
306+
WaitableJoin {
307+
instance: RuntimeComponentInstanceIndex,
308+
},
309+
Yield {
301310
async_: bool,
302311
},
303312
SubtaskDrop {
@@ -762,29 +771,38 @@ impl LinearizeDfg<'_> {
762771
Trampoline::ResourceNew(ty) => info::Trampoline::ResourceNew(*ty),
763772
Trampoline::ResourceDrop(ty) => info::Trampoline::ResourceDrop(*ty),
764773
Trampoline::ResourceRep(ty) => info::Trampoline::ResourceRep(*ty),
765-
Trampoline::TaskBackpressure { instance } => info::Trampoline::TaskBackpressure {
774+
Trampoline::BackpressureSet { instance } => info::Trampoline::BackpressureSet {
766775
instance: *instance,
767776
},
768777
Trampoline::TaskReturn => info::Trampoline::TaskReturn,
769-
Trampoline::TaskWait {
778+
Trampoline::WaitableSetNew { instance } => info::Trampoline::WaitableSetNew {
779+
instance: *instance,
780+
},
781+
Trampoline::WaitableSetWait {
770782
instance,
771783
async_,
772784
memory,
773-
} => info::Trampoline::TaskWait {
785+
} => info::Trampoline::WaitableSetWait {
774786
instance: *instance,
775787
async_: *async_,
776788
memory: self.runtime_memory(*memory),
777789
},
778-
Trampoline::TaskPoll {
790+
Trampoline::WaitableSetPoll {
779791
instance,
780792
async_,
781793
memory,
782-
} => info::Trampoline::TaskPoll {
794+
} => info::Trampoline::WaitableSetPoll {
783795
instance: *instance,
784796
async_: *async_,
785797
memory: self.runtime_memory(*memory),
786798
},
787-
Trampoline::TaskYield { async_ } => info::Trampoline::TaskYield { async_: *async_ },
799+
Trampoline::WaitableSetDrop { instance } => info::Trampoline::WaitableSetDrop {
800+
instance: *instance,
801+
},
802+
Trampoline::WaitableJoin { instance } => info::Trampoline::WaitableJoin {
803+
instance: *instance,
804+
},
805+
Trampoline::Yield { async_ } => info::Trampoline::Yield { async_: *async_ },
788806
Trampoline::SubtaskDrop { instance } => info::Trampoline::SubtaskDrop {
789807
instance: *instance,
790808
},

crates/environ/src/component/info.rs

Lines changed: 37 additions & 15 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
},
@@ -691,9 +691,16 @@ pub enum Trampoline {
691691
/// after returning a result.
692692
TaskReturn,
693693

694-
/// A `task.wait` intrinsic, which waits for at least one outstanding async
695-
/// task/stream/future to make progress, returning the first such event.
696-
TaskWait {
694+
/// A `waitable-set.new` intrinsic.
695+
WaitableSetNew {
696+
/// The specific component instance which is calling the intrinsic.
697+
instance: RuntimeComponentInstanceIndex,
698+
},
699+
700+
/// A `waitable-set.wait` intrinsic, which waits for at least one
701+
/// outstanding async task/stream/future to make progress, returning the
702+
/// first such event.
703+
WaitableSetWait {
697704
/// The specific component instance which is calling the intrinsic.
698705
instance: RuntimeComponentInstanceIndex,
699706
/// If `true`, indicates the caller instance maybe reentered.
@@ -702,10 +709,10 @@ pub enum Trampoline {
702709
memory: RuntimeMemoryIndex,
703710
},
704711

705-
/// A `task.poll` intrinsic, which checks whether any outstanding async
706-
/// task/stream/future has made progress. Unlike `task.wait`, this does not
707-
/// block and may return nothing if no such event has occurred.
708-
TaskPoll {
712+
/// A `waitable-set.poll` intrinsic, which checks whether any outstanding
713+
/// async task/stream/future has made progress. Unlike `task.wait`, this
714+
/// does not block and may return nothing if no such event has occurred.
715+
WaitableSetPoll {
709716
/// The specific component instance which is calling the intrinsic.
710717
instance: RuntimeComponentInstanceIndex,
711718
/// If `true`, indicates the caller instance maybe reentered.
@@ -714,9 +721,21 @@ pub enum Trampoline {
714721
memory: RuntimeMemoryIndex,
715722
},
716723

717-
/// A `task.yield` intrinsic, which yields control to the host so that other
724+
/// A `waitable-set.drop` intrinsic.
725+
WaitableSetDrop {
726+
/// The specific component instance which is calling the intrinsic.
727+
instance: RuntimeComponentInstanceIndex,
728+
},
729+
730+
/// A `waitable.join` intrinsic.
731+
WaitableJoin {
732+
/// The specific component instance which is calling the intrinsic.
733+
instance: RuntimeComponentInstanceIndex,
734+
},
735+
736+
/// A `yield` intrinsic, which yields control to the host so that other
718737
/// tasks are able to make progress, if any.
719-
TaskYield {
738+
Yield {
720739
/// If `true`, indicates the caller instance maybe reentered.
721740
async_: bool,
722741
},
@@ -955,11 +974,14 @@ impl Trampoline {
955974
ResourceNew(i) => format!("component-resource-new[{}]", i.as_u32()),
956975
ResourceRep(i) => format!("component-resource-rep[{}]", i.as_u32()),
957976
ResourceDrop(i) => format!("component-resource-drop[{}]", i.as_u32()),
958-
TaskBackpressure { .. } => format!("task-backpressure"),
977+
BackpressureSet { .. } => format!("backpressure-set"),
959978
TaskReturn => format!("task-return"),
960-
TaskWait { .. } => format!("task-wait"),
961-
TaskPoll { .. } => format!("task-poll"),
962-
TaskYield { .. } => format!("task-yield"),
979+
WaitableSetNew { .. } => format!("waitable-set-new"),
980+
WaitableSetWait { .. } => format!("waitable-set-wait"),
981+
WaitableSetPoll { .. } => format!("waitable-set-poll"),
982+
WaitableSetDrop { .. } => format!("waitable-set-drop"),
983+
WaitableJoin { .. } => format!("waitable-join"),
984+
Yield { .. } => format!("yield"),
963985
SubtaskDrop { .. } => format!("subtask-drop"),
964986
StreamNew { .. } => format!("stream-new"),
965987
StreamRead { .. } => format!("stream-read"),

crates/environ/src/component/translate.rs

Lines changed: 40 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -188,23 +188,32 @@ 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
},
197-
TaskWait {
197+
WaitableSetNew {
198+
func: ModuleInternedTypeIndex,
199+
},
200+
WaitableSetWait {
198201
func: ModuleInternedTypeIndex,
199202
async_: bool,
200203
memory: MemoryIndex,
201204
},
202-
TaskPoll {
205+
WaitableSetPoll {
203206
func: ModuleInternedTypeIndex,
204207
async_: bool,
205208
memory: MemoryIndex,
206209
},
207-
TaskYield {
210+
WaitableSetDrop {
211+
func: ModuleInternedTypeIndex,
212+
},
213+
WaitableJoin {
214+
func: ModuleInternedTypeIndex,
215+
},
216+
Yield {
208217
func: ModuleInternedTypeIndex,
209218
async_: bool,
210219
},
@@ -617,6 +626,10 @@ impl<'a, 'data> Translator<'a, 'data> {
617626
core_func_index += 1;
618627
LocalInitializer::ResourceDrop(resource, ty)
619628
}
629+
wasmparser::CanonicalFunction::ResourceDropAsync { resource } => {
630+
let _ = resource;
631+
bail!("support for `resource.drop async` not implemented yet")
632+
}
620633
wasmparser::CanonicalFunction::ResourceRep { resource } => {
621634
let resource = types.component_any_type_at(resource).unwrap_resource();
622635
let ty = self.core_func_signature(core_func_index)?;
@@ -627,38 +640,53 @@ impl<'a, 'data> Translator<'a, 'data> {
627640
| wasmparser::CanonicalFunction::ThreadAvailableParallelism => {
628641
bail!("unsupported intrinsic")
629642
}
630-
wasmparser::CanonicalFunction::TaskBackpressure => {
643+
wasmparser::CanonicalFunction::BackpressureSet => {
631644
let core_type = self.core_func_signature(core_func_index)?;
632645
core_func_index += 1;
633-
LocalInitializer::TaskBackpressure { func: core_type }
646+
LocalInitializer::BackpressureSet { func: core_type }
634647
}
635648
wasmparser::CanonicalFunction::TaskReturn { .. } => {
636649
let core_type = self.core_func_signature(core_func_index)?;
637650
core_func_index += 1;
638651
LocalInitializer::TaskReturn { func: core_type }
639652
}
640-
wasmparser::CanonicalFunction::TaskWait { async_, memory } => {
653+
wasmparser::CanonicalFunction::WaitableSetNew => {
654+
let func = self.core_func_signature(core_func_index)?;
655+
core_func_index += 1;
656+
LocalInitializer::WaitableSetNew { func }
657+
}
658+
wasmparser::CanonicalFunction::WaitableSetWait { async_, memory } => {
641659
let func = self.core_func_signature(core_func_index)?;
642660
core_func_index += 1;
643-
LocalInitializer::TaskWait {
661+
LocalInitializer::WaitableSetWait {
644662
func,
645663
async_,
646664
memory: MemoryIndex::from_u32(memory),
647665
}
648666
}
649-
wasmparser::CanonicalFunction::TaskPoll { async_, memory } => {
667+
wasmparser::CanonicalFunction::WaitableSetPoll { async_, memory } => {
650668
let func = self.core_func_signature(core_func_index)?;
651669
core_func_index += 1;
652-
LocalInitializer::TaskPoll {
670+
LocalInitializer::WaitableSetPoll {
653671
func,
654672
async_,
655673
memory: MemoryIndex::from_u32(memory),
656674
}
657675
}
658-
wasmparser::CanonicalFunction::TaskYield { async_ } => {
676+
wasmparser::CanonicalFunction::WaitableSetDrop => {
677+
let func = self.core_func_signature(core_func_index)?;
678+
core_func_index += 1;
679+
LocalInitializer::WaitableSetDrop { func }
680+
}
681+
wasmparser::CanonicalFunction::WaitableJoin => {
682+
let func = self.core_func_signature(core_func_index)?;
683+
core_func_index += 1;
684+
LocalInitializer::WaitableJoin { func }
685+
}
686+
wasmparser::CanonicalFunction::Yield { async_ } => {
659687
let func = self.core_func_signature(core_func_index)?;
660688
core_func_index += 1;
661-
LocalInitializer::TaskYield { func, async_ }
689+
LocalInitializer::Yield { func, async_ }
662690
}
663691
wasmparser::CanonicalFunction::SubtaskDrop => {
664692
let func = self.core_func_signature(core_func_index)?;

0 commit comments

Comments
 (0)