Update wasm-tools crates (#3997)
* Update wasm-tools crates This commit updates the wasm-tools family of crates as used in Wasmtime. Notably this brings in the update which removes module linking support as well as a number of internal refactorings around names and such within wasmparser itself. This updates all of the wasm translation support which binds to wasmparser as appropriate. Other crates all had API-compatible changes for at least what Wasmtime used so no further changes were necessary beyond updating version requirements. * Update a test expectation
This commit is contained in:
@@ -289,7 +289,7 @@ impl<'dummy_environment> FuncEnvironment for DummyFuncEnvironment<'dummy_environ
|
||||
WasmType::F32 => ir::types::F32,
|
||||
WasmType::F64 => ir::types::F64,
|
||||
WasmType::V128 => ir::types::I8X16,
|
||||
WasmType::ExnRef | WasmType::FuncRef | WasmType::ExternRef => ir::types::R64,
|
||||
WasmType::FuncRef | WasmType::ExternRef => ir::types::R64,
|
||||
},
|
||||
})
|
||||
}
|
||||
@@ -685,7 +685,7 @@ impl<'data> ModuleEnvironment<'data> for DummyEnvironment {
|
||||
WasmType::F32 => ir::types::F32,
|
||||
WasmType::F64 => ir::types::F64,
|
||||
WasmType::V128 => ir::types::I8X16,
|
||||
WasmType::FuncRef | WasmType::ExternRef | WasmType::ExnRef => reference_type,
|
||||
WasmType::FuncRef | WasmType::ExternRef => reference_type,
|
||||
})
|
||||
};
|
||||
sig.params.extend(wasm.params().iter().map(&mut cvt));
|
||||
@@ -698,7 +698,7 @@ impl<'data> ModuleEnvironment<'data> for DummyEnvironment {
|
||||
&mut self,
|
||||
index: TypeIndex,
|
||||
module: &'data str,
|
||||
field: Option<&'data str>,
|
||||
field: &'data str,
|
||||
) -> WasmResult<()> {
|
||||
assert_eq!(
|
||||
self.info.functions.len(),
|
||||
@@ -708,7 +708,7 @@ impl<'data> ModuleEnvironment<'data> for DummyEnvironment {
|
||||
self.info.functions.push(Exportable::new(index));
|
||||
self.info
|
||||
.imported_funcs
|
||||
.push((String::from(module), String::from(field.unwrap())));
|
||||
.push((String::from(module), String::from(field)));
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -726,12 +726,12 @@ impl<'data> ModuleEnvironment<'data> for DummyEnvironment {
|
||||
&mut self,
|
||||
global: Global,
|
||||
module: &'data str,
|
||||
field: Option<&'data str>,
|
||||
field: &'data str,
|
||||
) -> WasmResult<()> {
|
||||
self.info.globals.push(Exportable::new(global));
|
||||
self.info
|
||||
.imported_globals
|
||||
.push((String::from(module), String::from(field.unwrap())));
|
||||
.push((String::from(module), String::from(field)));
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -744,12 +744,12 @@ impl<'data> ModuleEnvironment<'data> for DummyEnvironment {
|
||||
&mut self,
|
||||
table: Table,
|
||||
module: &'data str,
|
||||
field: Option<&'data str>,
|
||||
field: &'data str,
|
||||
) -> WasmResult<()> {
|
||||
self.info.tables.push(Exportable::new(table));
|
||||
self.info
|
||||
.imported_tables
|
||||
.push((String::from(module), String::from(field.unwrap())));
|
||||
.push((String::from(module), String::from(field)));
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -789,12 +789,12 @@ impl<'data> ModuleEnvironment<'data> for DummyEnvironment {
|
||||
&mut self,
|
||||
memory: Memory,
|
||||
module: &'data str,
|
||||
field: Option<&'data str>,
|
||||
field: &'data str,
|
||||
) -> WasmResult<()> {
|
||||
self.info.memories.push(Exportable::new(memory));
|
||||
self.info
|
||||
.imported_memories
|
||||
.push((String::from(module), String::from(field.unwrap())));
|
||||
.push((String::from(module), String::from(field)));
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
||||
@@ -8,9 +8,8 @@
|
||||
|
||||
use crate::state::FuncTranslationState;
|
||||
use crate::{
|
||||
DataIndex, ElemIndex, EntityType, FuncIndex, Global, GlobalIndex, Memory, MemoryIndex,
|
||||
SignatureIndex, Table, TableIndex, Tag, TagIndex, TypeIndex, WasmError, WasmFuncType,
|
||||
WasmResult, WasmType,
|
||||
DataIndex, ElemIndex, FuncIndex, Global, GlobalIndex, Memory, MemoryIndex, SignatureIndex,
|
||||
Table, TableIndex, Tag, TagIndex, TypeIndex, WasmError, WasmFuncType, WasmResult, WasmType,
|
||||
};
|
||||
use core::convert::From;
|
||||
use cranelift_codegen::cursor::FuncCursor;
|
||||
@@ -531,22 +530,6 @@ pub trait ModuleEnvironment<'data> {
|
||||
/// Declares a function signature to the environment.
|
||||
fn declare_type_func(&mut self, wasm_func_type: WasmFuncType) -> WasmResult<()>;
|
||||
|
||||
/// Declares a module type signature to the environment.
|
||||
fn declare_type_module(
|
||||
&mut self,
|
||||
imports: &[(&'data str, Option<&'data str>, EntityType)],
|
||||
exports: &[(&'data str, EntityType)],
|
||||
) -> WasmResult<()> {
|
||||
drop((imports, exports));
|
||||
Err(WasmError::Unsupported("module linking".to_string()))
|
||||
}
|
||||
|
||||
/// Declares an instance type signature to the environment.
|
||||
fn declare_type_instance(&mut self, exports: &[(&'data str, EntityType)]) -> WasmResult<()> {
|
||||
drop(exports);
|
||||
Err(WasmError::Unsupported("module linking".to_string()))
|
||||
}
|
||||
|
||||
/// Translates a type index to its signature index, only called for type
|
||||
/// indices which point to functions.
|
||||
fn type_to_signature(&self, index: TypeIndex) -> WasmResult<SignatureIndex> {
|
||||
@@ -565,7 +548,7 @@ pub trait ModuleEnvironment<'data> {
|
||||
&mut self,
|
||||
index: TypeIndex,
|
||||
module: &'data str,
|
||||
field: Option<&'data str>,
|
||||
field: &'data str,
|
||||
) -> WasmResult<()>;
|
||||
|
||||
/// Declares a table import to the environment.
|
||||
@@ -573,7 +556,7 @@ pub trait ModuleEnvironment<'data> {
|
||||
&mut self,
|
||||
table: Table,
|
||||
module: &'data str,
|
||||
field: Option<&'data str>,
|
||||
field: &'data str,
|
||||
) -> WasmResult<()>;
|
||||
|
||||
/// Declares a memory import to the environment.
|
||||
@@ -581,7 +564,7 @@ pub trait ModuleEnvironment<'data> {
|
||||
&mut self,
|
||||
memory: Memory,
|
||||
module: &'data str,
|
||||
field: Option<&'data str>,
|
||||
field: &'data str,
|
||||
) -> WasmResult<()>;
|
||||
|
||||
/// Declares an tag import to the environment.
|
||||
@@ -589,7 +572,7 @@ pub trait ModuleEnvironment<'data> {
|
||||
&mut self,
|
||||
tag: Tag,
|
||||
module: &'data str,
|
||||
field: Option<&'data str>,
|
||||
field: &'data str,
|
||||
) -> WasmResult<()> {
|
||||
drop((tag, module, field));
|
||||
Err(WasmError::Unsupported("wasm tags".to_string()))
|
||||
@@ -600,20 +583,9 @@ pub trait ModuleEnvironment<'data> {
|
||||
&mut self,
|
||||
global: Global,
|
||||
module: &'data str,
|
||||
field: Option<&'data str>,
|
||||
field: &'data str,
|
||||
) -> WasmResult<()>;
|
||||
|
||||
/// Declares a module import to the environment.
|
||||
fn declare_module_import(
|
||||
&mut self,
|
||||
ty_index: TypeIndex,
|
||||
module: &'data str,
|
||||
field: Option<&'data str>,
|
||||
) -> WasmResult<()> {
|
||||
drop((ty_index, module, field));
|
||||
Err(WasmError::Unsupported("module linking".to_string()))
|
||||
}
|
||||
|
||||
/// Notifies the implementation that all imports have been declared.
|
||||
fn finish_imports(&mut self) -> WasmResult<()> {
|
||||
Ok(())
|
||||
|
||||
Reference in New Issue
Block a user