Skip to content
Closed
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
4 changes: 2 additions & 2 deletions crates/environ/src/component/info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ pub enum GlobalInitializer {
/// from its `export` and stored into the `VMComponentContext` at the
/// `index` specified. During this extraction, we will also capture the
/// table's containing instance pointer to access the table at runtime. This
/// extraction is useful for `thread.spawn_indirect`.
/// extraction is useful for `thread.spawn-indirect`.
ExtractTable(ExtractTable),

/// Declares a new defined resource within this component.
Expand Down Expand Up @@ -1127,7 +1127,7 @@ pub enum Trampoline {
/// Intrinsic used to implement the `thread.index` component model builtin.
ThreadIndex,

/// Intrinsic used to implement the `thread.new_indirect` component model builtin.
/// Intrinsic used to implement the `thread.new-indirect` component model builtin.
ThreadNewIndirect {
/// The specific component instance which is calling the intrinsic.
instance: RuntimeComponentInstanceIndex,
Expand Down
10 changes: 0 additions & 10 deletions crates/test-util/src/wast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -666,16 +666,6 @@ impl WastTest {
let failing_component_model_tests = [
// FIXME(#11683)
"component-model/test/values/trap-in-post-return.wast",
// Awaiting https://github.com/WebAssembly/component-model/pull/570
"component-model/test/resources/multiple-resources.wast",
"component-model/test/async/empty-wait.wast",
"component-model/test/async/drop-stream.wast",
"component-model/test/async/passing-resources.wast",
"component-model/test/async/async-calls-sync.wast",
"component-model/test/async/partial-stream-copies.wast",
"component-model/test/async/futures-must-write.wast",
"component-model/test/async/cancel-stream.wast",
"component-model/test/async/drop-waitable-set.wast",
];
if failing_component_model_tests
.iter()
Expand Down
4 changes: 2 additions & 2 deletions crates/wasmtime/src/runtime/component/concurrent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2924,7 +2924,7 @@ impl Instance {
.unwrap())
}

/// Implements the `thread.new_indirect` intrinsic.
/// Implements the `thread.new-indirect` intrinsic.
pub(crate) fn thread_new_indirect<T: 'static>(
self,
mut store: StoreContextMut<T>,
Expand Down Expand Up @@ -3495,7 +3495,7 @@ pub trait VMComponentAsyncStore {
debug_msg_address: u32,
) -> Result<()>;

/// The `thread.new_indirect` intrinsic
/// The `thread.new-indirect` intrinsic
fn thread_new_indirect(
&mut self,
instance: Instance,
Expand Down
10 changes: 5 additions & 5 deletions tests/all/component_model/async.rs
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ async fn task_deletion() -> Result<()> {
(import "" "mem" (memory 1))
(import "" "task.return" (func $task-return (param i32)))
(import "" "task.cancel" (func $task-cancel))
(import "" "thread.new_indirect" (func $thread-new-indirect (param i32 i32) (result i32)))
(import "" "thread.new-indirect" (func $thread-new-indirect (param i32 i32) (result i32)))
(import "" "thread.suspend" (func $thread-suspend (result i32)))
(import "" "thread.suspend-cancellable" (func $thread-suspend-cancellable (result i32)))
(import "" "thread.yield-to" (func $thread-yield-to (param i32) (result i32)))
Expand Down Expand Up @@ -419,22 +419,22 @@ async fn task_deletion() -> Result<()> {
(i32.const 0 (; EXIT ;)))


;; Initialize the function table that will be used by thread.new_indirect
;; Initialize the function table that will be used by thread.new-indirect
(elem (table $indirect-function-table) (i32.const 0 (; call-return-ftbl-idx ;)) func $call-return)
(elem (table $indirect-function-table) (i32.const 1 (; suspend-ftbl-idx ;)) func $suspend)
(elem (table $indirect-function-table) (i32.const 2 (; yield-loop-ftbl-idx ;)) func $yield-loop)
)

;; Instantiate the libc module to get the table
(core instance $libc (instantiate $libc))
;; Get access to `thread.new_indirect` that uses the table from libc
;; Get access to `thread.new-indirect` that uses the table from libc
(core type $start-func-ty (func (param i32)))
(alias core export $libc "__indirect_function_table" (core table $indirect-function-table))

(core func $task-return (canon task.return (result u32)))
(core func $task-cancel (canon task.cancel))
(core func $thread-new-indirect
(canon thread.new_indirect $start-func-ty (table $indirect-function-table)))
(canon thread.new-indirect $start-func-ty (table $indirect-function-table)))
(core func $thread-yield (canon thread.yield))
(core func $thread-yield-cancellable (canon thread.yield cancellable))
(core func $thread-index (canon thread.index))
Expand All @@ -456,7 +456,7 @@ async fn task_deletion() -> Result<()> {
(export "mem" (memory $memory "mem"))
(export "task.return" (func $task-return))
(export "task.cancel" (func $task-cancel))
(export "thread.new_indirect" (func $thread-new-indirect))
(export "thread.new-indirect" (func $thread-new-indirect))
(export "thread.index" (func $thread-index))
(export "thread.yield-to" (func $thread-yield-to))
(export "thread.yield-to-cancellable" (func $thread-yield-to-cancellable))
Expand Down
12 changes: 6 additions & 6 deletions tests/all/component_model/func.rs
Original file line number Diff line number Diff line change
Expand Up @@ -968,7 +968,7 @@ async fn missing_task_return_call_stackless_explicit_thread() -> Result<()> {
(table (export "__indirect_function_table") 1 funcref))
(core module $m
(import "" "task.return" (func $task-return))
(import "" "thread.new_indirect" (func $thread-new-indirect (param i32 i32) (result i32)))
(import "" "thread.new-indirect" (func $thread-new-indirect (param i32 i32) (result i32)))
(import "" "thread.resume-later" (func $thread-resume-later (param i32)))
(import "libc" "__indirect_function_table" (table $indirect-function-table 1 funcref))
(func $thread-start (param i32) (; empty ;))
Expand All @@ -984,12 +984,12 @@ async fn missing_task_return_call_stackless_explicit_thread() -> 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 (table $indirect-function-table)))
(core func $thread-resume-later (canon thread.resume-later))
(core func $task-return (canon task.return))
(core instance $i (instantiate $m
(with "" (instance
(export "thread.new_indirect" (func $thread-new-indirect))
(export "thread.new-indirect" (func $thread-new-indirect))
(export "thread.resume-later" (func $thread-resume-later))
(export "task.return" (func $task-return))
))
Expand All @@ -1010,7 +1010,7 @@ async fn missing_task_return_call_stackful_explicit_thread() -> Result<()> {
(table (export "__indirect_function_table") 1 funcref))
(core module $m
(import "" "task.return" (func $task-return))
(import "" "thread.new_indirect" (func $thread-new-indirect (param i32 i32) (result i32)))
(import "" "thread.new-indirect" (func $thread-new-indirect (param i32 i32) (result i32)))
(import "" "thread.resume-later" (func $thread-resume-later (param i32)))
(import "libc" "__indirect_function_table" (table $indirect-function-table 1 funcref))
(func $thread-start (param i32) (; empty ;))
Expand All @@ -1024,12 +1024,12 @@ async fn missing_task_return_call_stackful_explicit_thread() -> 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 (table $indirect-function-table)))
(core func $thread-resume-later (canon thread.resume-later))
(core func $task-return (canon task.return))
(core instance $i (instantiate $m
(with "" (instance
(export "thread.new_indirect" (func $thread-new-indirect))
(export "thread.new-indirect" (func $thread-new-indirect))
(export "thread.resume-later" (func $thread-resume-later))
(export "task.return" (func $task-return))
))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@
;; Defines the table for the thread start function
(core module $libc
(table (export "__indirect_function_table") 1 funcref))
;; Defines the thread start function and a function that calls thread.new_indirect
;; Defines the thread start function and a function that calls thread.new-indirect
(core module $m
;; Import the threading builtins and the table from libc
(import "" "thread.new_indirect" (func $thread-new-indirect (param i32 i32) (result i32)))
(import "" "thread.new-indirect" (func $thread-new-indirect (param i32 i32) (result i32)))
(import "" "thread.suspend" (func $thread-suspend (result i32)))
(import "" "thread.yield-to" (func $thread-yield-to (param i32) (result i32)))
(import "" "thread.switch-to" (func $thread-switch-to (param i32) (result i32)))
Expand Down Expand Up @@ -58,7 +58,7 @@
(export "thread-start" (func $thread-start))

;; Initialize the function table with our thread-start function; this will be
;; used by thread.new_indirect
;; used by thread.new-indirect
(elem (table $indirect-function-table) (i32.const 0) func $thread-start)

(func $new-thread (param i32)
Expand Down Expand Up @@ -94,12 +94,12 @@

;; Instantiate the libc module to get the table
(core instance $libc (instantiate $libc))
;; Get access to `thread.new_indirect` that uses the table from libc
;; Get access to `thread.new-indirect` that uses the table from libc
(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 (table $indirect-function-table)))
(core func $thread-yield (canon thread.yield))
(core func $thread-index (canon thread.index))
(core func $thread-yield-to (canon thread.yield-to))
Expand All @@ -111,7 +111,7 @@
(core instance $i (
instantiate $m
(with "" (instance
(export "thread.new_indirect" (func $thread-new-indirect))
(export "thread.new-indirect" (func $thread-new-indirect))
(export "thread.index" (func $thread-index))
(export "thread.yield-to" (func $thread-yield-to))
(export "thread.yield" (func $thread-yield))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
(core module $CM
(import "" "mem" (memory 1))
(import "" "task.cancel" (func $task-cancel))
(import "" "thread.new_indirect" (func $thread-new-indirect (param i32 i32) (result i32)))
(import "" "thread.new-indirect" (func $thread-new-indirect (param i32 i32) (result i32)))
(import "" "thread.suspend" (func $thread-suspend (result i32)))
(import "" "thread.suspend-cancellable" (func $thread-suspend-cancellable (result i32)))
(import "" "thread.yield-to" (func $thread-yield-to (param i32) (result i32)))
Expand Down Expand Up @@ -102,7 +102,7 @@
(if (i32.ne (call $thread-yield) (i32.const 0)) (then unreachable))
)

;; Initialize the function table that will be used by thread.new_indirect
;; Initialize the function table that will be used by thread.new-indirect
(elem (table $indirect-function-table) (i32.const 0 (; wake-from-suspend-ftbl-idx ;)) func $wake-from-suspend)
(elem (table $indirect-function-table) (i32.const 1 (; just-yield-ftbl-idx ;)) func $just-yield)

Expand Down Expand Up @@ -177,13 +177,13 @@

;; Instantiate the libc module to get the table
(core instance $libc (instantiate $libc))
;; Get access to `thread.new_indirect` that uses the table from libc
;; Get access to `thread.new-indirect` that uses the table from libc
(core type $start-func-ty (func (param i32)))
(alias core export $libc "__indirect_function_table" (core table $indirect-function-table))

(core func $task-cancel (canon task.cancel))
(core func $thread-new-indirect
(canon thread.new_indirect $start-func-ty (table $indirect-function-table)))
(canon thread.new-indirect $start-func-ty (table $indirect-function-table)))
(core func $thread-yield (canon thread.yield))
(core func $thread-yield-cancellable (canon thread.yield cancellable))
(core func $thread-index (canon thread.index))
Expand All @@ -205,7 +205,7 @@
(with "" (instance
(export "mem" (memory $memory "mem"))
(export "task.cancel" (func $task-cancel))
(export "thread.new_indirect" (func $thread-new-indirect))
(export "thread.new-indirect" (func $thread-new-indirect))
(export "thread.index" (func $thread-index))
(export "thread.yield-to" (func $thread-yield-to))
(export "thread.yield-to-cancellable" (func $thread-yield-to-cancellable))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
;; Defines the table for the thread start function
(core module $libc
(table (export "__indirect_function_table") 1 funcref))
;; Defines the thread start function and a function that calls thread.new_indirect
;; Defines the thread start function and a function that calls thread.new-indirect
(core module $m
;; Import the threading builtins and the table from libc
(import "" "thread.new_indirect" (func $thread-new-indirect (param i32 i32) (result i32)))
(import "" "thread.new-indirect" (func $thread-new-indirect (param i32 i32) (result i32)))
(import "" "thread.suspend" (func $thread-suspend (result i32)))
(import "" "thread.yield-to" (func $thread-yield-to (param i32) (result i32)))
(import "" "thread.switch-to" (func $thread-switch-to (param i32) (result i32)))
Expand Down Expand Up @@ -43,7 +43,7 @@
(export "thread-start" (func $thread-start))

;; Initialize the function table with our thread-start function; this will be
;; used by thread.new_indirect
;; used by thread.new-indirect
(elem (table $indirect-function-table) (i32.const 0) func $thread-start)

;; The main entry point, which spawns a new thread to run `thread-start`, passing 42
Expand All @@ -70,12 +70,12 @@

;; Instantiate the libc module to get the table
(core instance $libc (instantiate $libc))
;; Get access to `thread.new_indirect` that uses the table from libc
;; Get access to `thread.new-indirect` that uses the table from libc
(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 (table $indirect-function-table)))
(core func $thread-yield (canon thread.yield))
(core func $thread-index (canon thread.index))
(core func $thread-yield-to (canon thread.yield-to))
Expand All @@ -87,7 +87,7 @@
(core instance $i (
instantiate $m
(with "" (instance
(export "thread.new_indirect" (func $thread-new-indirect))
(export "thread.new-indirect" (func $thread-new-indirect))
(export "thread.index" (func $thread-index))
(export "thread.yield-to" (func $thread-yield-to))
(export "thread.yield" (func $thread-yield))
Expand Down
Loading