Update wasm-tools crates (#4246)
This commit updates the wasm-tools family of crates, notably pulling in the refactorings and updates from bytecodealliance/wasm-tools#621 for the latest iteration of the component model. This commit additionally updates all support for the component model for these changes, notably: * Many bits and pieces of type information was refactored. Many `FooTypeIndex` namings are now `TypeFooIndex`. Additionally there is now `TypeIndex` as well as `ComponentTypeIndex` for the two type index spaces in a component. * A number of new sections are now processed to handle the core and component variants. * Internal maps were split such as the `funcs` map into `component_funcs` and `funcs` (same for `instances`). * Canonical options are now processed individually instead of one bulk `into` definition. Overall this was not a major update to the internals of handling the component model in Wasmtime. Instead this was mostly a surface-level refactoring to make sure that everything lines up with the new binary format for components. * All text syntax used in tests was updated to the new syntax.
This commit is contained in:
@@ -1,30 +1,30 @@
|
||||
(component
|
||||
(module $m)
|
||||
(instance (instantiate (module $m)))
|
||||
(core module $m)
|
||||
(core instance (instantiate $m))
|
||||
)
|
||||
|
||||
(component
|
||||
(module $m
|
||||
(core module $m
|
||||
(func (export ""))
|
||||
)
|
||||
(instance $i (instantiate (module $m)))
|
||||
(core instance $i (instantiate $m))
|
||||
|
||||
(module $m2
|
||||
(core module $m2
|
||||
(func (import "" ""))
|
||||
)
|
||||
(instance (instantiate (module $m2) (with "" (instance $i))))
|
||||
(core instance (instantiate $m2 (with "" (instance $i))))
|
||||
)
|
||||
|
||||
(component
|
||||
(module $m
|
||||
(core module $m
|
||||
(func (export "a"))
|
||||
)
|
||||
(instance $i (instantiate (module $m)))
|
||||
(core instance $i (instantiate $m))
|
||||
|
||||
(module $m2
|
||||
(core module $m2
|
||||
(func (import "" "b"))
|
||||
)
|
||||
(instance (instantiate (module $m2)
|
||||
(core instance (instantiate $m2
|
||||
(with "" (instance (export "b" (func $i "a"))))
|
||||
))
|
||||
)
|
||||
@@ -32,15 +32,15 @@
|
||||
;; all kinds of imports for core wasm modules, and register a start function on
|
||||
;; one module to ensure that everything is correct
|
||||
(component
|
||||
(module $m
|
||||
(core module $m
|
||||
(func (export "a"))
|
||||
(table (export "b") 1 funcref)
|
||||
(memory (export "c") 1)
|
||||
(global (export "d") i32 i32.const 1)
|
||||
)
|
||||
(instance $i (instantiate (module $m)))
|
||||
(core instance $i (instantiate $m))
|
||||
|
||||
(module $m2
|
||||
(core module $m2
|
||||
(import "" "a" (func $f))
|
||||
(import "" "b" (table 1 funcref))
|
||||
(import "" "c" (memory 1))
|
||||
@@ -62,7 +62,7 @@
|
||||
(data (i32.const 0) "hello")
|
||||
(elem (i32.const 0) $start)
|
||||
)
|
||||
(instance (instantiate (module $m2)
|
||||
(core instance (instantiate $m2
|
||||
(with "" (instance $i))
|
||||
))
|
||||
)
|
||||
@@ -71,12 +71,12 @@
|
||||
;; sees the wrong value for the global import
|
||||
(assert_trap
|
||||
(component
|
||||
(module $m
|
||||
(core module $m
|
||||
(global (export "g") i32 i32.const 1)
|
||||
)
|
||||
(instance $i (instantiate (module $m)))
|
||||
(core instance $i (instantiate $m))
|
||||
|
||||
(module $m2
|
||||
(core module $m2
|
||||
(import "" "g" (global $g i32))
|
||||
|
||||
(func $start
|
||||
@@ -90,27 +90,27 @@
|
||||
|
||||
(start $start)
|
||||
)
|
||||
(instance (instantiate (module $m2) (with "" (instance $i))))
|
||||
(core instance (instantiate $m2 (with "" (instance $i))))
|
||||
)
|
||||
"unreachable")
|
||||
|
||||
;; shuffle around imports to get to what the target core wasm module needs
|
||||
(component
|
||||
(module $m
|
||||
(core module $m
|
||||
(func (export "1"))
|
||||
(table (export "2") 1 funcref)
|
||||
(memory (export "3") 1)
|
||||
(global (export "4") i32 i32.const 1)
|
||||
)
|
||||
(instance $i (instantiate (module $m)))
|
||||
(core instance $i (instantiate $m))
|
||||
|
||||
(module $m2
|
||||
(core module $m2
|
||||
(import "" "a" (func $f))
|
||||
(import "" "b" (table 1 funcref))
|
||||
(import "" "c" (memory 1))
|
||||
(import "" "d" (global $g i32))
|
||||
)
|
||||
(instance (instantiate (module $m2)
|
||||
(core instance (instantiate $m2
|
||||
(with "" (instance
|
||||
(export "a" (func $i "1"))
|
||||
(export "b" (table $i "2"))
|
||||
|
||||
Reference in New Issue
Block a user