diff --git a/test/README.md b/test/README.md index 3b730c40..90e57a37 100644 --- a/test/README.md +++ b/test/README.md @@ -6,16 +6,16 @@ This directory contains Component Model reference tests, grouped by functionalit A single `.wast` test can be run with full backtrace on trap via: ``` -WASMTIME_BACKTRACE_DETAILS=1 wasmtime wast -W component-model-more-async-builtins -W component-model-threading -W component-model-async-stackful -W component-model-implements the-test.wast +WASMTIME_BACKTRACE_DETAILS=1 WAST_STRICT_COMPONENT_INDICES=1 wasmtime wast -W component-model-more-async-builtins -W component-model-threading -W component-model-async-stackful -W component-model-implements the-test.wast ``` All the tests can be run from this directory via: ``` -find . -name "*.wast" | xargs wasmtime wast -W component-model-more-async-builtins -W component-model-threading -W component-model-async-stackful -W component-model-implements +find . -name "*.wast" | WAST_STRICT_COMPONENT_INDICES=1 xargs wasmtime wast -W component-model-more-async-builtins -W component-model-threading -W component-model-async-stackful -W component-model-implements ``` Sometimes tests are landed ahead of the implementation and fail for a while. These tests are listed in 'nyi.txt' and can be filtered out via: ``` -find . -name "*.wast" | grep -vxFf nyi.txt | xargs wasmtime wast -W component-model-more-async-builtins -W component-model-threading -W component-model-async-stackful -W component-model-implements +find . -name "*.wast" | grep -vxFf nyi.txt | WAST_STRICT_COMPONENT_INDICES=1 xargs wasmtime wast -W component-model-more-async-builtins -W component-model-threading -W component-model-async-stackful -W component-model-implements ``` diff --git a/test/async/async-calls-sync.wast b/test/async/async-calls-sync.wast index 5172bb40..8263e061 100644 --- a/test/async/async-calls-sync.wast +++ b/test/async/async-calls-sync.wast @@ -55,11 +55,11 @@ )))) (func (export "blocking-call") async (result u32) (canon lift (core func $core_async_inner "blocking-call") - async (callback (func $core_async_inner "blocking-call-cb")) + async (callback (core func $core_async_inner "blocking-call-cb")) )) (func (export "unblock") async (canon lift (core func $core_async_inner "unblock") - async (callback (func $core_async_inner "unblock-cb")) + async (callback (core func $core_async_inner "unblock-cb")) )) ) @@ -101,7 +101,7 @@ )))) (func (export "sync-func") async (result u32) (canon lift (core func $core_sync_middle "sync-func") - async (callback (func $core_sync_middle "sync-func-cb")) + async (callback (core func $core_sync_middle "sync-func-cb")) )) ) @@ -199,8 +199,8 @@ (canon waitable.join (core func $waitable.join)) (canon waitable-set.new (core func $waitable-set.new)) (canon lower (func $unblock) (core func $unblock)) - (canon lower (func $sync-func1) async (memory $memory "mem") (core func $sync-func1')) - (canon lower (func $sync-func2) async (memory $memory "mem") (core func $sync-func2')) + (canon lower (func $sync-func1) async (memory (core memory $memory "mem")) (core func $sync-func1')) + (canon lower (func $sync-func2) async (memory (core memory $memory "mem")) (core func $sync-func2')) (core instance $em (instantiate $CoreAsyncOuter (with "" (instance (export "mem" (memory $memory "mem")) (export "task.return" (func $task.return)) @@ -213,7 +213,7 @@ )))) (func (export "run") async (result u32) (canon lift (core func $em "run") - async (callback (func $em "run-cb")) + async (callback (core func $em "run-cb")) )) ) diff --git a/test/async/big-interleaving-test.wast b/test/async/big-interleaving-test.wast index aa0d7c82..d6c18bdf 100644 --- a/test/async/big-interleaving-test.wast +++ b/test/async/big-interleaving-test.wast @@ -111,9 +111,9 @@ (canon waitable.join (core func $waitable.join)) (canon waitable-set.new (core func $waitable-set.new)) (canon waitable-set.drop (core func $waitable-set.drop)) - (canon stream.read $ST async (memory $memory "mem") (core func $stream.read)) + (canon stream.read $ST async (memory (core memory $memory "mem")) (core func $stream.read)) (canon stream.drop-readable $ST (core func $stream.drop-readable)) - (canon future.read $FT async (memory $memory "mem") (core func $future.read)) + (canon future.read $FT async (memory (core memory $memory "mem")) (core func $future.read)) (canon future.drop-readable $FT (core func $future.drop-readable)) (core instance $mm (instantiate $MM (with "" (instance (export "mem" (memory $memory "mem")) @@ -131,13 +131,13 @@ (export "future.read" (func $future.read)) (export "future.drop-readable" (func $future.drop-readable)))))) (func (export "sink") async (param "in" (stream u8)) (canon lift - (core func $mm "sink") async (memory $memory "mem") (callback (func $mm "sink_cb")))) + (core func $mm "sink") async (memory (core memory $memory "mem")) (callback (core func $mm "sink_cb")))) (func (export "sink-future") async (param "in" (future u8)) (canon lift - (core func $mm "sink-future") async (memory $memory "mem") (callback (func $mm "sink-future_cb")))) + (core func $mm "sink-future") async (memory (core memory $memory "mem")) (callback (core func $mm "sink-future_cb")))) (func (export "block-empty") async (canon lift - (core func $mm "block-empty") async (memory $memory "mem") (callback (func $mm "block-empty_cb")))) + (core func $mm "block-empty") async (memory (core memory $memory "mem")) (callback (core func $mm "block-empty_cb")))) (func (export "block-future") async (param "in" (future u8)) (canon lift - (core func $mm "block-future") async (memory $memory "mem") (callback (func $mm "block-future_cb")))) + (core func $mm "block-future") async (memory (core memory $memory "mem")) (callback (core func $mm "block-future_cb")))) (func (export "bp-inc") (canon lift (core func $mm "bp-inc"))) (func (export "bp-dec") (canon lift (core func $mm "bp-dec"))) ) @@ -342,15 +342,15 @@ (type $ST (stream u8)) (type $FT (future u8)) (canon stream.new $ST (core func $stream.new)) - (canon stream.read $ST async (memory $memory "mem") (core func $stream.read)) - (canon stream.write $ST async (memory $memory "mem") (core func $stream.write)) + (canon stream.read $ST async (memory (core memory $memory "mem")) (core func $stream.read)) + (canon stream.write $ST async (memory (core memory $memory "mem")) (core func $stream.write)) (canon stream.cancel-read $ST async (core func $stream.cancel-read)) (canon stream.cancel-write $ST async (core func $stream.cancel-write)) (canon stream.drop-readable $ST (core func $stream.drop-readable)) (canon stream.drop-writable $ST (core func $stream.drop-writable)) (canon future.new $FT (core func $future.new)) - (canon future.read $FT async (memory $memory "mem") (core func $future.read)) - (canon future.write $FT async (memory $memory "mem") (core func $future.write)) + (canon future.read $FT async (memory (core memory $memory "mem")) (core func $future.read)) + (canon future.write $FT async (memory (core memory $memory "mem")) (core func $future.write)) (canon future.cancel-read $FT async (core func $future.cancel-read)) (canon future.cancel-write $FT async (core func $future.cancel-write)) (canon future.drop-readable $FT (core func $future.drop-readable)) @@ -358,15 +358,15 @@ (canon task.return (core func $task.return)) (canon waitable.join (core func $waitable.join)) (canon waitable-set.new (core func $waitable-set.new)) - (canon waitable-set.poll (memory $memory "mem") (core func $waitable-set.poll)) - (canon waitable-set.wait (memory $memory "mem") (core func $waitable-set.wait)) + (canon waitable-set.poll (memory (core memory $memory "mem")) (core func $waitable-set.poll)) + (canon waitable-set.wait (memory (core memory $memory "mem")) (core func $waitable-set.wait)) (canon waitable-set.drop (core func $waitable-set.drop)) (canon subtask.cancel async (core func $subtask.cancel)) (canon subtask.drop (core func $subtask.drop)) - (canon lower (func $sink) async (memory $memory "mem") (core func $sink')) - (canon lower (func $sink-future) async (memory $memory "mem") (core func $sink-future')) - (canon lower (func $block-empty) async (memory $memory "mem") (core func $block-empty')) - (canon lower (func $block-future) async (memory $memory "mem") (core func $block-future')) + (canon lower (func $sink) async (memory (core memory $memory "mem")) (core func $sink')) + (canon lower (func $sink-future) async (memory (core memory $memory "mem")) (core func $sink-future')) + (canon lower (func $block-empty) async (memory (core memory $memory "mem")) (core func $block-empty')) + (canon lower (func $block-future) async (memory (core memory $memory "mem")) (core func $block-future')) (canon lower (func $bp-inc) (core func $bp-inc')) (canon lower (func $bp-dec) (core func $bp-dec')) (core instance $tm (instantiate $TM (with "" (instance @@ -401,7 +401,7 @@ (export "waitable-set.drop" (func $waitable-set.drop)))))) (func (export "poll-readable") (param "slot" u8) (param "event" u8) (param "payload" u32) (canon lift (core func $tm "poll-readable"))) (func (export "await-readable") async (param "slot" u8) (param "event" u8) (param "payload" u32) (canon lift - (core func $tm "await-readable") async (memory $memory "mem"))) + (core func $tm "await-readable") async (memory (core memory $memory "mem")))) (func (export "call-import") (param "slot" u8) (result s32) (canon lift (core func $tm "call-import"))) (func (export "call-import-future") (param "slot" u8) (result s32) (canon lift (core func $tm "call-import-future"))) (func (export "call-block-empty") (param "sub" u8) (result s32) (canon lift (core func $tm "call-block-empty"))) @@ -411,7 +411,7 @@ (func (export "mock-bp-inc") (canon lift (core func $tm "mock-bp-inc"))) (func (export "mock-bp-dec") (canon lift (core func $tm "mock-bp-dec"))) (func (export "await-subtask") async (param "sub" u8) (param "state" u8) (canon lift - (core func $tm "await-subtask") async (memory $memory "mem"))) + (core func $tm "await-subtask") async (memory (core memory $memory "mem")))) (func (export "stream-new") (param "slot" u8) (canon lift (core func $tm "stream-new"))) (func (export "testee-write") (param "handle" u8) (param "bytes" u32) (result s32) (canon lift (core func $tm "testee-write"))) (func (export "testee-read") (param "handle" u8) (param "bytes" u32) (result s32) (canon lift (core func $tm "testee-read"))) @@ -428,7 +428,7 @@ (func (export "drop-writable") (param "slot" u8) (canon lift (core func $tm "drop-writable"))) (func (export "poll") (param "slot" u8) (param "event" u8) (param "payload" u32) (canon lift (core func $tm "poll"))) (func (export "await") async (param "slot" u8) (param "event" u8) (param "payload" u32) (canon lift - (core func $tm "await") async (memory $memory "mem"))) + (core func $tm "await") async (memory (core memory $memory "mem")))) ) (component $Driver @@ -770,7 +770,7 @@ (export "mock-bp-inc" (func $mock-bp-inc')) (export "mock-bp-dec" (func $mock-bp-dec')))))) (func (export "run") (param "prog" (list $command-e)) - (canon lift (core func $dm "run") (memory $dm "mem") (realloc (func $dm "realloc"))))) + (canon lift (core func $dm "run") (memory (core memory $dm "mem")) (realloc (core func $dm "realloc"))))) (instance $mock (instantiate $Mock)) (instance $testee (instantiate $Testee diff --git a/test/async/builtin-trap-poisons-instance.wast b/test/async/builtin-trap-poisons-instance.wast index 67561eb3..88934351 100644 --- a/test/async/builtin-trap-poisons-instance.wast +++ b/test/async/builtin-trap-poisons-instance.wast @@ -25,7 +25,7 @@ ) (type $ST (stream u8)) (canon stream.new $ST (core func $stream.new)) - (canon stream.write $ST async (memory $memory "mem") (core func $stream.write)) + (canon stream.write $ST async (memory (core memory $memory "mem")) (core func $stream.write)) (canon stream.drop-writable $ST (core func $stream.drop-writable)) (core instance $m (instantiate $M (with "" (instance (export "mem" (memory $memory "mem")) diff --git a/test/async/cancel-stream.wast b/test/async/cancel-stream.wast index 336b5acb..0f12b6d9 100644 --- a/test/async/cancel-stream.wast +++ b/test/async/cancel-stream.wast @@ -70,7 +70,7 @@ (type $ST (stream u8)) (canon task.return (result u32) (core func $task.return)) (canon stream.new $ST (core func $stream.new)) - (canon stream.write $ST async (memory $memory "mem") (core func $stream.write)) + (canon stream.write $ST async (memory (core memory $memory "mem")) (core func $stream.write)) (canon stream.cancel-write $ST (core func $stream.cancel-write)) (canon stream.drop-writable $ST (core func $stream.drop-writable)) (core instance $cm (instantiate $CM (with "" (instance @@ -173,7 +173,7 @@ ) ) (type $ST (stream u8)) - (canon stream.read $ST async (memory $memory "mem") (core func $stream.read)) + (canon stream.read $ST async (memory (core memory $memory "mem")) (core func $stream.read)) (canon stream.cancel-read $ST (core func $stream.cancel-read)) (canon stream.drop-readable $ST (core func $stream.drop-readable)) (canon lower (func $c "start-stream") (core func $start-stream')) diff --git a/test/async/cancel-subtask.wast b/test/async/cancel-subtask.wast index 57a0f33e..e2f87b60 100644 --- a/test/async/cancel-subtask.wast +++ b/test/async/cancel-subtask.wast @@ -58,10 +58,10 @@ ) (type $FT (future)) (canon task.cancel (core func $task.cancel)) - (canon future.read $FT async (memory $memory "mem") (core func $future.read)) + (canon future.read $FT async (memory (core memory $memory "mem")) (core func $future.read)) (canon waitable.join (core func $waitable.join)) (canon waitable-set.new (core func $waitable-set.new)) - (canon waitable-set.wait (memory $memory "mem") (core func $waitable-set.wait)) + (canon waitable-set.wait (memory (core memory $memory "mem")) (core func $waitable-set.wait)) (core instance $cm (instantiate $CM (with "" (instance (export "mem" (memory $memory "mem")) (export "task.cancel" (func $task.cancel)) @@ -72,7 +72,7 @@ )))) (func (export "f") async (result u32) (canon lift (core func $cm "f") - async (callback (func $cm "f_cb")) + async (callback (core func $cm "f_cb")) )) (func (export "g") async (param "fut" $FT) (result u32) (canon lift (core func $cm "g") @@ -170,12 +170,12 @@ (canon subtask.cancel async (core func $subtask.cancel)) (canon subtask.drop (core func $subtask.drop)) (canon future.new $FT (core func $future.new)) - (canon future.write $FT async (memory $memory "mem") (core func $future.write)) + (canon future.write $FT async (memory (core memory $memory "mem")) (core func $future.write)) (canon waitable.join (core func $waitable.join)) (canon waitable-set.new (core func $waitable-set.new)) - (canon waitable-set.wait (memory $memory "mem") (core func $waitable-set.wait)) - (canon lower (func $f) async (memory $memory "mem") (core func $f')) - (canon lower (func $g) async (memory $memory "mem") (core func $g')) + (canon waitable-set.wait (memory (core memory $memory "mem")) (core func $waitable-set.wait)) + (canon lower (func $f) async (memory (core memory $memory "mem")) (core func $f')) + (canon lower (func $g) async (memory (core memory $memory "mem")) (core func $g')) (core instance $dm (instantiate $DM (with "" (instance (export "mem" (memory $memory "mem")) (export "subtask.cancel" (func $subtask.cancel)) diff --git a/test/async/cancellable.wast b/test/async/cancellable.wast index 2c5614cb..3de95290 100644 --- a/test/async/cancellable.wast +++ b/test/async/cancellable.wast @@ -102,12 +102,12 @@ ) (type $FT (future)) (canon task.cancel (core func $task.cancel)) - (canon future.read $FT async (memory $memory "mem") (core func $future.read)) + (canon future.read $FT async (memory (core memory $memory "mem")) (core func $future.read)) (canon waitable.join (core func $waitable.join)) (canon waitable-set.new (core func $waitable-set.new)) - (canon waitable-set.wait cancellable (memory $memory "mem") (core func $waitable-set.wait-cancellable)) - (canon waitable-set.wait (memory $memory "mem") (core func $waitable-set.wait)) - (canon waitable-set.poll cancellable (memory $memory "mem") (core func $waitable-set.poll-cancellable)) + (canon waitable-set.wait cancellable (memory (core memory $memory "mem")) (core func $waitable-set.wait-cancellable)) + (canon waitable-set.wait (memory (core memory $memory "mem")) (core func $waitable-set.wait)) + (canon waitable-set.poll cancellable (memory (core memory $memory "mem")) (core func $waitable-set.poll-cancellable)) (canon thread.yield cancellable (core func $thread.yield-cancellable)) (core instance $cm (instantiate $CM (with "" (instance (export "mem" (memory $memory "mem")) @@ -122,19 +122,19 @@ )))) (func (export "wait-cancel") async (result u32) (canon lift (core func $cm "wait-cancel") - async (callback (func $cm "unreachable-cb")) + async (callback (core func $cm "unreachable-cb")) )) (func (export "yield-cancel") async (result u32) (canon lift (core func $cm "yield-cancel") - async (callback (func $cm "unreachable-cb")) + async (callback (core func $cm "unreachable-cb")) )) (func (export "poll-cancel-pending") async (param "fut" $FT) (result u32) (canon lift (core func $cm "poll-cancel-pending") - async (callback (func $cm "unreachable-cb")) + async (callback (core func $cm "unreachable-cb")) )) (func (export "yield-cancel-pending") async (param "fut" $FT) (result u32) (canon lift (core func $cm "yield-cancel-pending") - async (callback (func $cm "unreachable-cb")) + async (callback (core func $cm "unreachable-cb")) )) ) @@ -288,14 +288,14 @@ (canon subtask.cancel async (core func $subtask.cancel)) (canon subtask.drop (core func $subtask.drop)) (canon future.new $FT (core func $future.new)) - (canon future.write $FT async (memory $memory "mem") (core func $future.write)) + (canon future.write $FT async (memory (core memory $memory "mem")) (core func $future.write)) (canon waitable.join (core func $waitable.join)) (canon waitable-set.new (core func $waitable-set.new)) - (canon waitable-set.wait (memory $memory "mem") (core func $waitable-set.wait)) - (canon lower (func $wait-cancel) async (memory $memory "mem") (core func $wait-cancel')) - (canon lower (func $yield-cancel) async (memory $memory "mem") (core func $yield-cancel')) - (canon lower (func $poll-cancel-pending) async (memory $memory "mem") (core func $poll-cancel-pending')) - (canon lower (func $yield-cancel-pending) async (memory $memory "mem") (core func $yield-cancel-pending')) + (canon waitable-set.wait (memory (core memory $memory "mem")) (core func $waitable-set.wait)) + (canon lower (func $wait-cancel) async (memory (core memory $memory "mem")) (core func $wait-cancel')) + (canon lower (func $yield-cancel) async (memory (core memory $memory "mem")) (core func $yield-cancel')) + (canon lower (func $poll-cancel-pending) async (memory (core memory $memory "mem")) (core func $poll-cancel-pending')) + (canon lower (func $yield-cancel-pending) async (memory (core memory $memory "mem")) (core func $yield-cancel-pending')) (core instance $dm (instantiate $DM (with "" (instance (export "mem" (memory $memory "mem")) (export "subtask.cancel" (func $subtask.cancel)) diff --git a/test/async/closed-stream.wast b/test/async/closed-stream.wast index eb462c85..071a05b9 100644 --- a/test/async/closed-stream.wast +++ b/test/async/closed-stream.wast @@ -30,7 +30,7 @@ ) (type $ST (stream u8)) (canon stream.new $ST (core func $stream.new)) - (canon stream.write $ST async (memory $memory "mem") (core func $stream.write)) + (canon stream.write $ST async (memory (core memory $memory "mem")) (core func $stream.write)) (canon stream.drop-writable $ST (core func $stream.drop-writable)) (core instance $cm (instantiate $CM (with "" (instance (export "mem" (memory $memory "mem")) @@ -77,8 +77,8 @@ ) (type $ST (stream u8)) (canon stream.new $ST (core func $stream.new)) - (canon stream.read $ST async (memory $memory "mem") (core func $stream.read)) - (canon stream.write $ST async (memory $memory "mem") (core func $stream.write)) + (canon stream.read $ST async (memory (core memory $memory "mem")) (core func $stream.read)) + (canon stream.write $ST async (memory (core memory $memory "mem")) (core func $stream.write)) (canon stream.drop-writable $ST (core func $stream.drop-writable)) (canon lower (func $c "start-stream") (core func $start-stream')) (canon lower (func $c "drop-writable") (core func $drop-writable')) diff --git a/test/async/cross-abi-calls.wast b/test/async/cross-abi-calls.wast index 8f1370b2..df164a51 100644 --- a/test/async/cross-abi-calls.wast +++ b/test/async/cross-abi-calls.wast @@ -167,7 +167,7 @@ (canon task.return (core func $task.return0)) (canon task.return (result f64) (core func $task.return1)) (canon task.return (result (tuple u32 u64 f32 f64 u32 u64 f32 f64 u32 u64 f32 f64 u32 u64 f32 f64)) (core func $task.return16)) - (canon task.return (result (tuple u32 u64 f32 f64 u32 u64 f32 f64 u32 u64 f32 f64 u32 u64 f32 f64 u32)) (memory $memory "mem") (core func $task.return17)) + (canon task.return (result (tuple u32 u64 f32 f64 u32 u64 f32 f64 u32 u64 f32 f64 u32 u64 f32 f64 u32)) (memory (core memory $memory "mem")) (core func $task.return17)) (core instance $core (instantiate $Core (with "" (instance (export "mem" (memory $memory "mem")) (export "task.return0" (func $task.return0)) @@ -187,24 +187,24 @@ (param "i" u32) (param "j" u64) (param "k" f32) (param "l" f64) (param "m" u32) (param "n" u64) (param "o" f32) (param "p" f64) (param "q" u32) - (canon lift (core func $core "sync-17-param") (memory $memory "mem") (realloc (func $memory "realloc"))) + (canon lift (core func $core "sync-17-param") (memory (core memory $memory "mem")) (realloc (core func $memory "realloc"))) ) (func (export "sync-1-result") async (result f64) (canon lift (core func $core "sync-1-result")) ) (func (export "sync-16-result") async (result (tuple u32 u64 f32 f64 u32 u64 f32 f64 u32 u64 f32 f64 u32 u64 f32 f64)) - (canon lift (core func $core "sync-16-result") (memory $memory "mem")) + (canon lift (core func $core "sync-16-result") (memory (core memory $memory "mem"))) ) (func (export "sync-17-result") async (result (tuple u32 u64 f32 f64 u32 u64 f32 f64 u32 u64 f32 f64 u32 u64 f32 f64 u32)) - (canon lift (core func $core "sync-17-result") (memory $memory "mem")) + (canon lift (core func $core "sync-17-result") (memory (core memory $memory "mem"))) ) (func (export "async-4-param") async (param "a" u32) (param "b" u64) (param "c" f32) (param "d" f64) - (canon lift (core func $core "async-4-param") async (callback (func $core "unreachable-cb"))) + (canon lift (core func $core "async-4-param") async (callback (core func $core "unreachable-cb"))) ) (func (export "async-5-param") async (param "a" u32) (param "b" u64) (param "c" f32) (param "d" f64) (param "e" u32) - (canon lift (core func $core "async-5-param") async (callback (func $core "unreachable-cb"))) + (canon lift (core func $core "async-5-param") async (callback (core func $core "unreachable-cb"))) ) (func (export "async-17-param") async (param "a" u32) (param "b" u64) (param "c" f32) (param "d" f64) @@ -212,16 +212,16 @@ (param "i" u32) (param "j" u64) (param "k" f32) (param "l" f64) (param "m" u32) (param "n" u64) (param "o" f32) (param "p" f64) (param "q" u32) - (canon lift (core func $core "async-17-param") async (callback (func $core "unreachable-cb")) (memory $memory "mem") (realloc (func $memory "realloc"))) + (canon lift (core func $core "async-17-param") async (callback (core func $core "unreachable-cb")) (memory (core memory $memory "mem")) (realloc (core func $memory "realloc"))) ) (func (export "async-1-result") async (result f64) - (canon lift (core func $core "async-1-result") async (callback (func $core "unreachable-cb"))) + (canon lift (core func $core "async-1-result") async (callback (core func $core "unreachable-cb"))) ) (func (export "async-16-result") async (result (tuple u32 u64 f32 f64 u32 u64 f32 f64 u32 u64 f32 f64 u32 u64 f32 f64)) - (canon lift (core func $core "async-16-result") async (callback (func $core "unreachable-cb"))) + (canon lift (core func $core "async-16-result") async (callback (core func $core "unreachable-cb"))) ) (func (export "async-17-result") async (result (tuple u32 u64 f32 f64 u32 u64 f32 f64 u32 u64 f32 f64 u32 u64 f32 f64 u32)) - (canon lift (core func $core "async-17-result") async (callback (func $core "unreachable-cb")) (memory $memory "mem") (realloc (func $memory "realloc"))) + (canon lift (core func $core "async-17-result") async (callback (core func $core "unreachable-cb")) (memory (core memory $memory "mem")) (realloc (core func $memory "realloc"))) ) ) (component $Bottom @@ -387,17 +387,17 @@ ) ) (canon lower (func $func-4-param) (core func $sync-4-param)) - (canon lower (func $func-4-param) async (memory $memory "mem") (core func $async-4-param)) + (canon lower (func $func-4-param) async (memory (core memory $memory "mem")) (core func $async-4-param)) (canon lower (func $func-5-param) (core func $sync-5-param)) - (canon lower (func $func-5-param) async (memory $memory "mem") (core func $async-5-param)) - (canon lower (func $func-17-param) (memory $memory "mem") (core func $sync-17-param)) - (canon lower (func $func-17-param) async (memory $memory "mem") (core func $async-17-param)) + (canon lower (func $func-5-param) async (memory (core memory $memory "mem")) (core func $async-5-param)) + (canon lower (func $func-17-param) (memory (core memory $memory "mem")) (core func $sync-17-param)) + (canon lower (func $func-17-param) async (memory (core memory $memory "mem")) (core func $async-17-param)) (canon lower (func $func-1-result) (core func $sync-1-result)) - (canon lower (func $func-1-result) async (memory $memory "mem") (core func $async-1-result)) - (canon lower (func $func-16-result) (memory $memory "mem") (core func $sync-16-result)) - (canon lower (func $func-16-result) async (memory $memory "mem") (core func $async-16-result)) - (canon lower (func $func-17-result) (memory $memory "mem") (core func $sync-17-result)) - (canon lower (func $func-17-result) async (memory $memory "mem") (core func $async-17-result)) + (canon lower (func $func-1-result) async (memory (core memory $memory "mem")) (core func $async-1-result)) + (canon lower (func $func-16-result) (memory (core memory $memory "mem")) (core func $sync-16-result)) + (canon lower (func $func-16-result) async (memory (core memory $memory "mem")) (core func $async-16-result)) + (canon lower (func $func-17-result) (memory (core memory $memory "mem")) (core func $sync-17-result)) + (canon lower (func $func-17-result) async (memory (core memory $memory "mem")) (core func $async-17-result)) (core instance $core (instantiate $Core (with "" (instance (export "mem" (memory $memory "mem")) (export "sync-4-param" (func $sync-4-param)) diff --git a/test/async/cross-task-future.wast b/test/async/cross-task-future.wast index 7f76b6e5..97849635 100644 --- a/test/async/cross-task-future.wast +++ b/test/async/cross-task-future.wast @@ -35,7 +35,7 @@ (type $FT (future u8)) (canon task.return (result $FT) (core func $task.return)) (canon future.new $FT (core func $future.new)) - (canon future.write $FT async (memory $memory "mem") (core func $future.write)) + (canon future.write $FT async (memory (core memory $memory "mem")) (core func $future.write)) (core instance $cm (instantiate $CM (with "" (instance (export "mem" (memory $memory "mem")) (export "task.return" (func $task.return)) @@ -47,7 +47,7 @@ )) (func (export "two") async (result (future u8)) (canon lift (core func $cm "two") - async (callback (func $cm "two_cb")) + async (callback (core func $cm "two_cb")) )) ) @@ -83,7 +83,7 @@ ) ) (type $FT (future u8)) - (canon future.read $FT async (memory $memory "mem") (core func $future.read)) + (canon future.read $FT async (memory (core memory $memory "mem")) (core func $future.read)) (canon lower (func $c "one") (core func $one')) (canon lower (func $c "two") (core func $two')) (core instance $dm (instantiate $DM (with "" (instance diff --git a/test/async/deadlock.wast b/test/async/deadlock.wast index 6d50c9f2..7b8ad925 100644 --- a/test/async/deadlock.wast +++ b/test/async/deadlock.wast @@ -26,7 +26,7 @@ )))) (func (export "f") async (result u32) (canon lift (core func $cm "f") - async (memory $memory "mem") (callback (func $cm "cb")) + async (memory (core memory $memory "mem")) (callback (core func $cm "cb")) )) ) @@ -54,8 +54,8 @@ ) (canon waitable.join (core func $waitable.join)) (canon waitable-set.new (core func $waitable-set.new)) - (canon waitable-set.wait (memory $memory "mem") (core func $waitable-set.wait)) - (canon lower (func $f) async (memory $memory "mem") (core func $f')) + (canon waitable-set.wait (memory (core memory $memory "mem")) (core func $waitable-set.wait)) + (canon lower (func $f) async (memory (core memory $memory "mem")) (core func $f')) (core instance $dm (instantiate $DM (with "" (instance (export "mem" (memory $memory "mem")) (export "waitable.join" (func $waitable.join)) diff --git a/test/async/dont-block-start.wast b/test/async/dont-block-start.wast index 5fab77f3..12f137f3 100644 --- a/test/async/dont-block-start.wast +++ b/test/async/dont-block-start.wast @@ -13,7 +13,7 @@ (start $start) ) (canon waitable-set.new (core func $waitable-set.new)) - (canon waitable-set.wait (memory $memory "mem") (core func $waitable-set.wait)) + (canon waitable-set.wait (memory (core memory $memory "mem")) (core func $waitable-set.wait)) (core instance $m (instantiate $M (with "" (instance (export "waitable-set.new" (func $waitable-set.new)) (export "waitable-set.wait" (func $waitable-set.wait)) @@ -29,7 +29,7 @@ (func (export "f_cb") (param i32 i32 i32) (result i32) unreachable) ) (core instance $i (instantiate $M)) - (func (export "f") async (canon lift (core func $i "f") async (callback (func $i "f_cb")))) + (func (export "f") async (canon lift (core func $i "f") async (callback (core func $i "f_cb")))) ) (component $D (import "f" (func $f async)) diff --git a/test/async/drop-cross-task-borrow.wast b/test/async/drop-cross-task-borrow.wast index 139981cd..4cc46459 100644 --- a/test/async/drop-cross-task-borrow.wast +++ b/test/async/drop-cross-task-borrow.wast @@ -117,7 +117,7 @@ (export "R-drop" (func $R-drop)) )))) (func (export "dont-drop") async (param "self" (borrow $R)) (result u32) - (canon lift (core func $dm "dont-drop") async (callback (func $dm "dont-drop-cb"))) + (canon lift (core func $dm "dont-drop") async (callback (core func $dm "dont-drop-cb"))) ) (func (export "drop-handle") (result u32) (canon lift (core func $dm "drop-handle")) @@ -126,10 +126,10 @@ (canon lift (core func $dm "resume-dont-drop")) ) (func (export "drop-other-and-self") async (param "self" (borrow $R)) (result u32) - (canon lift (core func $dm "drop-other-and-self") async (callback (func $dm "unreachable-cb"))) + (canon lift (core func $dm "drop-other-and-self") async (callback (core func $dm "unreachable-cb"))) ) (func (export "drop-wrong-one") async (param "self" (borrow $R)) - (canon lift (core func $dm "drop-wrong-one") async (callback (func $dm "unreachable-cb"))) + (canon lift (core func $dm "drop-wrong-one") async (callback (core func $dm "unreachable-cb"))) ) ) @@ -270,9 +270,9 @@ ) (canon waitable.join (core func $waitable.join)) (canon waitable-set.new (core func $waitable-set.new)) - (canon waitable-set.wait (memory $memory "mem") (core func $waitable-set.wait)) + (canon waitable-set.wait (memory (core memory $memory "mem")) (core func $waitable-set.wait)) (canon lower (func $c "R-new") (core func $R-new)) - (canon lower (func $d "dont-drop") async (memory $memory "mem") (core func $dont-drop)) + (canon lower (func $d "dont-drop") async (memory (core memory $memory "mem")) (core func $dont-drop)) (canon lower (func $d "drop-handle") (core func $drop-handle)) (canon lower (func $d "resume-dont-drop") (core func $resume-dont-drop)) (canon lower (func $d "drop-other-and-self") (core func $drop-other-and-self)) diff --git a/test/async/drop-stream.wast b/test/async/drop-stream.wast index bf7212f2..29b35877 100644 --- a/test/async/drop-stream.wast +++ b/test/async/drop-stream.wast @@ -49,7 +49,7 @@ ) (type $ST (stream u8)) (canon stream.new $ST (core func $stream.new)) - (canon stream.write $ST async (memory $memory "mem") (core func $stream.write)) + (canon stream.write $ST async (memory (core memory $memory "mem")) (core func $stream.write)) (canon stream.drop-writable $ST (core func $stream.drop-writable)) (core instance $cm (instantiate $CM (with "" (instance (export "mem" (memory $memory "mem")) @@ -126,8 +126,8 @@ ) (type $ST (stream u8)) (canon stream.new $ST (core func $stream.new)) - (canon stream.read $ST async (memory $memory "mem") (core func $stream.read)) - (canon stream.write $ST async (memory $memory "mem") (core func $stream.write)) + (canon stream.read $ST async (memory (core memory $memory "mem")) (core func $stream.read)) + (canon stream.write $ST async (memory (core memory $memory "mem")) (core func $stream.write)) (canon stream.drop-readable $ST (core func $stream.drop-readable)) (canon stream.drop-writable $ST (core func $stream.drop-writable)) (canon lower (func $c "start-stream") (core func $start-stream')) diff --git a/test/async/drop-subtask.wast b/test/async/drop-subtask.wast index 21eb9fcd..300d83b8 100644 --- a/test/async/drop-subtask.wast +++ b/test/async/drop-subtask.wast @@ -41,7 +41,7 @@ )))) (func (export "loop") async (canon lift (core func $core_looper "loop") - async (callback (func $core_looper "loop_cb")) + async (callback (core func $core_looper "loop_cb")) )) (func (export "return") async (canon lift (core func $core_looper "return") @@ -110,9 +110,9 @@ (canon subtask.drop (core func $subtask.drop)) (canon waitable.join (core func $waitable.join)) (canon waitable-set.new (core func $waitable-set.new)) - (canon waitable-set.wait (memory $memory "mem") (core func $waitable-set.wait)) - (canon lower (func $looper "loop") async (memory $memory "mem") (core func $loop')) - (canon lower (func $looper "return") (memory $memory "mem") (core func $return')) + (canon waitable-set.wait (memory (core memory $memory "mem")) (core func $waitable-set.wait)) + (canon lower (func $looper "loop") async (memory (core memory $memory "mem")) (core func $loop')) + (canon lower (func $looper "return") (memory (core memory $memory "mem")) (core func $return')) (core instance $core_caller (instantiate $CoreCaller (with "" (instance (export "mem" (memory $memory "mem")) (export "subtask.drop" (func $subtask.drop)) diff --git a/test/async/drop-waitable-set.wast b/test/async/drop-waitable-set.wast index 23fff15b..49fd32f4 100644 --- a/test/async/drop-waitable-set.wast +++ b/test/async/drop-waitable-set.wast @@ -33,11 +33,11 @@ )))) (func (export "wait-on-set") async (canon lift (core func $core "wait-on-set") - async (callback (func $core "unreachable-cb")) + async (callback (core func $core "unreachable-cb")) )) (func (export "drop-while-waiting") async (canon lift (core func $core "drop-while-waiting") - async (callback (func $core "unreachable-cb")) + async (callback (core func $core "unreachable-cb")) )) ) @@ -67,7 +67,7 @@ unreachable ) ) - (canon lower (func $c "wait-on-set") async (memory $memory "mem") (core func $wait-on-set')) + (canon lower (func $c "wait-on-set") async (memory (core memory $memory "mem")) (core func $wait-on-set')) (canon lower (func $c "drop-while-waiting") (core func $drop-while-waiting')) (core instance $core (instantiate $Core (with "" (instance (export "mem" (memory $memory "mem")) diff --git a/test/async/empty-wait.wast b/test/async/empty-wait.wast index 8b4d789f..5534020b 100644 --- a/test/async/empty-wait.wast +++ b/test/async/empty-wait.wast @@ -104,11 +104,11 @@ )))) (func (export "blocker") async (result u32) (canon lift (core func $cm "blocker") - async (callback (func $cm "blocker_cb")) + async (callback (core func $cm "blocker_cb")) )) (func (export "unblocker") async (result u32) (canon lift (core func $cm "unblocker") - async (callback (func $cm "unblocker_cb")) + async (callback (core func $cm "unblocker_cb")) )) ) @@ -176,10 +176,10 @@ ) (canon waitable.join (core func $waitable.join)) (canon waitable-set.new (core func $waitable-set.new)) - (canon waitable-set.wait (memory $memory "mem") (core func $waitable-set.wait)) + (canon waitable-set.wait (memory (core memory $memory "mem")) (core func $waitable-set.wait)) (canon subtask.drop (core func $subtask.drop)) - (canon lower (func $c "blocker") async (memory $memory "mem") (core func $blocker')) - (canon lower (func $c "unblocker") async (memory $memory "mem") (core func $unblocker')) + (canon lower (func $c "blocker") async (memory (core memory $memory "mem")) (core func $blocker')) + (canon lower (func $c "unblocker") async (memory (core memory $memory "mem")) (core func $unblocker')) (core instance $dm (instantiate $DM (with "" (instance (export "mem" (memory $memory "mem")) (export "waitable.join" (func $waitable.join)) diff --git a/test/async/futures-must-write.wast b/test/async/futures-must-write.wast index ce2446b3..53e04aac 100644 --- a/test/async/futures-must-write.wast +++ b/test/async/futures-must-write.wast @@ -39,7 +39,7 @@ ) (type $FT (future u8)) (canon future.new $FT (core func $future.new)) - (canon future.write $FT async (memory $memory "mem") (core func $future.write)) + (canon future.write $FT async (memory (core memory $memory "mem")) (core func $future.write)) (canon future.drop-writable $FT (core func $future.drop-writable)) (core instance $cm (instantiate $CM (with "" (instance (export "mem" (memory $memory "mem")) diff --git a/test/async/partial-stream-copies.wast b/test/async/partial-stream-copies.wast index d70ece2e..f1760dd0 100644 --- a/test/async/partial-stream-copies.wast +++ b/test/async/partial-stream-copies.wast @@ -102,12 +102,12 @@ ) ) (type $ST (stream u8)) - (canon task.return (result $ST) (memory $memory "mem") (core func $task.return)) + (canon task.return (result $ST) (memory (core memory $memory "mem")) (core func $task.return)) (canon waitable.join (core func $waitable.join)) (canon waitable-set.new (core func $waitable-set.new)) (canon stream.new $ST (core func $stream.new)) - (canon stream.read $ST async (memory $memory "mem") (core func $stream.read)) - (canon stream.write $ST async (memory $memory "mem") (core func $stream.write)) + (canon stream.read $ST async (memory (core memory $memory "mem")) (core func $stream.read)) + (canon stream.write $ST async (memory (core memory $memory "mem")) (core func $stream.write)) (canon stream.drop-readable $ST (core func $stream.drop-readable)) (canon stream.drop-writable $ST (core func $stream.drop-writable)) (core instance $cm (instantiate $CM (with "" (instance @@ -123,7 +123,7 @@ )))) (func (export "transform") async (param "in" (stream u8)) (result (stream u8)) (canon lift (core func $cm "transform") - async (memory $memory "mem") (callback (func $cm "transform_cb")) + async (memory (core memory $memory "mem")) (callback (core func $cm "transform_cb")) )) ) @@ -209,13 +209,13 @@ (type $ST (stream u8)) (canon waitable.join (core func $waitable.join)) (canon waitable-set.new (core func $waitable-set.new)) - (canon waitable-set.wait (memory $memory "mem") (core func $waitable-set.wait)) + (canon waitable-set.wait (memory (core memory $memory "mem")) (core func $waitable-set.wait)) (canon stream.new $ST (core func $stream.new)) - (canon stream.read $ST async (memory $memory "mem") (core func $stream.read)) - (canon stream.write $ST async (memory $memory "mem") (core func $stream.write)) + (canon stream.read $ST async (memory (core memory $memory "mem")) (core func $stream.read)) + (canon stream.write $ST async (memory (core memory $memory "mem")) (core func $stream.write)) (canon stream.drop-readable $ST (core func $stream.drop-readable)) (canon stream.drop-writable $ST (core func $stream.drop-writable)) - (canon lower (func $transform) async (memory $memory "mem") (core func $transform')) + (canon lower (func $transform) async (memory (core memory $memory "mem")) (core func $transform')) (core instance $dm (instantiate $DM (with "" (instance (export "mem" (memory $memory "mem")) (export "waitable.join" (func $waitable.join)) diff --git a/test/async/passing-resources.wast b/test/async/passing-resources.wast index d8a7c501..3e99b853 100644 --- a/test/async/passing-resources.wast +++ b/test/async/passing-resources.wast @@ -78,7 +78,7 @@ (canon resource.new $R (core func $resource.new)) (canon resource.rep $R (core func $resource.rep)) (canon stream.new $ST (core func $stream.new)) - (canon stream.write $ST async (memory $memory "mem") (core func $stream.write)) + (canon stream.write $ST async (memory (core memory $memory "mem")) (core func $stream.write)) (canon stream.cancel-write $ST (core func $stream.cancel-write)) (canon stream.drop-writable $ST (core func $stream.drop-writable)) (core instance $core (instantiate $Core (with "" (instance @@ -149,7 +149,7 @@ ) (alias export $producer "R" (type $R)) (type $ST (stream (own $R))) - (canon stream.read $ST async (memory $memory "mem") (core func $stream.read)) + (canon stream.read $ST async (memory (core memory $memory "mem")) (core func $stream.read)) (canon stream.drop-readable $ST (core func $stream.drop-readable)) (canon lower (func $producer "[method]R.foo") (core func $R.foo')) (canon lower (func $producer "start-stream") (core func $start-stream')) diff --git a/test/async/same-component-stream-future.wast b/test/async/same-component-stream-future.wast index 18d4a144..8085be4b 100644 --- a/test/async/same-component-stream-future.wast +++ b/test/async/same-component-stream-future.wast @@ -206,7 +206,7 @@ (type $STB (stream u8)) (type $FTC (future char)) (canon waitable.join (core func $waitable.join)) - (canon waitable-set.wait (memory $memory "mem") (core func $waitable-set.wait)) + (canon waitable-set.wait (memory (core memory $memory "mem")) (core func $waitable-set.wait)) (canon waitable-set.new (core func $waitable-set.new)) (canon future.new $FT (core func $future.new)) (canon future.read $FT async (core func $future.read)) @@ -215,14 +215,14 @@ (canon stream.read $ST async (core func $stream.read)) (canon stream.write $ST async (core func $stream.write)) (canon future.new $FTB (core func $future.newb)) - (canon future.read $FTB async (memory $memory "mem") (core func $future.readb)) - (canon future.write $FTB async (memory $memory "mem") (core func $future.writeb)) + (canon future.read $FTB async (memory (core memory $memory "mem")) (core func $future.readb)) + (canon future.write $FTB async (memory (core memory $memory "mem")) (core func $future.writeb)) (canon stream.new $STB (core func $stream.newb)) - (canon stream.read $STB async (memory $memory "mem") (core func $stream.readb)) - (canon stream.write $STB async (memory $memory "mem") (core func $stream.writeb)) + (canon stream.read $STB async (memory (core memory $memory "mem")) (core func $stream.readb)) + (canon stream.write $STB async (memory (core memory $memory "mem")) (core func $stream.writeb)) (canon future.new $FTC (core func $future.newc)) - (canon future.read $FTC async (memory $memory "mem") (core func $future.readc)) - (canon future.write $FTC async (memory $memory "mem") (core func $future.writec)) + (canon future.read $FTC async (memory (core memory $memory "mem")) (core func $future.readc)) + (canon future.write $FTC async (memory (core memory $memory "mem")) (core func $future.writec)) (core instance $m (instantiate $M (with "" (instance (export "mem" (memory $memory "mem")) (export "waitable.join" (func $waitable.join)) diff --git a/test/async/sync-barges-in.wast b/test/async/sync-barges-in.wast index 3161f93c..b9eb4fa5 100644 --- a/test/async/sync-barges-in.wast +++ b/test/async/sync-barges-in.wast @@ -105,7 +105,7 @@ (canon thread.yield (core func $thread.yield)) (canon waitable.join (core func $waitable.join)) (canon waitable-set.new (core func $waitable-set.new)) - (canon waitable-set.wait (memory $memory "mem") (core func $waitable-set.wait)) + (canon waitable-set.wait (memory (core memory $memory "mem")) (core func $waitable-set.wait)) (canon future.new $FT (core func $future.new)) (canon future.read $FT async (core func $future.read)) (canon future.write $FT async (core func $future.write)) @@ -120,19 +120,19 @@ (export "future.read" (func $future.read)) (export "future.write" (func $future.write)) )))) - (type $R (resource (rep i32) (dtor (func $cm "unblocker")))) - (type $S (resource (rep i32) (dtor (func $cm "poker")))) + (type $R (resource (rep i32) (dtor (core func $cm "unblocker")))) + (type $S (resource (rep i32) (dtor (core func $cm "poker")))) (canon resource.new $R (core func $new-R)) (canon resource.new $S (core func $new-S)) (export $R' "R" (type $R)) (export $S' "S" (type $S)) (func (export "new-R") (param "rep" u32) (result (own $R')) (canon lift (core func $new-R))) (func (export "blocker") async (result u32) (canon lift (core func $cm "blocker") async)) - (func (export "blocker-cb") async (result u32) (canon lift (core func $cm "blocker-cb") async (callback (func $cm "blocker-cb-cb")))) + (func (export "blocker-cb") async (result u32) (canon lift (core func $cm "blocker-cb") async (callback (core func $cm "blocker-cb-cb")))) (func (export "unblocker") (param "val" u32) (canon lift (core func $cm "unblocker"))) (func (export "new-S") (param "rep" u32) (result (own $S')) (canon lift (core func $new-S))) (func (export "yielder") async (result u32) (canon lift (core func $cm "yielder") async)) - (func (export "yielder-cb") async (result u32) (canon lift (core func $cm "yielder-cb") async (callback (func $cm "yielder-cb-cb")))) + (func (export "yielder-cb") async (result u32) (canon lift (core func $cm "yielder-cb") async (callback (core func $cm "yielder-cb-cb")))) (func (export "poker") (param "val" u32) (canon lift (core func $cm "poker"))) ) (component $D @@ -271,15 +271,15 @@ (canon waitable.join (core func $waitable.join)) (canon waitable-set.new (core func $waitable-set.new)) (canon waitable-set.drop (core func $waitable-set.drop)) - (canon waitable-set.wait (memory $memory "mem") (core func $waitable-set.wait)) - (canon waitable-set.poll (memory $memory "mem") (core func $waitable-set.poll)) + (canon waitable-set.wait (memory (core memory $memory "mem")) (core func $waitable-set.wait)) + (canon waitable-set.poll (memory (core memory $memory "mem")) (core func $waitable-set.poll)) (canon lower (func $c "new-R") (core func $new-R')) - (canon lower (func $c "blocker") (memory $memory "mem") async (core func $blocker')) - (canon lower (func $c "blocker-cb") (memory $memory "mem") async (core func $blocker-cb')) + (canon lower (func $c "blocker") (memory (core memory $memory "mem")) async (core func $blocker')) + (canon lower (func $c "blocker-cb") (memory (core memory $memory "mem")) async (core func $blocker-cb')) (canon lower (func $c "unblocker") (core func $unblocker')) (canon lower (func $c "new-S") (core func $new-S')) - (canon lower (func $c "yielder") (memory $memory "mem") async (core func $yielder')) - (canon lower (func $c "yielder-cb") (memory $memory "mem") async (core func $yielder-cb')) + (canon lower (func $c "yielder") (memory (core memory $memory "mem")) async (core func $yielder')) + (canon lower (func $c "yielder-cb") (memory (core memory $memory "mem")) async (core func $yielder-cb')) (canon lower (func $c "poker") (core func $poker')) (core instance $core (instantiate $Core (with "" (instance (export "mem" (memory $memory "mem")) diff --git a/test/async/sync-streams.wast b/test/async/sync-streams.wast index 3dfd3723..7d31a102 100644 --- a/test/async/sync-streams.wast +++ b/test/async/sync-streams.wast @@ -71,11 +71,11 @@ ) ) (type $ST (stream u8)) - (canon task.return (memory $memory "mem") (core func $task.return0)) - (canon task.return (result $ST) (memory $memory "mem") (core func $task.return1)) + (canon task.return (memory (core memory $memory "mem")) (core func $task.return0)) + (canon task.return (result $ST) (memory (core memory $memory "mem")) (core func $task.return1)) (canon stream.new $ST (core func $stream.new)) - (canon stream.read $ST (memory $memory "mem") (core func $stream.read)) - (canon stream.write $ST (memory $memory "mem") (core func $stream.write)) + (canon stream.read $ST (memory (core memory $memory "mem")) (core func $stream.read)) + (canon stream.write $ST (memory (core memory $memory "mem")) (core func $stream.write)) (canon stream.drop-readable $ST (core func $stream.drop-readable)) (canon stream.drop-writable $ST (core func $stream.drop-writable)) (core instance $cm (instantiate $CM (with "" (instance @@ -90,11 +90,11 @@ )))) (func (export "get") async (result (stream u8)) (canon lift (core func $cm "get") - async (memory $memory "mem") (callback (func $cm "get_cb")) + async (memory (core memory $memory "mem")) (callback (core func $cm "get_cb")) )) (func (export "set") async (param "in" (stream u8)) (canon lift (core func $cm "set") - async (memory $memory "mem") (callback (func $cm "set_cb")) + async (memory (core memory $memory "mem")) (callback (core func $cm "set_cb")) )) ) (component $D @@ -171,16 +171,16 @@ ) (type $ST (stream u8)) (canon stream.new $ST (core func $stream.new)) - (canon stream.read $ST async (memory $memory "mem") (core func $stream.read)) - (canon stream.write $ST async (memory $memory "mem") (core func $stream.write)) + (canon stream.read $ST async (memory (core memory $memory "mem")) (core func $stream.read)) + (canon stream.write $ST async (memory (core memory $memory "mem")) (core func $stream.write)) (canon stream.drop-readable $ST (core func $stream.drop-readable)) (canon stream.drop-writable $ST (core func $stream.drop-writable)) (canon waitable-set.new (core func $waitable-set.new)) - (canon waitable-set.wait (memory $memory "mem") (core func $waitable-set.wait)) + (canon waitable-set.wait (memory (core memory $memory "mem")) (core func $waitable-set.wait)) (canon waitable.join (core func $waitable.join)) (canon subtask.drop (core func $subtask.drop)) (canon lower (func $get) (core func $get')) - (canon lower (func $set) async (memory $memory "mem") (core func $set')) + (canon lower (func $set) async (memory (core memory $memory "mem")) (core func $set')) (core instance $dm (instantiate $DM (with "" (instance (export "mem" (memory $memory "mem")) (export "stream.new" (func $stream.new)) diff --git a/test/async/trap-if-block-and-sync.wast b/test/async/trap-if-block-and-sync.wast index 14d81ffb..d196b393 100644 --- a/test/async/trap-if-block-and-sync.wast +++ b/test/async/trap-if-block-and-sync.wast @@ -24,13 +24,13 @@ ) ) (canon waitable-set.new (core func $waitable-set.new)) - (canon waitable-set.wait (memory $memory "mem") (core func $waitable-set.wait)) + (canon waitable-set.wait (memory (core memory $memory "mem")) (core func $waitable-set.wait)) (core instance $cm (instantiate $CM (with "" (instance (export "waitable-set.new" (func $waitable-set.new)) (export "waitable-set.wait" (func $waitable-set.wait)) )))) (func (export "sync-async-func") async (canon lift (core func $cm "sync-async-func"))) - (func (export "async-async-func") async (canon lift (core func $cm "async-async-func") async (callback (func $cm "async-async-func-cb")))) + (func (export "async-async-func") async (canon lift (core func $cm "async-async-func") async (callback (core func $cm "async-async-func-cb")))) (func (export "sync-blocks-and-traps") (canon lift (core func $cm "sync-blocks-and-traps"))) ) (component $D @@ -187,7 +187,7 @@ (core type $start-func-ty (func (param i32))) (alias core export $table "__indirect_function_table" (core table $indirect-function-table)) (core func $thread.new-indirect - (canon thread.new-indirect $start-func-ty (table $indirect-function-table))) + (canon thread.new-indirect $start-func-ty (core table $indirect-function-table))) (canon task.return (result u32) (core func $task.return)) (canon subtask.cancel (core func $subtask.cancel)) (canon thread.yield (core func $thread.yield)) @@ -198,12 +198,12 @@ (canon thread.index (core func $thread.index)) (canon waitable.join (core func $waitable.join)) (canon waitable-set.new (core func $waitable-set.new)) - (canon waitable-set.wait (memory $memory "mem") (core func $waitable-set.wait)) - (canon waitable-set.poll (memory $memory "mem") (core func $waitable-set.poll)) - (canon stream.read $ST (memory $memory "mem") (core func $stream.read)) - (canon stream.write $ST (memory $memory "mem") (core func $stream.write)) - (canon future.read $FT (memory $memory "mem") (core func $future.read)) - (canon future.write $FT (memory $memory "mem") (core func $future.write)) + (canon waitable-set.wait (memory (core memory $memory "mem")) (core func $waitable-set.wait)) + (canon waitable-set.poll (memory (core memory $memory "mem")) (core func $waitable-set.poll)) + (canon stream.read $ST (memory (core memory $memory "mem")) (core func $stream.read)) + (canon stream.write $ST (memory (core memory $memory "mem")) (core func $stream.write)) + (canon future.read $FT (memory (core memory $memory "mem")) (core func $future.read)) + (canon future.write $FT (memory (core memory $memory "mem")) (core func $future.write)) (canon stream.cancel-read $ST (core func $stream.cancel-read)) (canon stream.cancel-write $ST (core func $stream.cancel-write)) (canon future.cancel-read $FT (core func $future.cancel-read)) @@ -242,15 +242,15 @@ (func (export "trap-if-suspend") (canon lift (core func $core "trap-if-suspend"))) (func (export "trap-if-wait") (canon lift (core func $core "trap-if-wait"))) (func (export "poll-is-fine") (result u32) (canon lift (core func $core "poll-is-fine"))) - (func (export "trap-if-invalid-callback-code") async (param "invalid-code" u32) (canon lift (core func $core "trap-if-invalid-callback-code") async (callback (func $core "unreachable-cb")))) + (func (export "trap-if-invalid-callback-code") async (param "invalid-code" u32) (canon lift (core func $core "trap-if-invalid-callback-code") async (callback (core func $core "unreachable-cb")))) (func (export "yield-is-fine") (result u32) (canon lift (core func $core "yield-is-fine"))) - (func (export "yield-is-fine-cb") async (result u32) (canon lift (core func $core "yield-is-fine-cb") async (callback (func $core "return-42-cb")))) + (func (export "yield-is-fine-cb") async (result u32) (canon lift (core func $core "yield-is-fine-cb") async (callback (core func $core "return-42-cb")))) (func (export "yield-to-is-fine") (result u32) (canon lift (core func $core "yield-to-is-fine"))) (func (export "switch-to-is-fine") (result u32) (canon lift (core func $core "switch-to-is-fine"))) (func (export "resume-later-is-fine") (result u32) (canon lift (core func $core "resume-later-is-fine"))) (func (export "trap-if-sync-call-async1") (canon lift (core func $core "trap-if-sync-call-async1"))) (func (export "trap-if-sync-call-async2") (canon lift (core func $core "trap-if-sync-call-async2"))) - (func (export "trap-if-async-calls-sync-and-blocks") async (canon lift (core func $core "trap-if-async-calls-sync-and-blocks") async (callback (func $core "unreachable-cb")))) + (func (export "trap-if-async-calls-sync-and-blocks") async (canon lift (core func $core "trap-if-async-calls-sync-and-blocks") async (callback (core func $core "unreachable-cb")))) (func (export "trap-if-sync-cancel") (canon lift (core func $core "trap-if-sync-cancel"))) (func (export "trap-if-sync-stream-read") (canon lift (core func $core "trap-if-sync-stream-read"))) (func (export "trap-if-sync-stream-write") (canon lift (core func $core "trap-if-sync-stream-write"))) diff --git a/test/async/trap-if-done.wast b/test/async/trap-if-done.wast index 8f84cd33..414f497f 100644 --- a/test/async/trap-if-done.wast +++ b/test/async/trap-if-done.wast @@ -96,12 +96,12 @@ (type $ST (stream u8)) (canon waitable.join (core func $waitable.join)) (canon waitable-set.new (core func $waitable-set.new)) - (canon waitable-set.wait (memory $memory "mem") (core func $waitable-set.wait)) + (canon waitable-set.wait (memory (core memory $memory "mem")) (core func $waitable-set.wait)) (canon future.new $FT (core func $future.new)) - (canon future.write $FT async (memory $memory "mem") (core func $future.write)) + (canon future.write $FT async (memory (core memory $memory "mem")) (core func $future.write)) (canon future.drop-writable $FT (core func $future.drop-writable)) (canon stream.new $ST (core func $stream.new)) - (canon stream.write $ST async (memory $memory "mem") (core func $stream.write)) + (canon stream.write $ST async (memory (core memory $memory "mem")) (core func $stream.write)) (canon stream.drop-writable $ST (core func $stream.drop-writable)) (core instance $cm (instantiate $CM (with "" (instance (export "mem" (memory $memory "mem")) @@ -384,12 +384,12 @@ (type $ST (stream u8)) (canon waitable.join (core func $waitable.join)) (canon waitable-set.new (core func $waitable-set.new)) - (canon waitable-set.wait (memory $memory "mem") (core func $waitable-set.wait)) + (canon waitable-set.wait (memory (core memory $memory "mem")) (core func $waitable-set.wait)) (canon future.new $FT (core func $future.new)) - (canon future.read $FT async (memory $memory "mem") (core func $future.read)) + (canon future.read $FT async (memory (core memory $memory "mem")) (core func $future.read)) (canon future.drop-readable $FT (core func $future.drop-readable)) (canon stream.new $ST (core func $stream.new)) - (canon stream.read $ST async (memory $memory "mem") (core func $stream.read)) + (canon stream.read $ST async (memory (core memory $memory "mem")) (core func $stream.read)) (canon stream.drop-readable $ST (core func $stream.drop-readable)) (canon lower (func $c "start-future") (core func $start-future')) (canon lower (func $c "future-write") (core func $future-write')) diff --git a/test/async/trap-if-sync-and-waitable-set.wast b/test/async/trap-if-sync-and-waitable-set.wast index 37ce4c2b..e0ed9c29 100644 --- a/test/async/trap-if-sync-and-waitable-set.wast +++ b/test/async/trap-if-sync-and-waitable-set.wast @@ -17,7 +17,7 @@ )))) (func (export "blocks-forever") async (result u32) (canon lift (core func $cm "blocks-forever") - async (callback (func $cm "blocks-forever-cb")) + async (callback (core func $cm "blocks-forever-cb")) )) ) (instance $c (instantiate $C)) @@ -199,7 +199,7 @@ (core type $start-func-ty (func (param i32))) (alias core export $memTable "ftbl" (core table $ftbl)) - (core func $thread.new-indirect (canon thread.new-indirect $start-func-ty (table $ftbl))) + (core func $thread.new-indirect (canon thread.new-indirect $start-func-ty (core table $ftbl))) (core func $thread.yield-then-resume (canon thread.yield-then-resume)) (core func $waitable-set.new (canon waitable-set.new)) (core func $waitable.join (canon waitable.join)) @@ -207,20 +207,20 @@ (type $future (future)) (type $stream (stream u8)) (core func $future.new (canon future.new $future)) - (core func $future.read-sync (canon future.read $future (memory $memTable "mem"))) - (core func $future.write-sync (canon future.write $future (memory $memTable "mem"))) - (core func $future.read-async (canon future.read $future async (memory $memTable "mem"))) - (core func $future.write-async (canon future.write $future async (memory $memTable "mem"))) + (core func $future.read-sync (canon future.read $future (memory (core memory $memTable "mem")))) + (core func $future.write-sync (canon future.write $future (memory (core memory $memTable "mem")))) + (core func $future.read-async (canon future.read $future async (memory (core memory $memTable "mem")))) + (core func $future.write-async (canon future.write $future async (memory (core memory $memTable "mem")))) (core func $future.cancel-read-sync (canon future.cancel-read $future)) (core func $future.cancel-write-sync (canon future.cancel-write $future)) (core func $stream.new (canon stream.new $stream)) - (core func $stream.read-sync (canon stream.read $stream (memory $memTable "mem"))) - (core func $stream.write-sync (canon stream.write $stream (memory $memTable "mem"))) - (core func $stream.read-async (canon stream.read $stream async (memory $memTable "mem"))) - (core func $stream.write-async (canon stream.write $stream async (memory $memTable "mem"))) + (core func $stream.read-sync (canon stream.read $stream (memory (core memory $memTable "mem")))) + (core func $stream.write-sync (canon stream.write $stream (memory (core memory $memTable "mem")))) + (core func $stream.read-async (canon stream.read $stream async (memory (core memory $memTable "mem")))) + (core func $stream.write-async (canon stream.write $stream async (memory (core memory $memTable "mem")))) (core func $stream.cancel-read-sync (canon stream.cancel-read $stream)) (core func $stream.cancel-write-sync (canon stream.cancel-write $stream)) - (canon lower (func $c "blocks-forever") async (memory $memTable "mem") (core func $blocks-forever)) + (canon lower (func $c "blocks-forever") async (memory (core memory $memTable "mem")) (core func $blocks-forever)) (core instance $m (instantiate $m (with "" (instance diff --git a/test/async/trap-on-reenter.wast b/test/async/trap-on-reenter.wast index f363f6d0..dd63baa5 100644 --- a/test/async/trap-on-reenter.wast +++ b/test/async/trap-on-reenter.wast @@ -14,7 +14,7 @@ (core instance $core_inner (instantiate $CoreInner)) (func $a async (canon lift (core func $core_inner "a") - async (callback (func $core_inner "a-cb")) + async (callback (core func $core_inner "a-cb")) )) (component $Child @@ -33,13 +33,13 @@ unreachable ) ) - (canon lower (func $a) async (memory $memory "mem") (core func $a')) + (canon lower (func $a) async (memory (core memory $memory "mem")) (core func $a')) (core instance $core_child (instantiate $CoreChild (with "" (instance (export "a" (func $a')) )))) (func (export "b") async (canon lift (core func $core_child "b") - async (callback (func $core_child "b-cb")) + async (callback (core func $core_child "b-cb")) )) ) (instance $child (instantiate $Child (with "a" (func $a)))) @@ -53,13 +53,13 @@ (call $b) ) ) - (canon lower (func $child "b") async (memory $core_inner "mem") (core func $b)) + (canon lower (func $child "b") async (memory (core memory $core_inner "mem")) (core func $b)) (core instance $core_outer (instantiate $CoreOuter (with "" (instance (export "b" (func $b)) )))) (func $c (export "c") async (canon lift (core func $core_outer "c") - async (callback (func $core_outer "c-cb")) + async (callback (core func $core_outer "c-cb")) )) ) (assert_trap (invoke "c") "wasm trap: cannot enter component instance") diff --git a/test/async/validate-no-async-abi-for-sync-type.wast b/test/async/validate-no-async-abi-for-sync-type.wast index e319bb43..f54b9925 100644 --- a/test/async/validate-no-async-abi-for-sync-type.wast +++ b/test/async/validate-no-async-abi-for-sync-type.wast @@ -15,7 +15,7 @@ (func (export "f_cb") (param i32 i32 i32) (result i32) unreachable) ) (core instance $i (instantiate $M)) - (func (export "f") (canon lift (core func $i "f") async (callback (func $i "f_cb")))) + (func (export "f") (canon lift (core func $i "f") async (callback (core func $i "f_cb")))) ) "the `async` canonical option requires an async function type") diff --git a/test/async/wait-during-callback.wast b/test/async/wait-during-callback.wast index 3f95d5b1..0db2b144 100644 --- a/test/async/wait-during-callback.wast +++ b/test/async/wait-during-callback.wast @@ -55,7 +55,7 @@ (canon task.return (result u32) (core func $task.return)) (canon waitable.join (core func $waitable.join)) (canon waitable-set.new (core func $waitable-set.new)) - (canon waitable-set.wait (memory $memory "mem") (core func $waitable-set.wait)) + (canon waitable-set.wait (memory (core memory $memory "mem")) (core func $waitable-set.wait)) (canon future.new $FT (core func $future.new)) (canon future.read $FT async (core func $future.read)) (canon future.write $FT async (core func $future.write)) @@ -71,7 +71,7 @@ )))) (func (export "run") async (result u32) (canon lift (core func $cm "run") - async (callback (func $cm "run_cb")) + async (callback (core func $cm "run_cb")) )) ) (assert_return (invoke "run") (u32.const 42)) diff --git a/test/async/zero-length.wast b/test/async/zero-length.wast index fab7765f..cbb5b120 100644 --- a/test/async/zero-length.wast +++ b/test/async/zero-length.wast @@ -93,7 +93,7 @@ (canon waitable.join (core func $waitable.join)) (canon waitable-set.new (core func $waitable-set.new)) (canon stream.new $ST (core func $stream.new)) - (canon stream.write $ST async (memory $memory "mem") (core func $stream.write)) + (canon stream.write $ST async (memory (core memory $memory "mem")) (core func $stream.write)) (canon stream.drop-writable $ST (core func $stream.drop-writable)) (core instance $core_producer (instantiate $CoreProducer (with "" (instance (export "mem" (memory $memory "mem")) @@ -106,7 +106,7 @@ )))) (func (export "produce") async (result (stream u8)) (canon lift (core func $core_producer "produce") - async (callback (func $core_producer "produce_cb")) + async (callback (core func $core_producer "produce_cb")) )) ) @@ -174,7 +174,7 @@ (canon task.return (result u32) (core func $task.return)) (canon waitable.join (core func $waitable.join)) (canon waitable-set.new (core func $waitable-set.new)) - (canon stream.read $ST async (memory $memory "mem") (core func $stream.read)) + (canon stream.read $ST async (memory (core memory $memory "mem")) (core func $stream.read)) (canon stream.drop-readable $ST (core func $stream.drop-readable)) (core instance $core_consumer (instantiate $CoreConsumer (with "" (instance (export "mem" (memory $memory "mem")) @@ -186,7 +186,7 @@ )))) (func (export "consume") async (param "in" (stream u8)) (result u32) (canon lift (core func $core_consumer "consume") - async (callback (func $core_consumer "consume_cb")) + async (callback (core func $core_consumer "consume_cb")) )) ) diff --git a/test/linking/unit.wast b/test/linking/unit.wast index 0a436912..da76b5b9 100644 --- a/test/linking/unit.wast +++ b/test/linking/unit.wast @@ -414,9 +414,9 @@ (core instance $a (instantiate $A)) (core instance $b (instantiate $B)) (func (export "get-a") (result string) - (canon lift (core func $a "get") (memory $a "mem"))) + (canon lift (core func $a "get") (memory (core memory $a "mem")))) (func (export "get-b") (result string) - (canon lift (core func $b "get") (memory $b "mem"))) + (canon lift (core func $b "get") (memory (core memory $b "mem")))) ) (assert_return (invoke "get-a") (str.const "hello")) @@ -437,7 +437,7 @@ (core instance $p (instantiate $P)) (core instance $m (instantiate $M)) (func (export "get") (result string) - (canon lift (core func $m "get") (memory $p "mem"))) + (canon lift (core func $m "get") (memory (core memory $p "mem")))) ) (assert_return (invoke "get") (str.const "right")) @@ -664,8 +664,8 @@ (func (export "count1") (result i32) (global.get $c1)) (func (export "count2") (result i32) (global.get $c2))) (core instance $m (instantiate $M)) - (type $R1 (resource (rep i32) (dtor (func $m "dtor1")))) - (type $R2 (resource (rep i32) (dtor (func $m "dtor2")))) + (type $R1 (resource (rep i32) (dtor (core func $m "dtor1")))) + (type $R2 (resource (rep i32) (dtor (core func $m "dtor2")))) (export $R1e "r1" (type $R1)) (export $R2e "r2" (type $R2)) (core func $new1 (canon resource.new $R1)) @@ -744,7 +744,7 @@ (func (export "log-at") (param i32) (result i32) (i32.load8_u (local.get 0)))) (core instance $m (instantiate $M)) - (type $R (resource (rep i32) (dtor (func $m "dtor")))) + (type $R (resource (rep i32) (dtor (core func $m "dtor")))) (export $Re "r" (type $R)) (core func $new (canon resource.new $R)) (core module $Maker @@ -805,7 +805,7 @@ (global.set $c (i32.add (global.get $c) (local.get 0)))) (func (export "count") (result i32) (global.get $c))) (core instance $m (instantiate $M)) - (type $R (resource (rep i32) (dtor (func $m "dtor")))) + (type $R (resource (rep i32) (dtor (core func $m "dtor")))) (export $Re "r" (type $R)) (core func $new (canon resource.new $R)) (core module $Maker @@ -880,7 +880,7 @@ (func (export "get") (param i32) (result i32) (i32.mul (local.get 0) (i32.const 2)))) (core instance $m (instantiate $M)) - (type $R (resource (rep i32) (dtor (func $m "dtor")))) + (type $R (resource (rep i32) (dtor (core func $m "dtor")))) (export $Re "r" (type $R)) (core func $new (canon resource.new $R)) (core module $Maker @@ -945,7 +945,7 @@ (global.set $c (i32.add (global.get $c) (local.get 0)))) (func (export "count") (result i32) (global.get $c))) (core instance $m (instantiate $M)) - (type $R (resource (rep i32) (dtor (func $m "dtor")))) + (type $R (resource (rep i32) (dtor (core func $m "dtor")))) (export $Re "r" (type $R)) (core func $new (canon resource.new $R)) (core module $Maker @@ -1035,7 +1035,7 @@ (global.set $c (i32.add (global.get $c) (local.get 0)))) (func (export "count") (result i32) (global.get $c))) (core instance $m (instantiate $M)) - (type $R (resource (rep i32) (dtor (func $m "dtor")))) + (type $R (resource (rep i32) (dtor (core func $m "dtor")))) (export $R1e "r1" (type $R)) (export $R2e "r2" (type $R)) (core func $new (canon resource.new $R)) @@ -1108,7 +1108,7 @@ (global.set $c (i32.add (global.get $c) (local.get 0)))) (func (export "count") (result i32) (global.get $c))) (core instance $m (instantiate $M)) - (type $R (resource (rep i32) (dtor (func $m "dtor")))) + (type $R (resource (rep i32) (dtor (core func $m "dtor")))) (export $Re "r" (type $R)) (core func $new (canon resource.new $R)) (core func $dropr (canon resource.drop $R)) diff --git a/test/resources/multiple-resources.wast b/test/resources/multiple-resources.wast index 77549ad4..4a7bff17 100644 --- a/test/resources/multiple-resources.wast +++ b/test/resources/multiple-resources.wast @@ -14,8 +14,8 @@ ) ) (core instance $indirect (instantiate $Indirect)) - (type $R1' (resource (rep i32) (dtor (func $indirect "R1-dtor")))) - (type $R2' (resource (rep i32) (dtor (func $indirect "R2-dtor")))) + (type $R1' (resource (rep i32) (dtor (core func $indirect "R1-dtor")))) + (type $R2' (resource (rep i32) (dtor (core func $indirect "R2-dtor")))) (export $R1 "R1" (type $R1')) (export $R2 "R2" (type $R2')) (canon resource.new $R1' (core func $R1.resource.new)) diff --git a/test/validation/abi.wast b/test/validation/abi.wast index 5f1f6483..ef1d744c 100644 --- a/test/validation/abi.wast +++ b/test/validation/abi.wast @@ -12,7 +12,7 @@ (func (export "realloc") (param i32 i32 i32 i32) (result i32) unreachable) ) (core instance $i (instantiate $M)) - (canon lower (func $foo) (realloc (func $i "realloc")) (core func $foo')) + (canon lower (func $foo) (realloc (core func $i "realloc")) (core func $foo')) ) "canonical option `realloc` requires `memory` to also be specified" ) @@ -24,8 +24,8 @@ (func (export "realloc") (param i32 i32 i32 i32) (result i32) unreachable) ) (core instance $i (instantiate $M)) - (canon lower (func $foo) (memory $i "mem") (core func $foo1)) + (canon lower (func $foo) (memory (core memory $i "mem")) (core func $foo1)) ;; realloc superfluous but allowed: - (canon lower (func $foo) (memory $i "mem") (realloc (func $i "realloc")) (core func $foo2)) + (canon lower (func $foo) (memory (core memory $i "mem")) (realloc (core func $i "realloc")) (core func $foo2)) ) ) diff --git a/test/validation/external-visibility.wast b/test/validation/external-visibility.wast index be6686b6..804cd120 100644 --- a/test/validation/external-visibility.wast +++ b/test/validation/external-visibility.wast @@ -188,7 +188,7 @@ (func (export "f") (result i32) unreachable)) (core instance $i (instantiate $m)) (type $R (resource (rep i32))) - (func $f (result (option (own $R))) (canon lift (core func $i "f") (memory $i "mem"))) + (func $f (result (option (own $R))) (canon lift (core func $i "f") (memory (core memory $i "mem")))) (export "f" (func $f))) "func not valid to be used as export") @@ -199,7 +199,7 @@ (func (export "f") (result i32) unreachable)) (core instance $i (instantiate $m)) (type $Rec (record (field "x" u32))) - (func $f (result (tuple $Rec u32)) (canon lift (core func $i "f") (memory $i "mem"))) + (func $f (result (tuple $Rec u32)) (canon lift (core func $i "f") (memory (core memory $i "mem")))) (export "f" (func $f))) "func not valid to be used as export") diff --git a/test/values/concat.wast b/test/values/concat.wast index 3335a96c..d80f0534 100644 --- a/test/values/concat.wast +++ b/test/values/concat.wast @@ -289,67 +289,67 @@ (param "p0" bool) (param "p1" u8) (param "p2" s8) (param "p3" u16) (param "p4" s16) (param "p5" u32) (param "p6" s32) (param "p7" u64) (param "p8" s64) (param "p9" char) (param "p10" string) (result string) - (canon lift (core func $m "prims") (memory $m "mem") (realloc (func $m "realloc")))) + (canon lift (core func $m "prims") (memory (core memory $m "mem")) (realloc (core func $m "realloc")))) (func (export "list") (param "a" (list string)) (result string) - (canon lift (core func $m "list") (memory $m "mem") (realloc (func $m "realloc")))) + (canon lift (core func $m "list") (memory (core memory $m "mem")) (realloc (core func $m "realloc")))) (func (export "tuple") (param "a" (tuple string u32 bool)) (result string) - (canon lift (core func $m "tuple") (memory $m "mem") (realloc (func $m "realloc")))) + (canon lift (core func $m "tuple") (memory (core memory $m "mem")) (realloc (core func $m "realloc")))) (type $rec-t (record (field "s" string) (field "n" u32))) (export $rec-e "rec-t" (type $rec-t)) (func (export "record") (param "a" $rec-e) (result string) - (canon lift (core func $m "record") (memory $m "mem") (realloc (func $m "realloc")))) + (canon lift (core func $m "record") (memory (core memory $m "mem")) (realloc (core func $m "realloc")))) (type $var-t (variant (case "s" string) (case "n" u32))) (export $var-e "var-t" (type $var-t)) (func (export "variant") (param "a" $var-e) (result string) - (canon lift (core func $m "variant") (memory $m "mem") (realloc (func $m "realloc")))) + (canon lift (core func $m "variant") (memory (core memory $m "mem")) (realloc (core func $m "realloc")))) (type $enum-t (enum "red" "green" "blue")) (export $enum-e "enum-t" (type $enum-t)) (func (export "enum") (param "a" $enum-e) (result string) - (canon lift (core func $m "enum") (memory $m "mem") (realloc (func $m "realloc")))) + (canon lift (core func $m "enum") (memory (core memory $m "mem")) (realloc (core func $m "realloc")))) (type $flags-t (flags "a" "b" "c")) (export $flags-e "flags-t" (type $flags-t)) (func (export "flags") (param "a" $flags-e) (result string) - (canon lift (core func $m "flags") (memory $m "mem") (realloc (func $m "realloc")))) + (canon lift (core func $m "flags") (memory (core memory $m "mem")) (realloc (core func $m "realloc")))) (func (export "option") (param "a" (option u32)) (result string) - (canon lift (core func $m "option") (memory $m "mem") (realloc (func $m "realloc")))) + (canon lift (core func $m "option") (memory (core memory $m "mem")) (realloc (core func $m "realloc")))) (func (export "result") (param "a" (result string (error u32))) (result string) - (canon lift (core func $m "result") (memory $m "mem") (realloc (func $m "realloc")))) + (canon lift (core func $m "result") (memory (core memory $m "mem")) (realloc (core func $m "realloc")))) (func (export "nested-list") (param "a" (list (list string))) (result string) - (canon lift (core func $m "nested-list") (memory $m "mem") (realloc (func $m "realloc")))) + (canon lift (core func $m "nested-list") (memory (core memory $m "mem")) (realloc (core func $m "realloc")))) (type $profile-t (record (field "name" string) (field "scores" (list u32)))) (export $profile-e "profile-t" (type $profile-t)) (func (export "profile") (param "a" $profile-e) (result string) - (canon lift (core func $m "profile") (memory $m "mem") (realloc (func $m "realloc")))) + (canon lift (core func $m "profile") (memory (core memory $m "mem")) (realloc (core func $m "realloc")))) (func (export "maybe-pair") (param "a" (option (tuple string u32))) (result string) - (canon lift (core func $m "maybe-pair") (memory $m "mem") (realloc (func $m "realloc")))) + (canon lift (core func $m "maybe-pair") (memory (core memory $m "mem")) (realloc (core func $m "realloc")))) (type $entry-t (record (field "k" string) (field "v" u32))) (export $entry-e "entry-t" (type $entry-t)) (func (export "entries") (param "a" (list $entry-e)) (result string) - (canon lift (core func $m "entries") (memory $m "mem") (realloc (func $m "realloc")))) + (canon lift (core func $m "entries") (memory (core memory $m "mem")) (realloc (core func $m "realloc")))) (func (export "deep") (param "a" (list (option (tuple string (list u32))))) (result string) - (canon lift (core func $m "deep") (memory $m "mem") (realloc (func $m "realloc")))) + (canon lift (core func $m "deep") (memory (core memory $m "mem")) (realloc (core func $m "realloc")))) (func (export "concat-u32s") (param "a" (list u32)) (result string) - (canon lift (core func $m "concat-u32s") (memory $m "mem") (realloc (func $m "realloc")))) + (canon lift (core func $m "concat-u32s") (memory (core memory $m "mem")) (realloc (core func $m "realloc")))) (func (export "echo") (param "a" string) (result string) - (canon lift (core func $m "echo") (memory $m "mem") (realloc (func $m "realloc")))) + (canon lift (core func $m "echo") (memory (core memory $m "mem")) (realloc (core func $m "realloc")))) (func (export "bignum") (param "a" u64) (result string) - (canon lift (core func $m "bignum") (memory $m "mem") (realloc (func $m "realloc")))) + (canon lift (core func $m "bignum") (memory (core memory $m "mem")) (realloc (core func $m "realloc")))) (type $mix-t (variant (case "a" u32) (case "b" f32) (case "c" u64) (case "d" f64))) (export $mix-e "mix-t" (type $mix-t)) (func (export "flat-mix") (param "a" $mix-e) (result string) - (canon lift (core func $m "flat-mix") (memory $m "mem") (realloc (func $m "realloc")))) + (canon lift (core func $m "flat-mix") (memory (core memory $m "mem")) (realloc (core func $m "realloc")))) (type $pad-t (variant (case "p" (tuple f32 f32)) (case "q" u32))) (export $pad-e "pad-t" (type $pad-t)) (func (export "flat-pad") (param "a" $pad-e) (result string) - (canon lift (core func $m "flat-pad") (memory $m "mem") (realloc (func $m "realloc")))) + (canon lift (core func $m "flat-pad") (memory (core memory $m "mem")) (realloc (core func $m "realloc")))) (type $lv-t (variant (case "n" u32) (case "s" string))) (export $lv-e "lv-t" (type $lv-t)) (func (export "list-variant") (param "a" (list $lv-e)) (result string) - (canon lift (core func $m "list-variant") (memory $m "mem") (realloc (func $m "realloc")))) + (canon lift (core func $m "list-variant") (memory (core memory $m "mem")) (realloc (core func $m "realloc")))) (type $lv2-t (variant (case "b" u8) (case "w" u64))) (export $lv2-e "lv2-t" (type $lv2-t)) (func (export "list-variant2") (param "a" (list $lv2-e)) (result string) - (canon lift (core func $m "list-variant2") (memory $m "mem") (realloc (func $m "realloc")))) + (canon lift (core func $m "list-variant2") (memory (core memory $m "mem")) (realloc (core func $m "realloc")))) ) (assert_return diff --git a/test/values/post-return.wast b/test/values/post-return.wast index 7bc6d665..8658186d 100644 --- a/test/values/post-return.wast +++ b/test/values/post-return.wast @@ -23,22 +23,22 @@ (canon task.cancel (core func $task.cancel)) (canon thread.yield (core func $yield)) (canon waitable-set.new (core func $waitable-set.new)) - (canon waitable-set.wait (memory $memory "mem") (core func $waitable-set.wait)) - (canon waitable-set.poll (memory $memory "mem") (core func $waitable-set.poll)) + (canon waitable-set.wait (memory (core memory $memory "mem")) (core func $waitable-set.wait)) + (canon waitable-set.poll (memory (core memory $memory "mem")) (core func $waitable-set.poll)) (canon waitable-set.drop (core func $waitable-set.drop)) (canon waitable.join (core func $waitable.join)) (canon subtask.cancel (core func $subtask.cancel)) (canon subtask.drop (core func $subtask.drop)) (canon stream.new $ST (core func $stream.new)) - (canon stream.read $ST (memory $memory "mem") (core func $stream.read)) - (canon stream.write $ST (memory $memory "mem") (core func $stream.write)) + (canon stream.read $ST (memory (core memory $memory "mem")) (core func $stream.read)) + (canon stream.write $ST (memory (core memory $memory "mem")) (core func $stream.write)) (canon stream.cancel-read $ST (core func $stream.cancel-read)) (canon stream.cancel-write $ST (core func $stream.cancel-write)) (canon stream.drop-readable $ST (core func $stream.drop-readable)) (canon stream.drop-writable $ST (core func $stream.drop-writable)) (canon future.new $FT (core func $future.new)) - (canon future.read $FT (memory $memory "mem") (core func $future.read)) - (canon future.write $FT (memory $memory "mem") (core func $future.write)) + (canon future.read $FT (memory (core memory $memory "mem")) (core func $future.read)) + (canon future.write $FT (memory (core memory $memory "mem")) (core func $future.write)) (canon future.cancel-read $FT (core func $future.cancel-read)) (canon future.cancel-write $FT (core func $future.cancel-write)) (canon future.drop-readable $FT (core func $future.drop-readable)) @@ -133,33 +133,33 @@ (export "future.drop-readable" (func $future.drop-readable)) (export "future.drop-writable" (func $future.drop-writable)) )))) - (func (export "trap-calling-import") (canon lift (core func $dm "noop") (post-return (func $dm "trap-calling-import")))) - (func (export "trap-calling-resource-new") (canon lift (core func $dm "noop") (post-return (func $dm "trap-calling-resource-new")))) - (func (export "trap-calling-resource-drop") (canon lift (core func $dm "noop") (post-return (func $dm "trap-calling-resource-drop")))) - (func (export "trap-calling-task-return") (canon lift (core func $dm "noop") (post-return (func $dm "trap-calling-task-return")))) - (func (export "trap-calling-task-cancel") (canon lift (core func $dm "noop") (post-return (func $dm "trap-calling-task-cancel")))) - (func (export "trap-calling-yield") (canon lift (core func $dm "noop") (post-return (func $dm "trap-calling-yield")))) - (func (export "trap-calling-waitable-set-new") (canon lift (core func $dm "noop") (post-return (func $dm "trap-calling-waitable-set-new")))) - (func (export "trap-calling-waitable-set-wait") (canon lift (core func $dm "noop") (post-return (func $dm "trap-calling-waitable-set-wait")))) - (func (export "trap-calling-waitable-set-poll") (canon lift (core func $dm "noop") (post-return (func $dm "trap-calling-waitable-set-poll")))) - (func (export "trap-calling-waitable-set-drop") (canon lift (core func $dm "noop") (post-return (func $dm "trap-calling-waitable-set-drop")))) - (func (export "trap-calling-waitable-join") (canon lift (core func $dm "noop") (post-return (func $dm "trap-calling-waitable-join")))) - (func (export "trap-calling-subtask-cancel") (canon lift (core func $dm "noop") (post-return (func $dm "trap-calling-subtask-cancel")))) - (func (export "trap-calling-subtask-drop") (canon lift (core func $dm "noop") (post-return (func $dm "trap-calling-subtask-drop")))) - (func (export "trap-calling-stream-new") (canon lift (core func $dm "noop") (post-return (func $dm "trap-calling-stream-new")))) - (func (export "trap-calling-stream-read") (canon lift (core func $dm "noop") (post-return (func $dm "trap-calling-stream-read")))) - (func (export "trap-calling-stream-write") (canon lift (core func $dm "noop") (post-return (func $dm "trap-calling-stream-write")))) - (func (export "trap-calling-stream-cancel-read") (canon lift (core func $dm "noop") (post-return (func $dm "trap-calling-stream-cancel-read")))) - (func (export "trap-calling-stream-cancel-write") (canon lift (core func $dm "noop") (post-return (func $dm "trap-calling-stream-cancel-write")))) - (func (export "trap-calling-stream-drop-readable") (canon lift (core func $dm "noop") (post-return (func $dm "trap-calling-stream-drop-readable")))) - (func (export "trap-calling-stream-drop-writable") (canon lift (core func $dm "noop") (post-return (func $dm "trap-calling-stream-drop-writable")))) - (func (export "trap-calling-future-new") (canon lift (core func $dm "noop") (post-return (func $dm "trap-calling-future-new")))) - (func (export "trap-calling-future-read") (canon lift (core func $dm "noop") (post-return (func $dm "trap-calling-future-read")))) - (func (export "trap-calling-future-write") (canon lift (core func $dm "noop") (post-return (func $dm "trap-calling-future-write")))) - (func (export "trap-calling-future-cancel-read") (canon lift (core func $dm "noop") (post-return (func $dm "trap-calling-future-cancel-read")))) - (func (export "trap-calling-future-cancel-write") (canon lift (core func $dm "noop") (post-return (func $dm "trap-calling-future-cancel-write")))) - (func (export "trap-calling-future-drop-readable") (canon lift (core func $dm "noop") (post-return (func $dm "trap-calling-future-drop-readable")))) - (func (export "trap-calling-future-drop-writable") (canon lift (core func $dm "noop") (post-return (func $dm "trap-calling-future-drop-writable")))) + (func (export "trap-calling-import") (canon lift (core func $dm "noop") (post-return (core func $dm "trap-calling-import")))) + (func (export "trap-calling-resource-new") (canon lift (core func $dm "noop") (post-return (core func $dm "trap-calling-resource-new")))) + (func (export "trap-calling-resource-drop") (canon lift (core func $dm "noop") (post-return (core func $dm "trap-calling-resource-drop")))) + (func (export "trap-calling-task-return") (canon lift (core func $dm "noop") (post-return (core func $dm "trap-calling-task-return")))) + (func (export "trap-calling-task-cancel") (canon lift (core func $dm "noop") (post-return (core func $dm "trap-calling-task-cancel")))) + (func (export "trap-calling-yield") (canon lift (core func $dm "noop") (post-return (core func $dm "trap-calling-yield")))) + (func (export "trap-calling-waitable-set-new") (canon lift (core func $dm "noop") (post-return (core func $dm "trap-calling-waitable-set-new")))) + (func (export "trap-calling-waitable-set-wait") (canon lift (core func $dm "noop") (post-return (core func $dm "trap-calling-waitable-set-wait")))) + (func (export "trap-calling-waitable-set-poll") (canon lift (core func $dm "noop") (post-return (core func $dm "trap-calling-waitable-set-poll")))) + (func (export "trap-calling-waitable-set-drop") (canon lift (core func $dm "noop") (post-return (core func $dm "trap-calling-waitable-set-drop")))) + (func (export "trap-calling-waitable-join") (canon lift (core func $dm "noop") (post-return (core func $dm "trap-calling-waitable-join")))) + (func (export "trap-calling-subtask-cancel") (canon lift (core func $dm "noop") (post-return (core func $dm "trap-calling-subtask-cancel")))) + (func (export "trap-calling-subtask-drop") (canon lift (core func $dm "noop") (post-return (core func $dm "trap-calling-subtask-drop")))) + (func (export "trap-calling-stream-new") (canon lift (core func $dm "noop") (post-return (core func $dm "trap-calling-stream-new")))) + (func (export "trap-calling-stream-read") (canon lift (core func $dm "noop") (post-return (core func $dm "trap-calling-stream-read")))) + (func (export "trap-calling-stream-write") (canon lift (core func $dm "noop") (post-return (core func $dm "trap-calling-stream-write")))) + (func (export "trap-calling-stream-cancel-read") (canon lift (core func $dm "noop") (post-return (core func $dm "trap-calling-stream-cancel-read")))) + (func (export "trap-calling-stream-cancel-write") (canon lift (core func $dm "noop") (post-return (core func $dm "trap-calling-stream-cancel-write")))) + (func (export "trap-calling-stream-drop-readable") (canon lift (core func $dm "noop") (post-return (core func $dm "trap-calling-stream-drop-readable")))) + (func (export "trap-calling-stream-drop-writable") (canon lift (core func $dm "noop") (post-return (core func $dm "trap-calling-stream-drop-writable")))) + (func (export "trap-calling-future-new") (canon lift (core func $dm "noop") (post-return (core func $dm "trap-calling-future-new")))) + (func (export "trap-calling-future-read") (canon lift (core func $dm "noop") (post-return (core func $dm "trap-calling-future-read")))) + (func (export "trap-calling-future-write") (canon lift (core func $dm "noop") (post-return (core func $dm "trap-calling-future-write")))) + (func (export "trap-calling-future-cancel-read") (canon lift (core func $dm "noop") (post-return (core func $dm "trap-calling-future-cancel-read")))) + (func (export "trap-calling-future-cancel-write") (canon lift (core func $dm "noop") (post-return (core func $dm "trap-calling-future-cancel-write")))) + (func (export "trap-calling-future-drop-readable") (canon lift (core func $dm "noop") (post-return (core func $dm "trap-calling-future-drop-readable")))) + (func (export "trap-calling-future-drop-writable") (canon lift (core func $dm "noop") (post-return (core func $dm "trap-calling-future-drop-writable")))) ) (instance $c (instantiate $C)) (instance $d (instantiate $D (with "import" (func $c "import")))) @@ -275,7 +275,7 @@ )))) (func (export "f") (result u32) (canon lift (core func $cm "f") - (post-return (func $cm "f-pr")) + (post-return (core func $cm "f-pr")) )) (func (export "check") (result u32) (canon lift (core func $cm "check") @@ -313,7 +313,7 @@ )))) (func (export "f") (result u32) (canon lift (core func $cm "f") - (post-return (func $cm "f-pr")) + (post-return (core func $cm "f-pr")) )) (func (export "check") (result u32) (canon lift (core func $cm "check") @@ -344,7 +344,7 @@ )))) (func (export "f") (result u32) (canon lift (core func $cm "f") - (post-return (func $cm "f-pr")) + (post-return (core func $cm "f-pr")) )) ) (assert_return (invoke "f") (u32.const 11)) @@ -374,7 +374,7 @@ )))) (func (export "f") (result u32) (canon lift (core func $cm "f") - (post-return (func $cm "f-pr")) + (post-return (core func $cm "f-pr")) )) (func (export "check") (result u32) (canon lift (core func $cm "check") diff --git a/test/values/strings.wast b/test/values/strings.wast index e838ccdd..034d4908 100644 --- a/test/values/strings.wast +++ b/test/values/strings.wast @@ -18,8 +18,8 @@ ;; TODO: so many cases left to test, everyone feel free to fill in... ) (core instance $m (instantiate $M)) - (func (export "f1") (result string) (canon lift (core func $m "f1") (memory $m "mem"))) - (func (export "f2") (result string) (canon lift (core func $m "f2") (memory $m "mem"))) + (func (export "f1") (result string) (canon lift (core func $m "f1") (memory (core memory $m "mem")))) + (func (export "f2") (result string) (canon lift (core func $m "f2") (memory (core memory $m "mem")))) ) (assert_return (invoke "f1") (str.const "a")) (assert_return (invoke "f2") (str.const "☃☺️öツ")) @@ -35,7 +35,7 @@ ) ) (core instance $m (instantiate $M)) - (func (export "f") (result string) (canon lift (core func $m "f") (memory $m "mem"))) + (func (export "f") (result string) (canon lift (core func $m "f") (memory (core memory $m "mem")))) ) (assert_return (invoke "f") (str.const "")) @@ -50,7 +50,7 @@ ) ) (core instance $m (instantiate $M)) - (func (export "f") (result string) (canon lift (core func $m "f") (memory $m "mem"))) + (func (export "f") (result string) (canon lift (core func $m "f") (memory (core memory $m "mem")))) ) (assert_return (invoke "f") (str.const "")) @@ -65,7 +65,7 @@ ) ) (core instance $m (instantiate $M)) - (func (export "f") (result string) (canon lift (core func $m "f") (memory $m "mem"))) + (func (export "f") (result string) (canon lift (core func $m "f") (memory (core memory $m "mem")))) ) (assert_trap (invoke "f") "string pointer/length out of bounds of memory") @@ -81,7 +81,7 @@ ) ) (core instance $m (instantiate $M)) - (func (export "f") (result string) (canon lift (core func $m "f") (memory $m "mem"))) + (func (export "f") (result string) (canon lift (core func $m "f") (memory (core memory $m "mem")))) ) (assert_trap (invoke "f") "invalid utf-8") @@ -97,7 +97,7 @@ ) ) (core instance $m (instantiate $M)) - (func (export "f") (result string) (canon lift (core func $m "f") (memory $m "mem"))) + (func (export "f") (result string) (canon lift (core func $m "f") (memory (core memory $m "mem")))) ) (assert_trap (invoke "f") "incomplete utf-8 byte sequence") @@ -115,7 +115,7 @@ ) ) (core instance $m (instantiate $M)) - (func (export "f") (result string) (canon lift (core func $m "f") (memory $m "mem"))) + (func (export "f") (result string) (canon lift (core func $m "f") (memory (core memory $m "mem")))) ) (assert_return (invoke "f") (str.const "ok")) @@ -131,6 +131,6 @@ ) ) (core instance $m (instantiate $M)) - (func (export "f") (result string) (canon lift (core func $m "f") (memory $m "mem"))) + (func (export "f") (result string) (canon lift (core func $m "f") (memory (core memory $m "mem")))) ) (assert_trap (invoke "f") "string pointer/length out of bounds of memory") diff --git a/test/wasm-tools/adapt.wast b/test/wasm-tools/adapt.wast index 8cc76f8f..44f195e2 100644 --- a/test/wasm-tools/adapt.wast +++ b/test/wasm-tools/adapt.wast @@ -106,7 +106,7 @@ (import "i" (func $f)) (core module $m (memory (export "memory") 1)) (core instance $i (instantiate $m)) - (core func (canon lower (func $f) (memory $i "memory") (memory $i "memory"))) + (core func (canon lower (func $f) (memory (core memory $i "memory")) (memory (core memory $i "memory")))) ) "`memory` is specified more than once") @@ -129,7 +129,7 @@ (core instance $i (instantiate $m)) (func (param "p1" (list u8)) (canon lift (core func $i "f") - (memory $i "m") + (memory (core memory $i "m")) ) ) ) @@ -145,9 +145,9 @@ (core instance $i (instantiate $m)) (func (param "p1" (list u8)) (canon lift (core func $i "f") - (memory $i "m") - (realloc (func $i "r")) - (realloc (func $i "r")) + (memory (core memory $i "m")) + (realloc (core func $i "r")) + (realloc (core func $i "r")) ) ) ) @@ -163,8 +163,8 @@ (core instance $i (instantiate $m)) (func (param "p1" (list u8)) (canon lift (core func $i "f") - (memory $i "m") - (realloc (func $i "r")) + (memory (core memory $i "m")) + (realloc (core func $i "r")) ) ) ) @@ -181,9 +181,9 @@ (core instance $i (instantiate $m)) (func (result string) (canon lift (core func $i "f") - (memory $i "m") - (realloc (func $i "r")) - (post-return (func $i "p")) + (memory (core memory $i "m")) + (realloc (core func $i "r")) + (post-return (core func $i "p")) ) ) ) @@ -200,10 +200,10 @@ (core instance $i (instantiate $m)) (func (result string) (canon lift (core func $i "f") - (memory $i "m") - (realloc (func $i "r")) - (post-return (func $i "p")) - (post-return (func $i "p")) + (memory (core memory $i "m")) + (realloc (core func $i "r")) + (post-return (core func $i "p")) + (post-return (core func $i "p")) ) ) ) @@ -221,9 +221,9 @@ (core instance $i (instantiate $m)) (core func (canon lower (func $f) - (memory $i "m") - (realloc (func $i "r")) - (post-return (func $i "p")) + (memory (core memory $i "m")) + (realloc (core func $i "r")) + (post-return (core func $i "p")) ) ) ) @@ -239,9 +239,9 @@ (core instance $i (instantiate $m)) (func (result string) (canon lift (core func $i "f") - (memory $i "m") - (realloc (func $i "r")) - (post-return (func $i "p")) + (memory (core memory $i "m")) + (realloc (core func $i "r")) + (post-return (core func $i "p")) ) ) ) diff --git a/test/wasm-tools/big.wast b/test/wasm-tools/big.wast index 770df0ab..e3f23ccf 100644 --- a/test/wasm-tools/big.wast +++ b/test/wasm-tools/big.wast @@ -11,7 +11,7 @@ (core instance $libc (instantiate $Libc)) (core func $log (canon lower (func $logging "log") - (memory $libc "memory") (realloc (func $libc "realloc")) + (memory (core memory $libc "memory")) (realloc (core func $libc "realloc")) )) (core module $Main (import "libc" "memory" (memory 1)) @@ -30,7 +30,7 @@ )) (func $run (param "in" string) (result string) (canon lift (core func $main "run") - (memory $libc "memory") (realloc (func $libc "realloc")) + (memory (core memory $libc "memory")) (realloc (core func $libc "realloc")) )) (export "run" (func $run)) ) diff --git a/test/wasm-tools/func.wast b/test/wasm-tools/func.wast index 4a207f99..55ccca69 100644 --- a/test/wasm-tools/func.wast +++ b/test/wasm-tools/func.wast @@ -42,7 +42,7 @@ (memory (export "memory") 1) ) (core instance $libc (instantiate $libc)) - (core func (canon lower (func $log) (memory $libc "memory"))) + (core func (canon lower (func $log) (memory (core memory $libc "memory")))) ) (component @@ -53,7 +53,7 @@ (core instance $i (instantiate $m)) (func (export "ret-list") (result (list u8)) - (canon lift (core func $i "ret-list") (memory $i "memory")) + (canon lift (core func $i "ret-list") (memory (core memory $i "memory"))) ) ) @@ -69,7 +69,7 @@ (import "big" (func $big (type $big))) (core module $libc (memory (export "memory") 1)) (core instance $libc (instantiate $libc)) - (core func $big (canon lower (func $big) (memory $libc "memory"))) + (core func $big (canon lower (func $big) (memory (core memory $libc "memory")))) ) ) @@ -89,7 +89,7 @@ )) (func $roundtrip (type $roundtrip) - (canon lift (core func $m "roundtrip") (memory $m "memory")) + (canon lift (core func $m "roundtrip") (memory (core memory $m "memory"))) ) (export "roundtrip" (func $roundtrip)) ) @@ -103,7 +103,7 @@ (memory (export "memory") 1) ) (core instance $libc (instantiate $libc)) - (core func (canon lower (func $log) (memory $libc "memory"))) + (core func (canon lower (func $log) (memory (core memory $libc "memory")))) ) "canonical option `realloc` is required" ) @@ -117,7 +117,7 @@ (core instance $i (instantiate $m)) (func (export "param-list") (param "bytes" (list u8)) - (canon lift (core func $i "param-list") (memory $i "memory")) + (canon lift (core func $i "param-list") (memory (core memory $i "memory"))) ) ) "canonical option `realloc` is required" diff --git a/test/wasm-tools/memory64.wast b/test/wasm-tools/memory64.wast index 1832dc15..36edaec5 100644 --- a/test/wasm-tools/memory64.wast +++ b/test/wasm-tools/memory64.wast @@ -51,5 +51,5 @@ (core instance $A (instantiate $A)) (alias core export $A "m" (core memory $m)) (core func $realloc (alias core export $A "realloc")) - (core func (canon lower (func $x) (memory $m) (realloc (func $realloc)))) + (core func (canon lower (func $x) (memory $m) (realloc (core func $realloc)))) ) diff --git a/test/wasm-tools/resources.wast b/test/wasm-tools/resources.wast index 14509c54..dd2ad7fd 100644 --- a/test/wasm-tools/resources.wast +++ b/test/wasm-tools/resources.wast @@ -23,7 +23,7 @@ (func (export "dtor") (param i32)) ) (core instance $m (instantiate $m)) - (type $x (resource (rep i32) (dtor (func $m "dtor")))) + (type $x (resource (rep i32) (dtor (core func $m "dtor")))) (core func (canon resource.new $x)) ) @@ -127,14 +127,14 @@ (func (export "dtor")) ) (core instance $m (instantiate $m)) - (type $x (resource (rep i32) (dtor (func $m "dtor")))) + (type $x (resource (rep i32) (dtor (core func $m "dtor")))) (core func (canon resource.new $x)) ) "wrong signature for a destructor") (assert_invalid (component - (type (resource (rep i32) (dtor (func 100)))) + (type (resource (rep i32) (dtor (core func 100)))) ) "function index out of bounds") diff --git a/test/wasm-tools/virtualize.wast b/test/wasm-tools/virtualize.wast index d60b73b9..d86f108f 100644 --- a/test/wasm-tools/virtualize.wast +++ b/test/wasm-tools/virtualize.wast @@ -26,8 +26,8 @@ (core func $wasi_file_read (canon lower (func $wasi-file "read") - (memory $libc "mem") - (realloc (func $libc "realloc")) + (memory (core memory $libc "mem")) + (realloc (core func $libc "realloc")) ) ) @@ -102,8 +102,8 @@ (core func $real-wasi-read (canon lower (func $real-wasi "read") - (memory $libc "mem") - (realloc (func $libc "realloc")) + (memory (core memory $libc "mem")) + (realloc (core func $libc "realloc")) ) ) @@ -111,8 +111,8 @@ (core instance $child (instantiate $CHILD (with "wasi-file" (instance $virt-wasi)))) (func (export "work") (canon lift (core func $child "play") - (memory $libc "mem") - (realloc (func $libc "realloc")) + (memory (core memory $libc "mem")) + (realloc (core func $libc "realloc")) ) ) ) diff --git a/test/wasmtime/adapter.wast b/test/wasmtime/adapter.wast index 8432d584..9d8a7f5c 100644 --- a/test/wasmtime/adapter.wast +++ b/test/wasmtime/adapter.wast @@ -40,8 +40,8 @@ (func (export "thunk") (param "a" string) (canon lift (core func $i "") - (memory $i "memory") - (realloc (func $i "realloc")) + (memory (core memory $i "memory")) + (realloc (core func $i "realloc")) ) ) @@ -49,8 +49,8 @@ (canon lift (core func $i "") string-encoding=utf8 - (memory $i "memory") - (realloc (func $i "realloc")) + (memory (core memory $i "memory")) + (realloc (core func $i "realloc")) ) ) @@ -58,8 +58,8 @@ (canon lift (core func $i "") string-encoding=utf16 - (memory $i "memory") - (realloc (func $i "realloc")) + (memory (core memory $i "memory")) + (realloc (core func $i "realloc")) ) ) @@ -67,8 +67,8 @@ (canon lift (core func $i "") string-encoding=latin1+utf16 - (memory $i "memory") - (realloc (func $i "realloc")) + (memory (core memory $i "memory")) + (realloc (core func $i "realloc")) ) ) ) @@ -128,8 +128,8 @@ (func $f (param "a" (list $t)) (canon lift (core func $m "x") - (realloc (func $m "realloc")) - (memory $m "memory") + (realloc (core func $m "realloc")) + (memory (core memory $m "memory")) ) ) (export "empty-list" (func $f)) diff --git a/test/wasmtime/fused.wast b/test/wasmtime/fused.wast index 87fe8463..ba9155a0 100644 --- a/test/wasmtime/fused.wast +++ b/test/wasmtime/fused.wast @@ -162,8 +162,8 @@ (core instance $m (instantiate $m)) (func (export "roundtrip") (type $roundtrip) - (canon lift (core func $m "roundtrip") (memory $m "memory") - (realloc (func $m "realloc"))) + (canon lift (core func $m "roundtrip") (memory (core memory $m "memory")) + (realloc (core func $m "realloc"))) ) ) (instance $a (instantiate $a)) @@ -191,8 +191,8 @@ (core instance $libc (instantiate $libc)) (core func $roundtrip (canon lower (func $a "roundtrip") - (memory $libc "memory") - (realloc (func $libc "realloc")) ;; FIXME(wasm-tools#693) should not be necessary + (memory (core memory $libc "memory")) + (realloc (core func $libc "realloc")) ;; FIXME(wasm-tools#693) should not be necessary ) ) @@ -341,8 +341,8 @@ (func $foo (param "a" $tuple20) (canon lift (core func $m "foo") - (memory $m "memory") - (realloc (func $realloc)) + (memory (core memory $m "memory")) + (realloc (core func $realloc)) ) ) @@ -357,8 +357,8 @@ (core instance $libc (instantiate $libc)) (core func $foo (canon lower (func $foo) - (memory $libc "memory") - (realloc (func $libc "realloc")) ;; FIXME(wasm-tools#693) should not be necessary + (memory (core memory $libc "memory")) + (realloc (core func $libc "realloc")) ;; FIXME(wasm-tools#693) should not be necessary ) ) (core module $something @@ -432,7 +432,7 @@ ) ) (core instance $m (instantiate $m)) - (func (export "foo") (canon lift (core func $m "foo") (post-return (func $m "foo-post")))) + (func (export "foo") (canon lift (core func $m "foo") (post-return (core func $m "foo-post")))) (func (export "assert-post") (canon lift (core func $m "assert-post"))) ) (instance $a (instantiate $a)) @@ -475,7 +475,7 @@ ) (core instance $m (instantiate $m)) (func (export "foo") (result u32) - (canon lift (core func $m "foo") (post-return (func $m "foo-post")))) + (canon lift (core func $m "foo") (post-return (core func $m "foo-post")))) ) (instance $a (instantiate $a)) @@ -510,14 +510,14 @@ ) (core instance $m (instantiate $m)) (func (export "r") (result (tuple u32 u32)) - (canon lift (core func $m "r") (memory $m "memory")) + (canon lift (core func $m "r") (memory (core memory $m "memory"))) ) ) (component $c2 (import "r" (func $r (result (tuple u32 u32)))) (core module $libc (memory (export "memory") 1)) (core instance $libc (instantiate $libc)) - (core func $r (canon lower (func $r) (memory $libc "memory"))) + (core func $r (canon lower (func $r) (memory (core memory $libc "memory")))) (core module $m (import "" "r" (func $r (param i32))) @@ -546,14 +546,14 @@ ) (core instance $m (instantiate $m)) (func (export "r") (result (tuple u32 u32)) - (canon lift (core func $m "r") (memory $m "memory")) + (canon lift (core func $m "r") (memory (core memory $m "memory"))) ) ) (component $c2 (import "r" (func $r (result (tuple u32 u32)))) (core module $libc (memory (export "memory") 1)) (core instance $libc (instantiate $libc)) - (core func $r (canon lower (func $r) (memory $libc "memory"))) + (core func $r (canon lower (func $r) (memory (core memory $libc "memory")))) (core module $m (import "" "r" (func $r (param i32))) @@ -586,7 +586,7 @@ ) (core instance $m (instantiate $m)) (func (export "r") (param "a" $big) - (canon lift (core func $m "r") (memory $m "memory") (realloc (func $m "realloc"))) + (canon lift (core func $m "r") (memory (core memory $m "memory")) (realloc (core func $m "realloc"))) ) ) (component $c2 @@ -598,8 +598,8 @@ (core instance $libc (instantiate $libc)) (core func $r (canon lower (func $r) - (memory $libc "memory") - (realloc (func $libc "realloc")) ;; FIXME(wasm-tools#693) should not be necessary + (memory (core memory $libc "memory")) + (realloc (core func $libc "realloc")) ;; FIXME(wasm-tools#693) should not be necessary ) ) @@ -634,7 +634,7 @@ ) (core instance $m (instantiate $m)) (func (export "r") (param "a" $big) - (canon lift (core func $m "r") (memory $m "memory") (realloc (func $m "realloc"))) + (canon lift (core func $m "r") (memory (core memory $m "memory")) (realloc (core func $m "realloc"))) ) ) (component $c2 @@ -646,8 +646,8 @@ (core instance $libc (instantiate $libc)) (core func $r (canon lower (func $r) - (memory $libc "memory") - (realloc (func $libc "realloc")) ;; FIXME(wasm-tools#693) should not be necessary + (memory (core memory $libc "memory")) + (realloc (core func $libc "realloc")) ;; FIXME(wasm-tools#693) should not be necessary ) ) @@ -1376,7 +1376,7 @@ ;; that the adapter module containing this must be placed in the right ;; location. (core func $execute - (canon lower (func $i "execute") (memory $m "memory") (realloc (func $m "realloc"))) + (canon lower (func $i "execute") (memory (core memory $m "memory")) (realloc (core func $m "realloc"))) ) (core instance (instantiate $shim2 (with "" (instance diff --git a/test/wasmtime/resources.wast b/test/wasmtime/resources.wast index 28e68ad7..5f58a0a5 100644 --- a/test/wasmtime/resources.wast +++ b/test/wasmtime/resources.wast @@ -678,7 +678,7 @@ (core instance $i1 (instantiate $m1)) (type $r1 (resource (rep i32))) - (type $r2 (resource (rep i32) (dtor (func $i1 "dtor")))) + (type $r2 (resource (rep i32) (dtor (core func $i1 "dtor")))) (core func $drop1 (canon resource.drop $r1)) (core func $drop2 (canon resource.drop $r2)) diff --git a/test/wasmtime/strings.wast b/test/wasmtime/strings.wast index 943fd311..bc0de08b 100644 --- a/test/wasmtime/strings.wast +++ b/test/wasmtime/strings.wast @@ -11,7 +11,7 @@ ) (core instance $m (instantiate $m)) (func (export "a") (param "a" string) - (canon lift (core func $m "") (realloc (func $m "realloc")) (memory $m "memory")) + (canon lift (core func $m "") (realloc (core func $m "realloc")) (memory (core memory $m "memory"))) ) ) @@ -21,7 +21,7 @@ (memory (export "memory") 1) ) (core instance $libc (instantiate $libc)) - (core func $f (canon lower (func $f) string-encoding=utf16 (memory $libc "memory"))) + (core func $f (canon lower (func $f) string-encoding=utf16 (memory (core memory $libc "memory")))) (core module $m (import "" "" (func $f (param i32 i32))) @@ -47,7 +47,7 @@ ) (core instance $m (instantiate $m)) (func (export "a") (param "a" string) - (canon lift (core func $m "") (realloc (func $m "realloc")) (memory $m "memory")) + (canon lift (core func $m "") (realloc (core func $m "realloc")) (memory (core memory $m "memory"))) ) ) @@ -57,7 +57,7 @@ (memory (export "memory") 1) ) (core instance $libc (instantiate $libc)) - (core func $f (canon lower (func $f) string-encoding=latin1+utf16 (memory $libc "memory"))) + (core func $f (canon lower (func $f) string-encoding=latin1+utf16 (memory (core memory $libc "memory")))) (core module $m (import "" "" (func $f (param i32 i32))) @@ -83,7 +83,7 @@ ) (core instance $m (instantiate $m)) (func (export "a") (param "a" string) - (canon lift (core func $m "") (realloc (func $m "realloc")) (memory $m "memory") + (canon lift (core func $m "") (realloc (core func $m "realloc")) (memory (core memory $m "memory")) string-encoding=utf8) ) ) @@ -94,7 +94,7 @@ (memory (export "memory") 1) ) (core instance $libc (instantiate $libc)) - (core func $f (canon lower (func $f) string-encoding=utf8 (memory $libc "memory"))) + (core func $f (canon lower (func $f) string-encoding=utf8 (memory (core memory $libc "memory")))) (core module $m (import "" "" (func $f (param i32 i32)))