File tree Expand file tree Collapse file tree 9 files changed +12
-12
lines changed
wasm-encoder/src/component
tests/components/async-builtins
cli/component-model-async
snapshots/cli/component-model-async/task-builtins.wast Expand file tree Collapse file tree 9 files changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -212,7 +212,7 @@ impl CanonicalFunctionSection {
212
212
213
213
/// Defines a function to acknowledge cancellation of the current task.
214
214
pub fn task_cancel ( & mut self ) -> & mut Self {
215
- self . bytes . push ( 0x25 ) ;
215
+ self . bytes . push ( 0x05 ) ;
216
216
self . num_added += 1 ;
217
217
self
218
218
}
@@ -255,7 +255,7 @@ impl CanonicalFunctionSection {
255
255
256
256
/// Defines a function to cancel an in-progress task.
257
257
pub fn subtask_cancel ( & mut self , async_ : bool ) -> & mut Self {
258
- self . bytes . push ( 0x24 ) ;
258
+ self . bytes . push ( 0x06 ) ;
259
259
self . bytes . push ( if async_ { 1 } else { 0 } ) ;
260
260
self . num_added += 1 ;
261
261
self
Original file line number Diff line number Diff line change @@ -367,10 +367,10 @@ impl<'a> FromReader<'a> for CanonicalFunction {
367
367
} ,
368
368
0x22 => CanonicalFunction :: WaitableSetDrop ,
369
369
0x23 => CanonicalFunction :: WaitableJoin ,
370
- 0x24 => CanonicalFunction :: SubtaskCancel {
370
+ 0x06 => CanonicalFunction :: SubtaskCancel {
371
371
async_ : reader. read ( ) ?,
372
372
} ,
373
- 0x25 => CanonicalFunction :: TaskCancel ,
373
+ 0x05 => CanonicalFunction :: TaskCancel ,
374
374
0x40 => CanonicalFunction :: ThreadSpawnRef {
375
375
func_ty_index : reader. read ( ) ?,
376
376
} ,
Original file line number Diff line number Diff line change @@ -1268,7 +1268,7 @@ impl ComponentState {
1268
1268
}
1269
1269
1270
1270
self . core_funcs
1271
- . push ( types. intern_func_type ( FuncType :: new ( [ ] , [ ] ) , offset) ) ;
1271
+ . push ( types. intern_func_type ( FuncType :: new ( [ ] , [ ValType :: I32 ] ) , offset) ) ;
1272
1272
Ok ( ( ) )
1273
1273
}
1274
1274
Original file line number Diff line number Diff line change @@ -379,7 +379,7 @@ fn push_root_async_intrinsics(dst: &mut String) {
379
379
(import "$root" "[waitable-set-poll]" (func (param i32 i32) (result i32)))
380
380
(import "$root" "[waitable-set-drop]" (func (param i32)))
381
381
(import "$root" "[waitable-join]" (func (param i32 i32)))
382
- (import "$root" "[yield]" (func))
382
+ (import "$root" "[yield]" (func (result i32) ))
383
383
(import "$root" "[subtask-drop]" (func (param i32)))
384
384
(import "$root" "[subtask-cancel]" (func (param i32) (result i32)))
385
385
(import "$root" "[error-context-new-utf8]" (func (param i32 i32) (result i32)))
@@ -395,7 +395,7 @@ fn push_root_async_intrinsics(dst: &mut String) {
395
395
;; deferred behind 🚝 or 🚟 upstream
396
396
;;(import "$root" "[async-lower][waitable-set-wait]" (func (param i32 i32) (result i32)))
397
397
;;(import "$root" "[async-lower][waitable-set-poll]" (func (param i32 i32) (result i32)))
398
- ;;(import "$root" "[async-lower][yield]" (func))
398
+ ;;(import "$root" "[async-lower][yield]" (func (result i32) ))
399
399
"# ,
400
400
) ;
401
401
}
Original file line number Diff line number Diff line change @@ -607,7 +607,7 @@ impl ImportMap {
607
607
}
608
608
609
609
if Some ( name) == names. yield_ ( ) {
610
- let expected = FuncType :: new ( [ ] , [ ] ) ;
610
+ let expected = FuncType :: new ( [ ] , [ ValType :: I32 ] ) ;
611
611
validate_func_sig ( name, & expected, ty) ?;
612
612
return Ok ( Import :: Yield { async_ } ) ;
613
613
}
Original file line number Diff line number Diff line change 16
16
(import " $root" " [waitable-set-poll]" (func (;6;) (type 4 )))
17
17
(import " $root" " [waitable-set-drop]" (func (;7;) (type 0 )))
18
18
(import " $root" " [waitable-join]" (func (;8;) (type 2 )))
19
- (import " $root" " [yield]" (func (;9;) (type 1 )))
19
+ (import " $root" " [yield]" (func (;9;) (type 3 )))
20
20
(import " $root" " [subtask-drop]" (func (;10;) (type 0 )))
21
21
(import " $root" " [subtask-cancel]" (func (;11;) (type 5 )))
22
22
(import " $root" " [error-context-new-utf8]" (func (;12;) (type 4 )))
Original file line number Diff line number Diff line change 8
8
(import " $root" " [waitable-set-poll]" (func (param i32 i32 ) (result i32 )))
9
9
(import " $root" " [waitable-set-drop]" (func (param i32 )))
10
10
(import " $root" " [waitable-join]" (func (param i32 i32 )))
11
- (import " $root" " [yield]" (func ))
11
+ (import " $root" " [yield]" (func ( result i32 ) ))
12
12
(import " $root" " [subtask-drop]" (func (param i32 )))
13
13
(import " $root" " [subtask-cancel]" (func (param i32 ) (result i32 )))
14
14
(import " $root" " [error-context-new-utf8]" (func (param i32 i32 ) (result i32 )))
Original file line number Diff line number Diff line change 182
182
;; yield
183
183
(component
184
184
(core module $m
185
- (import " " " yield" (func $yield ))
185
+ (import " " " yield" (func $yield ( result i32 ) ))
186
186
)
187
187
(core func $yield (canon yield async))
188
188
(core instance $i (instantiate $m (with " " (instance (export " yield" (func $yield ))))))
Original file line number Diff line number Diff line change 1
1
(component
2
2
(core module $m (;0;)
3
- (type (;0;) (func))
3
+ (type (;0;) (func (result i32) ))
4
4
(import "" "yield" (func $yield (;0;) (type 0)))
5
5
)
6
6
(core func $yield (;0;) (canon yield async))
You can’t perform that action at this time.
0 commit comments