Update wasm-tools dependencies (#4970)

* Update wasm-tools dependencies

This update brings in a number of features such as:

* The component model binary format and AST has been slightly adjusted
  in a few locations. Names are dropped from parameters/results now in
  the internal representation since they were not used anyway. At this
  time the ability to bind a multi-return function has not been exposed.

* The `wasmparser` validator pass will now share allocations with prior
  functions, providing what's probably a very minor speedup for Wasmtime
  itself.

* The text format for many component-related tests now requires named
  parameters.

* Some new relaxed-simd instructions are updated to be ignored.

I hope to have a follow-up to expose the multi-return ability to the
embedding API of components.

* Update audit information for new crates
This commit is contained in:
Alex Crichton
2022-09-27 13:12:34 -05:00
committed by GitHub
parent 10deb9b7fe
commit 29c7de7340
31 changed files with 407 additions and 331 deletions

View File

@@ -626,32 +626,6 @@ impl<'a, 'data> Translator<'a, 'data> {
// Aliases of instance exports (either core or component) will be
// recorded as an initializer of the appropriate type with outer
// aliases handled specially via upvars and type processing.
Payload::AliasSection(s) => {
self.validator.alias_section(&s)?;
for alias in s {
let init = match alias? {
wasmparser::Alias::InstanceExport {
kind,
instance_index,
name,
} => {
let instance = ModuleInstanceIndex::from_u32(instance_index);
self.alias_module_instance_export(kind, instance, name)
}
wasmparser::Alias::Outer {
kind: wasmparser::OuterAliasKind::Type,
count,
index,
} => {
let index = TypeIndex::from_u32(index);
let ty = self.types.core_outer_type(count, index);
self.types.push_core_typedef(ty);
continue;
}
};
self.result.initializers.push(init);
}
}
Payload::ComponentAliasSection(s) => {
self.validator.component_alias_section(&s)?;
for alias in s {
@@ -670,6 +644,14 @@ impl<'a, 'data> Translator<'a, 'data> {
self.alias_component_outer(kind, count, index);
continue;
}
wasmparser::ComponentAlias::CoreInstanceExport {
kind,
instance_index,
name,
} => {
let instance = ModuleInstanceIndex::from_u32(instance_index);
self.alias_module_instance_export(kind, instance, name)
}
};
self.result.initializers.push(init);
}

View File

@@ -509,19 +509,14 @@ impl ComponentTypesBuilder {
);
assert!(prev.is_none());
}
wasmparser::ModuleTypeDeclaration::Alias(alias) => match alias {
wasmparser::Alias::Outer {
kind: wasmparser::OuterAliasKind::Type,
count,
index,
} => {
let ty = self.core_outer_type(*count, TypeIndex::from_u32(*index));
self.push_core_typedef(ty);
}
wasmparser::Alias::InstanceExport { .. } => {
unreachable!("invalid alias {alias:?}")
}
},
wasmparser::ModuleTypeDeclaration::OuterAlias {
kind: wasmparser::OuterAliasKind::Type,
count,
index,
} => {
let ty = self.core_outer_type(*count, TypeIndex::from_u32(*index));
self.push_core_typedef(ty);
}
}
}
@@ -640,12 +635,12 @@ impl ComponentTypesBuilder {
params: ty
.params
.iter()
.map(|(name, ty)| (name.map(|s| s.to_string()), self.valtype(ty)))
.map(|(_name, ty)| self.valtype(ty))
.collect(),
results: ty
.results
.iter()
.map(|(name, ty)| (name.map(|s| s.to_string()), self.valtype(ty)))
.map(|(_name, ty)| self.valtype(ty))
.collect(),
};
self.add_func_type(ty)
@@ -998,9 +993,9 @@ pub struct TypeComponentInstance {
pub struct TypeFunc {
/// The list of optionally named parameters for this function, and their
/// types.
pub params: Box<[(Option<String>, InterfaceType)]>,
pub params: Box<[InterfaceType]>,
/// The return values of this function.
pub results: Box<[(Option<String>, InterfaceType)]>,
pub results: Box<[InterfaceType]>,
}
/// All possible interface types that values can have.