Debian Codegraph @

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

raw
1 (component
2 (type (;0;)
3 (instance
4 (type (;0;) (func (param "v" s32) (result s32)))
5 (export (;0;) "bar" (func (type 0)))
6 )
7 )
8 (import "test:test/test" (instance (;0;) (type 0)))
9 (core module (;0;)
10 (table (;0;) 1 funcref)
11 (memory (;0;) 17)
12 (global (;0;) (mut i32) i32.const 1048576)
13 (global (;1;) i32 i32.const 1048592)
14 (global (;2;) i32 i32.const 1)
15 (global (;3;) (mut i32) i32.const 0)
16 (global (;4;) i32 i32.const 1048624)
17 (global (;5;) i32 i32.const 1)
18 (global (;6;) i32 i32.const 1048624)
19 (global (;7;) i32 i32.const 1)
20 (global (;8;) (mut i32) i32.const 0)
21 (global (;9;) (mut i32) i32.const 1048640)
22 (global (;10;) (mut i32) i32.const 1114112)
23 (export "__stack_pointer" (global 0))
24 (export "bar:memory_base" (global 1))
25 (export "bar:table_base" (global 2))
26 (export "bar:well" (global 3))
27 (export "c:memory_base" (global 4))
28 (export "c:table_base" (global 5))
29 (export "foo:memory_base" (global 6))
30 (export "foo:table_base" (global 7))
31 (export "foo:um" (global 8))
32 (export "__heap_base" (global 9))
33 (export "__heap_end" (global 10))
34 (export "__indirect_function_table" (table 0))
35 (export "memory" (memory 0))
36 (@producers
37 (processed-by "wit-component" "$CARGO_PKG_VERSION")
38 )
39 )
40 (core module (;1;)
41 (@dylink.0
42 (mem-info (memory 0 4))
43 )
44 (type (;0;) (func))
45 (type (;1;) (func (param i32) (result i32)))
46 (import "GOT.mem" "__heap_base" (global $__heap_base (;0;) (mut i32)))
47 (import "GOT.mem" "__heap_end" (global $__heap_end (;1;) (mut i32)))
48 (global $heap (;2;) (mut i32) i32.const 0)
49 (export "malloc" (func $malloc))
50 (export "abort" (func $abort))
51 (start $start)
52 (func $start (;0;) (type 0)
53 global.get $__heap_base
54 global.set $heap
55 )
56 (func $malloc (;1;) (type 1) (param i32) (result i32)
57 global.get $heap
58 global.get $heap
59 local.get 0
60 i32.add
61 global.set $heap
62 )
63 (func $abort (;2;) (type 0)
64 unreachable
65 )
66 )
67 (core module (;2;)
68 (@dylink.0
69 (mem-info (memory 4 4))
70 (needed "c")
71 )
72 (type (;0;) (func))
73 (type (;1;) (func (param i32) (result i32)))
74 (import "env" "memory" (memory (;0;) 1))
75 (import "env" "__indirect_function_table" (table (;0;) 0 funcref))
76 (import "env" "__stack_pointer" (global $__stack_pointer (;0;) (mut i32)))
77 (import "env" "__memory_base" (global $__memory_base (;1;) i32))
78 (import "env" "__table_base" (global $__table_base (;2;) i32))
79 (import "env" "malloc" (func $malloc (;0;) (type 1)))
80 (import "env" "abort" (func $abort (;1;) (type 0)))
81 (import "GOT.mem" "um" (global $um (;3;) (mut i32)))
82 (import "test:test/test" "bar" (func $bar (;2;) (type 1)))
83 (global (;4;) i32 i32.const 0)
84 (export "__wasm_call_ctors" (func $__wasm_call_ctors))
85 (export "__wasm_apply_data_relocs" (func $__wasm_apply_data_relocs))
86 (export "foo" (func $foo))
87 (export "well" (global 4))
88 (func $__wasm_call_ctors (;3;) (type 0))
89 (func $__wasm_apply_data_relocs (;4;) (type 0))
90 (func $foo (;5;) (type 1) (param i32) (result i32)
91 global.get $__stack_pointer
92 i32.const 16
93 i32.sub
94 global.set $__stack_pointer
95 i32.const 4
96 call $malloc
97 i32.const 0
98 i32.eq
99 if ;; label = @1
100 call $abort
101 unreachable
102 end
103 local.get 0
104 global.get $um
105 i32.load offset=16
106 i32.add
107 i32.const 42
108 i32.add
109 call $bar
110 global.get $__stack_pointer
111 i32.const 16
112 i32.add
113 global.set $__stack_pointer
114 )
115 (data $.data (;0;) (global.get $__memory_base) "\04\00\00\00")
116 )
117 (core module (;3;)
118 (@dylink.0
119 (mem-info (memory 20 4))
120 (needed "foo")
121 )
122 (type (;0;) (func (param i32) (result i32)))
123 (type (;1;) (func))
124 (import "env" "memory" (memory (;0;) 1))
125 (import "env" "__indirect_function_table" (table (;0;) 0 funcref))
126 (import "env" "__memory_base" (global $__memory_base (;0;) i32))
127 (import "env" "__table_base" (global $__table_base (;1;) i32))
128 (import "env" "foo" (func $foo (;0;) (type 0)))
129 (import "GOT.mem" "well" (global $well (;2;) (mut i32)))
130 (global (;3;) i32 i32.const 0)
131 (export "__wasm_call_ctors" (func $__wasm_call_ctors))
132 (export "__wasm_apply_data_relocs" (func $__wasm_apply_data_relocs))
133 (export "test:test/test#bar" (func $bar))
134 (export "um" (global 3))
135 (func $__wasm_call_ctors (;1;) (type 1))
136 (func $__wasm_apply_data_relocs (;2;) (type 1))
137 (func $bar (;3;) (type 0) (param i32) (result i32)
138 local.get 0
139 call $foo
140 global.get $well
141 i32.load
142 i32.add
143 )
144 (data $.data (;0;) (global.get $__memory_base) "\01\00\00\00\02\00\00\00\03\00\00\00\04\00\00\00\05\00\00\00")
145 )
146 (core module (;4;)
147 (type (;0;) (func))
148 (type (;1;) (func (param i32)))
149 (import "env" "memory" (memory (;0;) 0))
150 (import "env" "__indirect_function_table" (table (;0;) 0 funcref))
151 (import "bar" "__wasm_apply_data_relocs" (func (;0;) (type 0)))
152 (import "bar" "__wasm_call_ctors" (func (;1;) (type 0)))
153 (import "env" "foo:memory_base" (global (;0;) i32))
154 (import "foo" "well" (global (;1;) i32))
155 (import "env" "bar:well" (global (;2;) (mut i32)))
156 (import "foo" "__wasm_apply_data_relocs" (func (;2;) (type 0)))
157 (import "foo" "__wasm_call_ctors" (func (;3;) (type 0)))
158 (import "env" "bar:memory_base" (global (;3;) i32))
159 (import "bar" "um" (global (;4;) i32))
160 (import "env" "foo:um" (global (;5;) (mut i32)))
161 (start 4)
162 (elem (;0;) (i32.const 1) func)
163 (elem (;1;) (i32.const 1) func)
164 (func (;4;) (type 0)
165 global.get 0
166 global.get 1
167 i32.add
168 global.set 2
169 global.get 3
170 global.get 4
171 i32.add
172 global.set 5
173 call 0
174 call 2
175 call 1
176 call 3
177 )
178 (data (;0;) (i32.const 1048576) "\00\00\00\00\00\00\10\00")
179 (@producers
180 (processed-by "wit-component" "$CARGO_PKG_VERSION")
181 )
182 )
183 (core instance (;0;) (instantiate 0))
184 (alias core export 0 "memory" (core memory (;0;)))
185 (alias core export 0 "__heap_base" (core global (;0;)))
186 (alias core export 0 "__heap_end" (core global (;1;)))
187 (core instance (;1;)
188 (export "__heap_base" (global 0))
189 (export "__heap_end" (global 1))
190 )
191 (core instance (;2;) (instantiate 1
192 (with "GOT.mem" (instance 1))
193 )
194 )
195 (alias core export 0 "__indirect_function_table" (core table (;0;)))
196 (alias core export 0 "__stack_pointer" (core global (;2;)))
197 (alias core export 0 "foo:memory_base" (core global (;3;)))
198 (alias core export 0 "foo:table_base" (core global (;4;)))
199 (alias core export 2 "malloc" (core func (;0;)))
200 (alias core export 2 "abort" (core func (;1;)))
201 (core instance (;3;)
202 (export "memory" (memory 0))
203 (export "__indirect_function_table" (table 0))
204 (export "__stack_pointer" (global 2))
205 (export "__memory_base" (global 3))
206 (export "__table_base" (global 4))
207 (export "malloc" (func 0))
208 (export "abort" (func 1))
209 )
210 (alias core export 0 "foo:um" (core global (;5;)))
211 (core instance (;4;)
212 (export "um" (global 5))
213 )
214 (alias export 0 "bar" (func (;0;)))
215 (core func (;2;) (canon lower (func 0)))
216 (core instance (;5;)
217 (export "bar" (func 2))
218 )
219 (core instance (;6;) (instantiate 2
220 (with "env" (instance 3))
221 (with "GOT.mem" (instance 4))
222 (with "test:test/test" (instance 5))
223 )
224 )
225 (alias core export 0 "bar:memory_base" (core global (;6;)))
226 (alias core export 0 "bar:table_base" (core global (;7;)))
227 (alias core export 6 "foo" (core func (;3;)))
228 (core instance (;7;)
229 (export "memory" (memory 0))
230 (export "__indirect_function_table" (table 0))
231 (export "__memory_base" (global 6))
232 (export "__table_base" (global 7))
233 (export "foo" (func 3))
234 )
235 (alias core export 0 "bar:well" (core global (;8;)))
236 (core instance (;8;)
237 (export "well" (global 8))
238 )
239 (core instance (;9;) (instantiate 3
240 (with "env" (instance 7))
241 (with "GOT.mem" (instance 8))
242 )
243 )
244 (core instance (;10;) (instantiate 4
245 (with "env" (instance 0))
246 (with "bar" (instance 9))
247 (with "foo" (instance 6))
248 )
249 )
250 (type (;1;) (func (param "v" s32) (result s32)))
251 (alias core export 9 "test:test/test#bar" (core func (;4;)))
252 (func (;1;) (type 1) (canon lift (core func 4)))
253 (component (;0;)
254 (type (;0;) (func (param "v" s32) (result s32)))
255 (import "import-func-bar" (func (;0;) (type 0)))
256 (type (;1;) (func (param "v" s32) (result s32)))
257 (export (;1;) "bar" (func 0) (func (type 1)))
258 )
259 (instance (;1;) (instantiate 0
260 (with "import-func-bar" (func 1))
261 )
262 )
263 (export (;2;) "test:test/test" (instance 1))
264 (@producers
265 (processed-by "wit-component" "$CARGO_PKG_VERSION")
266 )
267 )