Remove the module linking implementation in Wasmtime (#3958)
* Remove the module linking implementation in Wasmtime This commit removes the experimental implementation of the module linking WebAssembly proposal from Wasmtime. The module linking is no longer intended for core WebAssembly but is instead incorporated into the component model now at this point. This means that very large parts of Wasmtime's implementation of module linking are no longer applicable and would change greatly with an implementation of the component model. The main purpose of this is to remove Wasmtime's reliance on the support for module-linking in `wasmparser` and tooling crates. With this reliance removed we can move over to the `component-model` branch of `wasmparser` and use the updated support for the component model. Additionally given the trajectory of the component model proposal the embedding API of Wasmtime will not look like what it looks like today for WebAssembly. For example the core wasm `Instance` will not change and instead a `Component` is likely to be added instead. Some more rationale for this is in #3941, but the basic idea is that I feel that it's not going to be viable to develop support for the component model on a non-`main` branch of Wasmtime. Additionaly I don't think it's viable, for the same reasons as `wasm-tools`, to support the old module linking proposal and the new component model at the same time. This commit takes a moment to not only delete the existing module linking implementation but some abstractions are also simplified. For example module serialization is a bit simpler that there's only one module. Additionally instantiation is much simpler since the only initializer we have to deal with are imports and nothing else. Closes #3941 * Fix doc link * Update comments
This commit is contained in:
@@ -213,31 +213,11 @@ entity_impl!(ElemIndex);
|
||||
pub struct TypeIndex(u32);
|
||||
entity_impl!(TypeIndex);
|
||||
|
||||
/// Index type of a module inside the WebAssembly module.
|
||||
#[derive(Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord, Debug, Serialize, Deserialize)]
|
||||
pub struct ModuleIndex(u32);
|
||||
entity_impl!(ModuleIndex);
|
||||
|
||||
/// Index type of an instance inside the WebAssembly module.
|
||||
#[derive(Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord, Debug, Serialize, Deserialize)]
|
||||
pub struct InstanceIndex(u32);
|
||||
entity_impl!(InstanceIndex);
|
||||
|
||||
/// Index type of an event inside the WebAssembly module.
|
||||
#[derive(Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord, Debug, Serialize, Deserialize)]
|
||||
pub struct TagIndex(u32);
|
||||
entity_impl!(TagIndex);
|
||||
|
||||
/// Specialized index for just module types.
|
||||
#[derive(Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord, Debug, Serialize, Deserialize)]
|
||||
pub struct ModuleTypeIndex(u32);
|
||||
entity_impl!(ModuleTypeIndex);
|
||||
|
||||
/// Specialized index for just instance types.
|
||||
#[derive(Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord, Debug, Serialize, Deserialize)]
|
||||
pub struct InstanceTypeIndex(u32);
|
||||
entity_impl!(InstanceTypeIndex);
|
||||
|
||||
/// An index of an entity.
|
||||
#[derive(Copy, Clone, PartialEq, Eq, Hash, PartialOrd, Ord, Debug, Serialize, Deserialize)]
|
||||
pub enum EntityIndex {
|
||||
@@ -249,10 +229,6 @@ pub enum EntityIndex {
|
||||
Memory(MemoryIndex),
|
||||
/// Global index.
|
||||
Global(GlobalIndex),
|
||||
/// Module index.
|
||||
Module(ModuleIndex),
|
||||
/// Instance index.
|
||||
Instance(InstanceIndex),
|
||||
}
|
||||
|
||||
/// A type of an item in a wasm module where an item is typically something that
|
||||
@@ -271,12 +247,6 @@ pub enum EntityType {
|
||||
/// A function type where the index points to the type section and records a
|
||||
/// function signature.
|
||||
Function(SignatureIndex),
|
||||
/// An instance where the index points to the type section and records a
|
||||
/// instance's exports.
|
||||
Instance(InstanceTypeIndex),
|
||||
/// A module where the index points to the type section and records a
|
||||
/// module's imports and exports.
|
||||
Module(ModuleTypeIndex),
|
||||
}
|
||||
|
||||
/// A WebAssembly global.
|
||||
|
||||
Reference in New Issue
Block a user