Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions benches/compile_time_builtins.rs
Original file line number Diff line number Diff line change
Expand Up @@ -433,8 +433,8 @@ mod inc_list {
(core instance $i (instantiate $m))
(func (export "inc-list") (param "xs" (list u8)) (result (list u8))
(canon lift (core func $i "inc-list")
(memory $i "memory")
(realloc (func $i "realloc")))
(memory (core memory $i "memory"))
(realloc (core func $i "realloc")))
)
)
"#;
Expand Down Expand Up @@ -658,8 +658,8 @@ mod inc_random {
(core instance $i (instantiate $m))
(func (export "inc-random") (param "i" u32) (param "xs" (list u8)) (result (list u8))
(canon lift (core func $i "inc-random")
(memory $i "memory")
(realloc (func $i "realloc")))
(memory (core memory $i "memory"))
(realloc (core func $i "realloc")))
)
)
"#;
Expand Down
8 changes: 4 additions & 4 deletions crates/c-api/tests/component/values.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ static std::string echo_component(std::string_view type, std::string_view func,
{}
)
(core instance $libc (instantiate $libc))
(core func $do_lower (canon lower (func $do) (memory $libc "memory") (realloc (func $libc "realloc"))))
(core func $do_lower (canon lower (func $do) (memory (core memory $libc "memory")) (realloc (core func $libc "realloc"))))

(core module $doer
(import "host" "do" (func $do {}))
Expand All @@ -50,8 +50,8 @@ static std::string echo_component(std::string_view type, std::string_view func,
(result $Foo)
(canon lift
(core func $doer "call")
(memory $libc "memory")
(realloc (func $libc "realloc")))
(memory (core memory $libc "memory"))
(realloc (core func $libc "realloc")))
)

(export "call" (func $call))
Expand Down Expand Up @@ -946,7 +946,7 @@ TEST(component, value_guest_resource) {
(func (export "last-dtor-rep") (result i32) global.get $g)
)
(core instance $a (instantiate $a))
(type $r' (resource (rep i32) (dtor (func $a "dtor"))))
(type $r' (resource (rep i32) (dtor (core func $a "dtor"))))
(export $r "r" (type $r'))

(core func $new (canon resource.new $r))
Expand Down
12 changes: 6 additions & 6 deletions crates/test-util/src/component_fuzz.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1532,7 +1532,7 @@ impl Declarations {
let lift_async_option = match lift_abi {
LiftAbi::Sync => "",
LiftAbi::AsyncStackful => "async",
LiftAbi::AsyncCallback => "async (callback (func $i \"callback\"))",
LiftAbi::AsyncCallback => "async (callback (core func $i \"callback\"))",
};

let mut intrinsic_defs = String::new();
Expand All @@ -1544,7 +1544,7 @@ impl Declarations {
intrinsic_defs.push_str(&format!(
r#"
(core func $task.return (canon task.return {results}
(memory $libc "memory") string-encoding={encoding}))
(memory (core memory $libc "memory")) string-encoding={encoding}))
"#,
));
intrinsic_imports.push_str(
Expand All @@ -1567,8 +1567,8 @@ impl Declarations {

(core func $f_lower (canon lower
(func $f)
(memory $libc "memory")
(realloc (func $libc "realloc"))
(memory (core memory $libc "memory"))
(realloc (core func $libc "realloc"))
string-encoding={encoding}
{lower_async_option}
))
Expand All @@ -1591,8 +1591,8 @@ impl Declarations {
(func (export "{EXPORT_FUNCTION}") (type $export_sig)
(canon lift
(core func $i "{EXPORT_FUNCTION}")
(memory $libc "memory")
(realloc (func $libc "realloc"))
(memory (core memory $libc "memory"))
(realloc (core func $libc "realloc"))
string-encoding={encoding}
{lift_async_option}
)
Expand Down
4 changes: 2 additions & 2 deletions tests/all/component_model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -284,8 +284,8 @@ fn make_echo_component_with_params(type_definition: &str, params: &[Param]) -> S
(func (export "echo") (param "a" $Foo) (result $Foo)
(canon lift
(core func $i "echo")
(memory $i "memory")
(realloc (func $i "realloc"))
(memory (core memory $i "memory"))
(realloc (core func $i "realloc"))
)
)
)"#
Expand Down
22 changes: 11 additions & 11 deletions tests/all/component_model/async.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ async fn resume_separate_thread() -> Result<()> {
(core func $yield
(canon lower
(func $yield)
(memory $libc "memory")
(realloc (func $libc "realloc"))
(memory (core memory $libc "memory"))
(realloc (core func $libc "realloc"))
)
)

Expand Down Expand Up @@ -195,8 +195,8 @@ async fn poll_through_wasm_activation() -> Result<()> {
(core instance $i (instantiate $m))
(func (export "run") (param "x" (list u8))
(canon lift (core func $i "run")
(memory $i "memory")
(realloc (func $i "realloc"))))
(memory (core memory $i "memory"))
(realloc (core func $i "realloc"))))
)
"#
);
Expand Down Expand Up @@ -355,7 +355,7 @@ async fn cancel_host_future() -> Result<()> {
)

(type $f (future u32))
(core func $future.read (canon future.read $f async (memory $libc "memory")))
(core func $future.read (canon future.read $f async (memory (core memory $libc "memory"))))
(core func $future.cancel-read (canon future.cancel-read $f))

(core instance $i (instantiate $m
Expand All @@ -368,7 +368,7 @@ async fn cancel_host_future() -> Result<()> {
(func (export "run") async (param "f" $f)
(canon lift
(core func $i "run")
(memory $libc "memory")
(memory (core memory $libc "memory"))
)
)
)
Expand Down Expand Up @@ -757,12 +757,12 @@ async fn stream_cancel_read_async_does_not_corrupt_state() -> Result<()> {
)

(type $s (stream u8))
(core func $stream.read (canon stream.read $s async (memory $libc "memory")))
(core func $stream.read (canon stream.read $s async (memory (core memory $libc "memory"))))
(core func $stream.cancel-read (canon stream.cancel-read $s async))
(core func $stream.drop-readable (canon stream.drop-readable $s))
(canon waitable.join (core func $waitable.join))
(canon waitable-set.new (core func $waitable-set.new))
(canon waitable-set.wait (memory $libc "memory") (core func $waitable-set.wait))
(canon waitable-set.wait (memory (core memory $libc "memory")) (core func $waitable-set.wait))
(canon waitable-set.drop (core func $waitable-set.drop))

(core instance $i (instantiate $m
Expand All @@ -780,7 +780,7 @@ async fn stream_cancel_read_async_does_not_corrupt_state() -> Result<()> {
(func (export "run") async (param "s" (stream u8))
(canon lift
(core func $i "run")
(memory $libc "memory")
(memory (core memory $libc "memory"))
)
)
)
Expand Down Expand Up @@ -874,7 +874,7 @@ async fn concurrent_sync_calls_to_async_host() -> Result<()> {
(core type $start-func-ty (func (param i32)))
(alias core export $libc "__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)))
(core func $thread-resume-later (canon thread.resume-later))

(core func $await-three-calls (canon lower (func $await-three-calls) ))
Expand Down Expand Up @@ -936,7 +936,7 @@ async fn bytes_stream_producer() -> Result<()> {
)
)
(type $s (stream u8))
(core func $stream.read (canon stream.read $s async (memory $libc "mem")))
(core func $stream.read (canon stream.read $s async (memory (core memory $libc "mem"))))
(core instance $i (instantiate $m
(with "" (instance
(export "mem" (memory $libc "mem"))
Expand Down
4 changes: 2 additions & 2 deletions tests/all/component_model/async_dynamic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ async fn stream_any_smoke() -> Result<()> {
(core func $task.return (canon task.return))
(core func $waitable-set.new (canon waitable-set.new))
(core func $waitable.join (canon waitable.join))
(core func $waitable-set.wait (canon waitable-set.wait (memory $libc "mem")))
(core func $waitable-set.wait (canon waitable-set.wait (memory (core memory $libc "mem"))))
(core func $waitable-set.drop (canon waitable-set.drop))
(core instance $i (instantiate $m
(with "" (instance
Expand All @@ -255,7 +255,7 @@ async fn stream_any_smoke() -> Result<()> {
(func (export "mk") (result (stream u8))
(canon lift (core func $i "mk")))
(func (export "run") async
(canon lift (core func $i "run") async (callback (func $i "cb"))))
(canon lift (core func $i "run") async (callback (core func $i "cb"))))
)
"#,
)?;
Expand Down
8 changes: 4 additions & 4 deletions tests/all/component_model/bindgen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ mod no_imports_concurrent {
))

(func $f (export "bar") async
(canon lift (core func $i "bar") async (callback (func $i "callback")))
(canon lift (core func $i "bar") async (callback (core func $i "callback")))
)

(instance $i (export "foo" (func $f)))
Expand Down Expand Up @@ -244,7 +244,7 @@ mod one_import_concurrent {
)
(func (export "callback") (param i32 i32 i32) (result i32) unreachable)
)
(core func $foo (canon lower (func $foo-instance "foo") async (memory $libc-instance "memory")))
(core func $foo (canon lower (func $foo-instance "foo") async (memory (core memory $libc-instance "memory"))))
(core func $task-return (canon task.return))
(core instance $i (instantiate $m
(with "" (instance
Expand All @@ -254,7 +254,7 @@ mod one_import_concurrent {
))

(func $f (export "bar") async
(canon lift (core func $i "bar") async (callback (func $i "callback")))
(canon lift (core func $i "bar") async (callback (core func $i "callback")))
)

(instance $i (export "foo" (func $f)))
Expand Down Expand Up @@ -676,7 +676,7 @@ mod exported_resources {
(table (export "$imports") 1 1 funcref)
)
(core instance $indirect-dtor (instantiate $indirect-dtor))
(type $b-x (resource (rep i32) (dtor (func $indirect-dtor "b-x-dtor"))))
(type $b-x (resource (rep i32) (dtor (core func $indirect-dtor "b-x-dtor"))))
(core func $b-x-drop (canon resource.drop $b-x))
(core func $b-x-rep (canon resource.rep $b-x))
(core func $b-x-new (canon resource.new $b-x))
Expand Down
12 changes: 6 additions & 6 deletions tests/all/component_model/bindgen/ownership.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,25 +52,25 @@ fn component() -> String {
(func $f_foo
(param "a" (list (list string)))
(result (list (list string)))
(canon lift (core func $i "core_foo_export") (memory $libc "memory")
(realloc (func $libc "realloc"))
(canon lift (core func $i "core_foo_export") (memory (core memory $libc "memory"))
(realloc (core func $libc "realloc"))
)
)

(type $thing (record (field "name" string) (field "value" (list string))))

(func $f_bar
(param "a" $thing)
(canon lift (core func $i "core_bar_export") (memory $libc "memory")
(realloc (func $libc "realloc"))
(canon lift (core func $i "core_bar_export") (memory (core memory $libc "memory"))
(realloc (core func $libc "realloc"))
)
)

(func $f_baz
(param "a" $thing)
(result $thing)
(canon lift (core func $i "core_baz_export") (memory $libc "memory")
(realloc (func $libc "realloc"))
(canon lift (core func $i "core_baz_export") (memory (core memory $libc "memory"))
(realloc (core func $libc "realloc"))
)
)

Expand Down
28 changes: 14 additions & 14 deletions tests/all/component_model/bindgen/results.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ mod empty_error {
)
)
(core func $core_empty_error
(canon lower (func $i "empty-error") (memory $libc "memory"))
(canon lower (func $i "empty-error") (memory (core memory $libc "memory")))
)
(core instance $i (instantiate $m
(with "" (instance (export "core_empty_error" (func $core_empty_error))))
Expand All @@ -55,7 +55,7 @@ mod empty_error {
(export "empty-error")
(param "a" f64)
(result (result f64))
(canon lift (core func $i "core_empty_error_export") (memory $libc "memory"))
(canon lift (core func $i "core_empty_error_export") (memory (core memory $libc "memory")))
)
)
"#,
Expand Down Expand Up @@ -159,7 +159,7 @@ mod string_error {
)
)
(core func $core_string_error
(canon lower (func $i "string-error") (memory $libc "memory") (realloc (func $libc "realloc")))
(canon lower (func $i "string-error") (memory (core memory $libc "memory")) (realloc (core func $libc "realloc")))
)
(core instance $i (instantiate $m
(with "" (instance (export "core_string_error" (func $core_string_error))))
Expand All @@ -169,7 +169,7 @@ mod string_error {
(export "string-error")
(param "a" f64)
(result (result f64 (error string)))
(canon lift (core func $i "core_string_error_export") (memory $libc "memory"))
(canon lift (core func $i "core_string_error_export") (memory (core memory $libc "memory")))
)
)
"#
Expand Down Expand Up @@ -317,7 +317,7 @@ mod enum_error {
)
)
(core func $core_enum_error
(canon lower (func $i "enum-error") (memory $libc "memory") (realloc (func $libc "realloc")))
(canon lower (func $i "enum-error") (memory (core memory $libc "memory")) (realloc (core func $libc "realloc")))
)
(core instance $i (instantiate $m
(with "" (instance (export "core_enum_error" (func $core_enum_error))))
Expand All @@ -326,7 +326,7 @@ mod enum_error {
(func $f_enum_error
(param "a" f64)
(result (result f64 (error $err')))
(canon lift (core func $i "core_enum_error_export") (memory $libc "memory"))
(canon lift (core func $i "core_enum_error_export") (memory (core memory $libc "memory")))
)

(component $nested
Expand Down Expand Up @@ -481,7 +481,7 @@ mod record_error {
)
)
(core func $core_record_error
(canon lower (func $i "record-error") (memory $libc "memory") (realloc (func $libc "realloc")))
(canon lower (func $i "record-error") (memory (core memory $libc "memory")) (realloc (core func $libc "realloc")))
)
(core instance $i (instantiate $m
(with "" (instance (export "core_record_error" (func $core_record_error))))
Expand All @@ -490,7 +490,7 @@ mod record_error {
(func $f_record_error
(param "a" f64)
(result (result f64 (error (record (field "line" u32) (field "col" u32)))))
(canon lift (core func $i "core_record_error_export") (memory $libc "memory"))
(canon lift (core func $i "core_record_error_export") (memory (core memory $libc "memory")))
)

(component $nested
Expand Down Expand Up @@ -662,7 +662,7 @@ mod variant_error {
)
)
(core func $core_variant_error
(canon lower (func $i "variant-error") (memory $libc "memory") (realloc (func $libc "realloc")))
(canon lower (func $i "variant-error") (memory (core memory $libc "memory")) (realloc (core func $libc "realloc")))
)
(core instance $i (instantiate $m
(with "" (instance (export "core_variant_error" (func $core_variant_error))))
Expand All @@ -671,7 +671,7 @@ mod variant_error {
(func $f_variant_error
(param "a" f64)
(result (result f64 (error $e3')))
(canon lift (core func $i "core_variant_error_export") (memory $libc "memory"))
(canon lift (core func $i "core_variant_error_export") (memory (core memory $libc "memory")))
)

(component $nested
Expand Down Expand Up @@ -849,7 +849,7 @@ mod multiple_interfaces_error {
)
)
(core func $core_enum_error
(canon lower (func $i "enum-error") (memory $libc "memory") (realloc (func $libc "realloc")))
(canon lower (func $i "enum-error") (memory (core memory $libc "memory")) (realloc (core func $libc "realloc")))
)
(core instance $i (instantiate $m
(with "" (instance (export "core_enum_error" (func $core_enum_error))))
Expand All @@ -858,7 +858,7 @@ mod multiple_interfaces_error {
(func $f_enum_error
(param "a" f64)
(result (result f64 (error $err')))
(canon lift (core func $i "core_enum_error_export") (memory $libc "memory"))
(canon lift (core func $i "core_enum_error_export") (memory (core memory $libc "memory")))
)

(component $nested
Expand Down Expand Up @@ -1025,7 +1025,7 @@ mod with_remapping {
)
)
(core func $core_empty_error
(canon lower (func $i "empty-error") (memory $libc "memory"))
(canon lower (func $i "empty-error") (memory (core memory $libc "memory")))
)
(core instance $i (instantiate $m
(with "" (instance (export "core_empty_error" (func $core_empty_error))))
Expand All @@ -1035,7 +1035,7 @@ mod with_remapping {
(export "empty-error")
(param "a" f64)
(result (result f64))
(canon lift (core func $i "core_empty_error_export") (memory $libc "memory"))
(canon lift (core func $i "core_empty_error_export") (memory (core memory $libc "memory")))
)
)
"#,
Expand Down
Loading
Loading