Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wasmprinter: print function bodies with code section #1788

Merged
merged 2 commits into from
Sep 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
74 changes: 37 additions & 37 deletions crates/wasm-compose/tests/compositions/complex/composed.wat
Original file line number Diff line number Diff line change
Expand Up @@ -81,16 +81,16 @@
(type (;1;) (func (param i32 i32) (result i32)))
(type (;2;) (func (param i32 i32 i32 i32) (result i32)))
(import "a" "m" (func (;0;) (type 0)))
(memory (;0;) 0)
(export "memory" (memory 0))
(export "m" (func $m))
(export "canonical_abi_realloc" (func $canonical_abi_realloc))
(func $m (;1;) (type 1) (param i32 i32) (result i32)
unreachable
)
(func $canonical_abi_realloc (;2;) (type 2) (param i32 i32 i32 i32) (result i32)
unreachable
)
(memory (;0;) 0)
(export "memory" (memory 0))
(export "m" (func $m))
(export "canonical_abi_realloc" (func $canonical_abi_realloc))
)
(core module $m1 (;1;)
(type (;0;) (func (param i32 i32)))
Expand All @@ -99,6 +99,15 @@
(type (;3;) (func (param i32 i32 i32 i32 i32 i32 i32 i64 i64 f32 f64 i32 i32 i32)))
(type (;4;) (func (param i32 i32 i64 i32 i32 i32 i32 i32 i64 i64 f32 f64 i32 i32 i32)))
(type (;5;) (func (param i32)))
(table (;0;) 7 7 funcref)
(export "0" (func 0))
(export "1" (func 1))
(export "2" (func 2))
(export "3" (func 3))
(export "4" (func 4))
(export "5" (func 5))
(export "6" (func 6))
(export "$imports" (table 0))
(func (;0;) (type 0) (param i32 i32)
local.get 0
local.get 1
Expand Down Expand Up @@ -189,15 +198,6 @@
i32.const 6
call_indirect (type 5)
)
(table (;0;) 7 7 funcref)
(export "0" (func 0))
(export "1" (func 1))
(export "2" (func 2))
(export "3" (func 3))
(export "4" (func 4))
(export "5" (func 5))
(export "6" (func 6))
(export "$imports" (table 0))
)
(core module $m2 (;2;)
(type (;0;) (func (param i32 i32)))
Expand Down Expand Up @@ -366,6 +366,30 @@
(type (;9;) (func (param i32 i32 i64 i32 i32 i32 i32 i32 i64 i64 f32 f64 i32 i32 i32)))
(type (;10;) (func (result i32)))
(type (;11;) (func (param i32 i32 i32 i32) (result i32)))
(memory (;0;) 0)
(export "memory" (memory 0))
(export "a" (func $a))
(export "b" (func $b))
(export "c" (func $c))
(export "d" (func $d))
(export "e" (func $e))
(export "f" (func $f))
(export "g" (func $g))
(export "h" (func $h))
(export "i" (func $i))
(export "j" (func $j))
(export "k" (func $k))
(export "l" (func $l))
(export "m" (func $m))
(export "n" (func $n))
(export "o" (func $o))
(export "p" (func $p))
(export "q" (func $q))
(export "r" (func $r))
(export "s" (func $s))
(export "t" (func $t))
(export "u" (func $u))
(export "canonical_abi_realloc" (func $canonical_abi_realloc))
(func $a (;0;) (type 0)
unreachable
)
Expand Down Expand Up @@ -432,30 +456,6 @@
(func $canonical_abi_realloc (;21;) (type 11) (param i32 i32 i32 i32) (result i32)
unreachable
)
(memory (;0;) 0)
(export "memory" (memory 0))
(export "a" (func $a))
(export "b" (func $b))
(export "c" (func $c))
(export "d" (func $d))
(export "e" (func $e))
(export "f" (func $f))
(export "g" (func $g))
(export "h" (func $h))
(export "i" (func $i))
(export "j" (func $j))
(export "k" (func $k))
(export "l" (func $l))
(export "m" (func $m))
(export "n" (func $n))
(export "o" (func $o))
(export "p" (func $p))
(export "q" (func $q))
(export "r" (func $r))
(export "s" (func $s))
(export "t" (func $t))
(export "u" (func $u))
(export "canonical_abi_realloc" (func $canonical_abi_realloc))
)
(core instance (;0;) (instantiate 0))
(alias core export 0 "memory" (core memory (;0;)))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@
(import "example:service/logging@0.1.0" "[method]logger.log" (func (;0;) (type 0)))
(import "example:service/logging@0.1.0" "get-logger" (func (;1;) (type 1)))
(import "[export]example:service/logging@0.1.0" "[resource-new]logger" (func (;2;) (type 2)))
(memory $memory (;0;) 1)
(export "memory" (memory $memory))
(export "cabi_realloc" (func $cabi_realloc))
(export "example:service/logging@0.1.0#[method]logger.log" (func $logger-log))
(export "example:service/logging@0.1.0#get-logger" (func $get-logger))
(func $cabi_realloc (;3;) (type 3) (param i32 i32 i32 i32) (result i32)
unreachable
)
Expand All @@ -55,16 +60,13 @@
(func $get-logger (;5;) (type 1) (result i32)
unreachable
)
(memory $memory (;0;) 1)
(export "memory" (memory $memory))
(export "cabi_realloc" (func $cabi_realloc))
(export "example:service/logging@0.1.0#[method]logger.log" (func $logger-log))
(export "example:service/logging@0.1.0#get-logger" (func $get-logger))
)
(core module $module-indirect (;1;)
(type (;0;) (func (param i32 i32 i32)))
(type (;1;) (func (result i32)))
(type (;2;) (func (param i32)))
(export "logger.log" (func $logger-log))
(export "[dtor]logger" (func $dtor-logger))
(func $logger-log (;0;) (type 0) (param i32 i32 i32)
unreachable
)
Expand All @@ -74,8 +76,6 @@
(func $dtor-logger (;2;) (type 2) (param i32)
unreachable
)
(export "logger.log" (func $logger-log))
(export "[dtor]logger" (func $dtor-logger))
)
(core instance $module-indirect-instance (;0;) (instantiate $module-indirect))
(alias export $import-logging-instance "logger" (type $import-logger-type (;1;)))
Expand Down
32 changes: 16 additions & 16 deletions crates/wasm-compose/tests/compositions/defs/composed.wat
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,22 @@
(type (;1;) (func (param i32 i32 i32 i32) (result i32)))
(import "wasi:cli-base/environment" "get-environment" (func (;0;) (type 0)))
(import "wasi:cli-base/environment" "get-arguments" (func (;1;) (type 0)))
(func (;2;) (type 1) (param i32 i32 i32 i32) (result i32)
unreachable
)
(memory (;0;) 0)
(export "memory" (memory 0))
(export "cabi_realloc" (func 2))
(func (;2;) (type 1) (param i32 i32 i32 i32) (result i32)
unreachable
)
(@producers
(processed-by "wit-component" "0.11.0")
)
)
(core module (;1;)
(type (;0;) (func (param i32)))
(table (;0;) 2 2 funcref)
(export "0" (func $indirect-wasi:cli-base/environment-get-environment))
(export "1" (func $indirect-wasi:cli-base/environment-get-arguments))
(export "$imports" (table 0))
(func $indirect-wasi:cli-base/environment-get-environment (;0;) (type 0) (param i32)
local.get 0
i32.const 0
Expand All @@ -47,10 +51,6 @@
i32.const 1
call_indirect (type 0)
)
(table (;0;) 2 2 funcref)
(export "0" (func $indirect-wasi:cli-base/environment-get-environment))
(export "1" (func $indirect-wasi:cli-base/environment-get-arguments))
(export "$imports" (table 0))
(@producers
(processed-by "wit-component" "0.11.0")
)
Expand Down Expand Up @@ -107,6 +107,15 @@
(type (;6;) (func (param i32) (result i32)))
(type (;7;) (func (param i32 i32)))
(type (;8;) (func (param i32 i32 i32) (result i32)))
(table (;0;) 1 1 funcref)
(memory (;0;) 17)
(global $__stack_pointer (;0;) (mut i32) i32.const 1048576)
(export "memory" (memory 0))
(export "wasi:cli-base/environment#get-environment" (func $wasi:cli-base/environment#get-environment))
(export "cabi_post_wasi:cli-base/environment#get-environment" (func $cabi_post_wasi:cli-base/environment#get-environment))
(export "wasi:cli-base/environment#get-arguments" (func $wasi:cli-base/environment#get-arguments))
(export "cabi_post_wasi:cli-base/environment#get-arguments" (func $cabi_post_wasi:cli-base/environment#get-arguments))
(export "cabi_realloc" (func $cabi_realloc))
(func $__wasm_call_ctors (;0;) (type 0))
(func $wasi:cli-base/environment#get-environment (;1;) (type 1) (result i32)
i32.const 0
Expand All @@ -119,15 +128,6 @@
(func $cabi_realloc (;5;) (type 5) (param i32 i32 i32 i32) (result i32)
i32.const 0
)
(table (;0;) 1 1 funcref)
(memory (;0;) 17)
(global $__stack_pointer (;0;) (mut i32) i32.const 1048576)
(export "memory" (memory 0))
(export "wasi:cli-base/environment#get-environment" (func $wasi:cli-base/environment#get-environment))
(export "cabi_post_wasi:cli-base/environment#get-environment" (func $cabi_post_wasi:cli-base/environment#get-environment))
(export "wasi:cli-base/environment#get-arguments" (func $wasi:cli-base/environment#get-arguments))
(export "cabi_post_wasi:cli-base/environment#get-arguments" (func $cabi_post_wasi:cli-base/environment#get-arguments))
(export "cabi_realloc" (func $cabi_realloc))
)
(core instance (;0;) (instantiate 0))
(alias core export 0 "memory" (core memory (;0;)))
Expand Down
Loading