Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
vouillon committed Feb 13, 2025
1 parent 929384b commit 5c44631
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 15 deletions.
11 changes: 3 additions & 8 deletions runtime/wasm/effect-native.wat
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,6 @@
(tag $javascript_exception (param externref)))
(import "jslib" "caml_wrap_exception"
(func $caml_wrap_exception (param externref) (result (ref eq))))
(import "bindings" "start_fiber" (func $start_fiber (param (ref eq))))
(import "bindings" "suspend_fiber"
(func $suspend_fiber
(param externref) (param $f funcref) (param $env eqref)
(result eqref)))
(import "bindings" "resume_fiber"
(func $resume_fiber (param externref) (param (ref eq))))
(import "stdlib" "caml_main_wrapper"
(global $caml_main_wrapper (mut (ref null $wrapper_func))))

Expand Down Expand Up @@ -54,6 +47,8 @@
(field $handlers (mut (ref $handlers)))
(field $cont (ref $cont))))

;; Unhandled effects

(@string $effect_unhandled "Effect.Unhandled")

(func $raise_unhandled
Expand Down Expand Up @@ -154,7 +149,7 @@
(struct.get $fiber $handlers (local.get $fiber))
(tuple.extract 2 1 (local.get $resume_res)))
(ref.i31 (i32.const 0)))
(ref.i31 (i32.const 0)) ;; unused
(local.get $tail)
(local.tee $f
(struct.get $handlers $effect
(struct.get $fiber $handlers (local.get $fiber))))
Expand Down
7 changes: 0 additions & 7 deletions runtime/wasm/effect.wat
Original file line number Diff line number Diff line change
Expand Up @@ -211,12 +211,6 @@
(br $loop)))
(local.get $k))

(@string $already_resumed "Effect.Continuation_already_resumed")

(global $effect_allowed (mut i32) (i32.const 1))

(@if (not wasi)
(@then
;; Resume

(func $do_resume (param $k (ref $cont)) (param $vp (ref eq))
Expand Down Expand Up @@ -368,7 +362,6 @@
(struct.new $handlers (local.get $hv) (local.get $hx) (local.get $hf))
(struct.new $cont (ref.func $initial_cont))
(ref.null $fiber)))
))

;; Other functions

Expand Down

0 comments on commit 5c44631

Please sign in to comment.