Debian Codegraph @

crates/wit-component/tests/components/export-resource/component.wat

raw
1 (component
2 (core module (;0;)
3 (type (;0;) (func (param i32) (result i32)))
4 (type (;1;) (func (param i32)))
5 (type (;2;) (func (result i32)))
6 (import "[export]foo" "[resource-new]a" (func $new (;0;) (type 0)))
7 (import "[export]foo" "[resource-rep]a" (func (;1;) (type 0)))
8 (import "[export]foo" "[resource-drop]a" (func (;2;) (type 1)))
9 (export "foo#[constructor]a" (func 3))
10 (export "foo#[static]a.other-new" (func 4))
11 (export "foo#[dtor]a" (func 5))
12 (func (;3;) (type 2) (result i32)
13 i32.const 100
14 call $new
15 )
16 (func (;4;) (type 2) (result i32)
17 i32.const 200
18 call $new
19 )
20 (func (;5;) (type 1) (param i32))
21 (@producers
22 (processed-by "wit-component" "$CARGO_PKG_VERSION")
23 (processed-by "my-fake-bindgen" "123.45")
24 )
25 )
26 (core module (;1;)
27 (type (;0;) (func (param i32)))
28 (table (;0;) 1 1 funcref)
29 (export "0" (func $dtor-a))
30 (export "$imports" (table 0))
31 (func $dtor-a (;0;) (type 0) (param i32)
32 local.get 0
33 i32.const 0
34 call_indirect (type 0)
35 )
36 (@producers
37 (processed-by "wit-component" "$CARGO_PKG_VERSION")
38 )
39 )
40 (core module (;2;)
41 (type (;0;) (func (param i32)))
42 (import "" "0" (func (;0;) (type 0)))
43 (import "" "$imports" (table (;0;) 1 1 funcref))
44 (elem (;0;) (i32.const 0) func 0)
45 (@producers
46 (processed-by "wit-component" "$CARGO_PKG_VERSION")
47 )
48 )
49 (core instance (;0;) (instantiate 1))
50 (alias core export 0 "0" (core func (;0;)))
51 (type (;0;) (resource (rep i32) (dtor (func 0))))
52 (core func (;1;) (canon resource.new 0))
53 (core func (;2;) (canon resource.rep 0))
54 (core func (;3;) (canon resource.drop 0))
55 (core instance (;1;)
56 (export "[resource-new]a" (func 1))
57 (export "[resource-rep]a" (func 2))
58 (export "[resource-drop]a" (func 3))
59 )
60 (core instance (;2;) (instantiate 0
61 (with "[export]foo" (instance 1))
62 )
63 )
64 (alias core export 0 "$imports" (core table (;0;)))
65 (alias core export 2 "foo#[dtor]a" (core func (;4;)))
66 (core instance (;3;)
67 (export "$imports" (table 0))
68 (export "0" (func 4))
69 )
70 (core instance (;4;) (instantiate 2
71 (with "" (instance 3))
72 )
73 )
74 (type (;1;) (own 0))
75 (type (;2;) (func (result 1)))
76 (alias core export 2 "foo#[constructor]a" (core func (;5;)))
77 (func (;0;) (type 2) (canon lift (core func 5)))
78 (alias core export 2 "foo#[static]a.other-new" (core func (;6;)))
79 (func (;1;) (type 2) (canon lift (core func 6)))
80 (component (;0;)
81 (import "import-type-a" (type (;0;) (sub resource)))
82 (type (;1;) (own 0))
83 (type (;2;) (func (result 1)))
84 (import "import-constructor-a" (func (;0;) (type 2)))
85 (import "import-static-a-other-new" (func (;1;) (type 2)))
86 (export (;3;) "a" (type 0))
87 (type (;4;) (own 3))
88 (type (;5;) (func (result 4)))
89 (export (;2;) "[constructor]a" (func 0) (func (type 5)))
90 (export (;3;) "[static]a.other-new" (func 1) (func (type 5)))
91 )
92 (instance (;0;) (instantiate 0
93 (with "import-constructor-a" (func 0))
94 (with "import-static-a-other-new" (func 1))
95 (with "import-type-a" (type 0))
96 )
97 )
98 (export (;1;) "foo" (instance 0))
99 (@producers
100 (processed-by "wit-component" "$CARGO_PKG_VERSION")
101 )
102 )