Debian Codegraph @

crates/wit-component/tests/components/threading/component.wat

raw
1 (component
2 (core module (;0;)
3 (type $thread-start-func-ty (;0;) (func (param i32)))
4 (type (;1;) (func))
5 (type (;2;) (func (param i32 i32)))
6 (type (;3;) (func (result i32)))
7 (type (;4;) (func (param i32 i32) (result i32)))
8 (type (;5;) (func (param i32) (result i32)))
9 (type (;6;) (func (param i32 i32 i32 i32) (result i32)))
10 (import "[export]$root" "[task-cancel]" (func (;0;) (type 1)))
11 (import "[export]$root" "[task-return]foo" (func (;1;) (type 2)))
12 (import "[export]foo:foo/bar" "[task-return]foo" (func (;2;) (type 2)))
13 (import "$root" "[context-get-1]" (func (;3;) (type 3)))
14 (import "$root" "[context-set-1]" (func (;4;) (type $thread-start-func-ty)))
15 (import "$root" "[thread-index]" (func (;5;) (type 3)))
16 (import "$root" "[thread-new-indirect-v0]" (func (;6;) (type 4)))
17 (import "$root" "[thread-switch-to]" (func (;7;) (type 5)))
18 (import "$root" "[thread-suspend]" (func (;8;) (type 3)))
19 (import "$root" "[thread-resume-later]" (func (;9;) (type $thread-start-func-ty)))
20 (import "$root" "[thread-yield-to]" (func (;10;) (type 5)))
21 (table (;0;) 1 1 funcref)
22 (memory (;0;) 1)
23 (export "thread_main" (func 11))
24 (export "[async-lift-stackful]foo" (func 12))
25 (export "[async-lift-stackful]foo:foo/bar#foo" (func 13))
26 (export "memory" (memory 0))
27 (export "__indirect_function_table" (table 0))
28 (export "cabi_realloc" (func 14))
29 (elem (;0;) (i32.const 0) func 0)
30 (func (;11;) (type $thread-start-func-ty) (param i32)
31 unreachable
32 )
33 (func (;12;) (type 2) (param i32 i32)
34 unreachable
35 )
36 (func (;13;) (type 2) (param i32 i32)
37 unreachable
38 )
39 (func (;14;) (type 6) (param i32 i32 i32 i32) (result i32)
40 unreachable
41 )
42 (@producers
43 (processed-by "wit-component" "$CARGO_PKG_VERSION")
44 (processed-by "my-fake-bindgen" "123.45")
45 )
46 )
47 (core module (;1;)
48 (type (;0;) (func (param i32 i32)))
49 (type (;1;) (func (param i32 i32) (result i32)))
50 (table (;0;) 3 3 funcref)
51 (export "0" (func $task-return-foo))
52 (export "1" (func $"#func1 task-return-foo"))
53 (export "2" (func $thread.new_indirect))
54 (export "$imports" (table 0))
55 (func $task-return-foo (;0;) (type 0) (param i32 i32)
56 local.get 0
57 local.get 1
58 i32.const 0
59 call_indirect (type 0)
60 )
61 (func $"#func1 task-return-foo" (@name "task-return-foo") (;1;) (type 0) (param i32 i32)
62 local.get 0
63 local.get 1
64 i32.const 1
65 call_indirect (type 0)
66 )
67 (func $thread.new_indirect (;2;) (type 1) (param i32 i32) (result i32)
68 local.get 0
69 local.get 1
70 i32.const 2
71 call_indirect (type 1)
72 )
73 (@producers
74 (processed-by "wit-component" "$CARGO_PKG_VERSION")
75 )
76 )
77 (core module (;2;)
78 (type (;0;) (func (param i32 i32)))
79 (type (;1;) (func (param i32 i32) (result i32)))
80 (import "" "0" (func (;0;) (type 0)))
81 (import "" "1" (func (;1;) (type 0)))
82 (import "" "2" (func (;2;) (type 1)))
83 (import "" "$imports" (table (;0;) 3 3 funcref))
84 (elem (;0;) (i32.const 0) func 0 1 2)
85 (@producers
86 (processed-by "wit-component" "$CARGO_PKG_VERSION")
87 )
88 )
89 (core instance (;0;) (instantiate 1))
90 (core func (;0;) (canon task.cancel))
91 (alias core export 0 "0" (core func (;1;)))
92 (core instance (;1;)
93 (export "[task-cancel]" (func 0))
94 (export "[task-return]foo" (func 1))
95 )
96 (alias core export 0 "1" (core func (;2;)))
97 (core instance (;2;)
98 (export "[task-return]foo" (func 2))
99 )
100 (core func (;3;) (canon context.get i32 1))
101 (core func (;4;) (canon context.set i32 1))
102 (core func (;5;) (canon thread.index))
103 (alias core export 0 "2" (core func (;6;)))
104 (core func (;7;) (canon thread.switch-to))
105 (core func (;8;) (canon thread.suspend))
106 (core func (;9;) (canon thread.resume-later))
107 (core func (;10;) (canon thread.yield-to))
108 (core instance (;3;)
109 (export "[context-get-1]" (func 3))
110 (export "[context-set-1]" (func 4))
111 (export "[thread-index]" (func 5))
112 (export "[thread-new-indirect-v0]" (func 6))
113 (export "[thread-switch-to]" (func 7))
114 (export "[thread-suspend]" (func 8))
115 (export "[thread-resume-later]" (func 9))
116 (export "[thread-yield-to]" (func 10))
117 )
118 (core instance (;4;) (instantiate 0
119 (with "[export]$root" (instance 1))
120 (with "[export]foo:foo/bar" (instance 2))
121 (with "$root" (instance 3))
122 )
123 )
124 (alias core export 4 "memory" (core memory (;0;)))
125 (alias core export 0 "$imports" (core table (;0;)))
126 (alias core export 4 "cabi_realloc" (core func (;11;)))
127 (core func (;12;) (canon task.return (result string) (memory 0) string-encoding=utf8))
128 (core func (;13;) (canon task.return (result string) (memory 0) string-encoding=utf8))
129 (core type (;0;) (func (param i32)))
130 (alias core export 4 "__indirect_function_table" (core table (;1;)))
131 (core func (;14;) (canon thread.new_indirect 0 (table 1)))
132 (core instance (;5;)
133 (export "$imports" (table 0))
134 (export "0" (func 12))
135 (export "1" (func 13))
136 (export "2" (func 14))
137 )
138 (core instance (;6;) (instantiate 2
139 (with "" (instance 5))
140 )
141 )
142 (type (;0;) (func (param "s" string) (result string)))
143 (alias core export 4 "[async-lift-stackful]foo" (core func (;15;)))
144 (func (;0;) (type 0) (canon lift (core func 15) (memory 0) (realloc 11) string-encoding=utf8 async))
145 (export (;1;) "foo" (func 0))
146 (type (;1;) (func (param "s" string) (result string)))
147 (alias core export 4 "[async-lift-stackful]foo:foo/bar#foo" (core func (;16;)))
148 (func (;2;) (type 1) (canon lift (core func 16) (memory 0) (realloc 11) string-encoding=utf8 async))
149 (component (;0;)
150 (type (;0;) (func (param "s" string) (result string)))
151 (import "import-func-foo" (func (;0;) (type 0)))
152 (type (;1;) (func (param "s" string) (result string)))
153 (export (;1;) "foo" (func 0) (func (type 1)))
154 )
155 (instance (;0;) (instantiate 0
156 (with "import-func-foo" (func 2))
157 )
158 )
159 (export (;1;) "foo:foo/bar" (instance 0))
160 (@producers
161 (processed-by "wit-component" "$CARGO_PKG_VERSION")
162 )
163 )