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:
@@ -56,20 +56,6 @@ typedef struct wasmtime_memory {
|
||||
size_t index;
|
||||
} wasmtime_memory_t;
|
||||
|
||||
/// \brief Representation of a instance in Wasmtime.
|
||||
///
|
||||
/// Instances are represented with a 64-bit identifying integer in Wasmtime.
|
||||
/// They do not have any destructor associated with them. Instances cannot
|
||||
/// interoperate between #wasmtime_store_t instances and if the wrong instance
|
||||
/// is passed to the wrong store then it may trigger an assertion to abort the
|
||||
/// process.
|
||||
typedef struct wasmtime_instance {
|
||||
/// Internal identifier of what store this belongs to, never zero.
|
||||
uint64_t store_id;
|
||||
/// Internal index within the store.
|
||||
size_t index;
|
||||
} wasmtime_instance_t;
|
||||
|
||||
/// \brief Representation of a global in Wasmtime.
|
||||
///
|
||||
/// Globals are represented with a 64-bit identifying integer in Wasmtime.
|
||||
@@ -99,12 +85,6 @@ typedef uint8_t wasmtime_extern_kind_t;
|
||||
/// \brief Value of #wasmtime_extern_kind_t meaning that #wasmtime_extern_t is a
|
||||
/// memory
|
||||
#define WASMTIME_EXTERN_MEMORY 3
|
||||
/// \brief Value of #wasmtime_extern_kind_t meaning that #wasmtime_extern_t is
|
||||
/// an instance
|
||||
#define WASMTIME_EXTERN_INSTANCE 4
|
||||
/// \brief Value of #wasmtime_extern_kind_t meaning that #wasmtime_extern_t is
|
||||
/// a module
|
||||
#define WASMTIME_EXTERN_MODULE 5
|
||||
|
||||
/**
|
||||
* \typedef wasmtime_extern_union_t
|
||||
@@ -125,13 +105,6 @@ typedef union wasmtime_extern_union {
|
||||
wasmtime_table_t table;
|
||||
/// Field used if #wasmtime_extern_t::kind is #WASMTIME_EXTERN_MEMORY
|
||||
wasmtime_memory_t memory;
|
||||
/// Field used if #wasmtime_extern_t::kind is #WASMTIME_EXTERN_INSTANCE
|
||||
wasmtime_instance_t instance;
|
||||
/// Field used if #wasmtime_extern_t::kind is #WASMTIME_EXTERN_MODULE
|
||||
///
|
||||
/// Note that this may be an owned pointer depending on the ownership of the
|
||||
/// #wasmtime_extern_t container value.
|
||||
wasmtime_module_t *module;
|
||||
} wasmtime_extern_union_t;
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user