Skip to content

Commit

Permalink
Resume table syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
dhil committed Aug 5, 2024
1 parent 156f8ac commit b61e169
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 13 deletions.
2 changes: 1 addition & 1 deletion c10m/wasmfx_import.wast
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
(local $k (ref null $cawt))
(block $on_return (result i32)
(block $on_yield (result i32 (ref $cawt))
(resume $cawt (tag $yield $on_yield) (local.get $value) (table.get $conts (local.get $key)))
(resume $cawt (on $yield $on_yield) (local.get $value) (table.get $conts (local.get $key)))
(br $on_return)
) ;; on_yield [ i32 (ref $cawt) ]
(local.set $k)
Expand Down
3 changes: 2 additions & 1 deletion make.config
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Default stack size
ASYNCIFY_DEFAULT_STACK_SIZE?=2097152
DEFAULT_STACK_SIZE?=2097152
ASYNCIFY_DEFAULT_STACK_SIZE?=$(DEFAULT_STACK_SIZE)
WASMFX_CONT_TABLE_INITIAL_CAPACITY?=1024

# Mimalloc (drop-in replacement for malloc)
Expand Down
4 changes: 2 additions & 2 deletions micro/2resumes_same_function/bench.wat
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
(cont.new $ct (ref.func $suspend0))
(loop $loop (param (ref $ct))
(block $inner (param (ref $ct)) (result (ref $ct))
(resume $ct (tag $t $inner))
(resume $ct (on $t $inner))
(return)
)
(resume $ct (tag $t $loop))
(resume $ct (on $t $loop))
(return)
)
)
Expand Down
2 changes: 1 addition & 1 deletion micro/suspend_resume/bench.wat
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

(cont.new $cp0r0 (ref.func $suspend0))
(loop $loop (param (ref $cp0r0))
(resume $cp0r0 (tag $tr0s0 $loop))
(resume $cp0r0 (on $tr0s0 $loop))
(return)
)

Expand Down
4 changes: 2 additions & 2 deletions sieve/wasmfx_import.wast
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
(local $fiber (ref $cfilter))
(local.set $fiber (cont.new $cfilter (ref.func $filter)))
(block $on_init (result (ref $cfilter))
(resume $cfilter (tag $init $on_init)
(resume $cfilter (on $init $on_init)
(local.get $prime)
(local.get $fiber))
(unreachable)
Expand All @@ -64,7 +64,7 @@
(func $filter_send (export "filter_send") (param $fiber_idx i32) (param $candidate i32) (result i32)
(local $next_k (ref $cfilter))
(block $on_yield (result i32 (ref $cfilter))
(resume $cfilter (tag $yield $on_yield)
(resume $cfilter (on $yield $on_yield)
(local.get $candidate)
(table.get $conts (local.get $fiber_idx)))
(unreachable)
Expand Down
2 changes: 1 addition & 1 deletion skynet/wasmfx_import.wast
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
(param $num i64)
(result i64)
(block $on_yield (result i64 (ref $cyield))
(resume $ct (tag $yield $on_yield)
(resume $ct (on $yield $on_yield)
(local.get $level)
(local.get $num)
(cont.new $ct (ref.func $skynet)))
Expand Down
8 changes: 4 additions & 4 deletions state/wasmfx_import.wast
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
(block $on_done (result i32)
(block $on_put (result i32 (ref $cput))
(block $on_get (result (ref $cget))
(resume $kt (tag $get $on_get) (tag $put $on_put) (local.get $k))
(resume $kt (on $get $on_get) (on $put $on_put) (local.get $k))
(br $on_done)
) ;; on_get [ (ref $cget) ]
(local.set $kget)
Expand All @@ -53,7 +53,7 @@
(block $continue
(block $on_put1 (result i32 (ref $cput))
(block $on_get1 (result (ref $cget))
(resume $cinit (tag $get $on_get1) (tag $put $on_put1)
(resume $cinit (on $get $on_get1) (on $put $on_put1)
(local.get $limit)
(cont.new $cinit (ref.func $count)))
(br $on_done)
Expand All @@ -75,11 +75,11 @@
;; must have been `put`.
(br_on_null $handle_put (local.get $kget))
) ;; $handle_get
(resume $cget (tag $get $on_get) (tag $put $on_put)
(resume $cget (on $get $on_get) (on $put $on_put)
(local.get $state) (local.get $kget))
(br $on_done)
) ;; $handle_put
(resume $cput (tag $get $on_get) (tag $put $on_put)
(resume $cput (on $get $on_get) (on $put $on_put)
(local.get $kput))
(br $on_done)
) ;; $on_get [ (ref $cget) ]
Expand Down
2 changes: 1 addition & 1 deletion vendor/fiber-c

0 comments on commit b61e169

Please sign in to comment.