Debian Codegraph @

tests/snapshots/cli/stack-switching/lwt.wast/6.print

raw
1 (module $scheduler
2 (type $func (;0;) (func))
3 (type $cont (;1;) (cont $func))
4 (type (;2;) (func (param (ref $cont))))
5 (type (;3;) (func (result i32)))
6 (type (;4;) (func (result (ref null $cont))))
7 (type (;5;) (func (param (ref null $cont))))
8 (type (;6;) (func (result (ref $cont) (ref $cont))))
9 (import "lwt" "yield" (tag $yield (;0;) (type $func)))
10 (import "lwt" "fork" (tag $fork (;1;) (type 2) (param (ref $cont))))
11 (import "queue" "queue-empty" (func $queue-empty (;0;) (type 3)))
12 (import "queue" "dequeue" (func $dequeue (;1;) (type 4)))
13 (import "queue" "enqueue" (func $enqueue (;2;) (type 5)))
14 (export "sync" (func $sync))
15 (export "kt" (func $kt))
16 (export "tk" (func $tk))
17 (export "ykt" (func $ykt))
18 (export "ytk" (func $ytk))
19 (func $sync (;3;) (type 5) (param $nextk (ref null $cont))
20 loop $l
21 local.get $nextk
22 ref.is_null
23 if ;; label = @2
24 return
25 end
26 block $on_yield (result (ref $cont))
27 block $on_fork (type 6) (result (ref $cont) (ref $cont))
28 local.get $nextk
29 resume $cont (on $yield $on_yield) (on $fork $on_fork)
30 call $dequeue
31 local.set $nextk
32 br $l
33 end
34 local.set $nextk
35 call $enqueue
36 br $l
37 end
38 local.set $nextk
39 br $l
40 end
41 )
42 (func $kt (;4;) (type 5) (param $nextk (ref null $cont))
43 loop $l
44 local.get $nextk
45 ref.is_null
46 if ;; label = @2
47 return
48 end
49 block $on_yield (result (ref $cont))
50 block $on_fork (type 6) (result (ref $cont) (ref $cont))
51 local.get $nextk
52 resume $cont (on $yield $on_yield) (on $fork $on_fork)
53 call $dequeue
54 local.set $nextk
55 br $l
56 end
57 local.set $nextk
58 call $enqueue
59 br $l
60 end
61 call $enqueue
62 call $dequeue
63 local.set $nextk
64 br $l
65 end
66 )
67 (func $tk (;5;) (type 5) (param $nextk (ref null $cont))
68 loop $l
69 local.get $nextk
70 ref.is_null
71 if ;; label = @2
72 return
73 end
74 block $on_yield (result (ref $cont))
75 block $on_fork (type 6) (result (ref $cont) (ref $cont))
76 local.get $nextk
77 resume $cont (on $yield $on_yield) (on $fork $on_fork)
78 call $dequeue
79 local.set $nextk
80 br $l
81 end
82 call $enqueue
83 local.set $nextk
84 br $l
85 end
86 call $enqueue
87 call $dequeue
88 local.set $nextk
89 br $l
90 end
91 )
92 (func $ykt (;6;) (type 5) (param $nextk (ref null $cont))
93 loop $l
94 local.get $nextk
95 ref.is_null
96 if ;; label = @2
97 return
98 end
99 block $on_yield (result (ref $cont))
100 block $on_fork (type 6) (result (ref $cont) (ref $cont))
101 local.get $nextk
102 resume $cont (on $yield $on_yield) (on $fork $on_fork)
103 call $dequeue
104 local.set $nextk
105 br $l
106 end
107 call $enqueue
108 call $enqueue
109 call $dequeue
110 local.set $nextk
111 br $l
112 end
113 call $enqueue
114 call $dequeue
115 local.set $nextk
116 br $l
117 end
118 )
119 (func $ytk (;7;) (type 5) (param $nextk (ref null $cont))
120 loop $l
121 local.get $nextk
122 ref.is_null
123 if ;; label = @2
124 return
125 end
126 block $on_yield (result (ref $cont))
127 block $on_fork (type 6) (result (ref $cont) (ref $cont))
128 local.get $nextk
129 resume $cont (on $yield $on_yield) (on $fork $on_fork)
130 call $dequeue
131 local.set $nextk
132 br $l
133 end
134 local.set $nextk
135 call $enqueue
136 local.get $nextk
137 call $enqueue
138 call $dequeue
139 local.set $nextk
140 br $l
141 end
142 call $enqueue
143 call $dequeue
144 local.set $nextk
145 br $l
146 end
147 )
148 )