Bump wasmtime from 0.19.0 to 0.22.0 (#7865)

* Bump wasmtime from 0.19.0 to 0.22.0

Bumps [wasmtime](https://github.com/bytecodealliance/wasmtime) from 0.19.0 to 0.22.0.
- [Release notes](https://github.com/bytecodealliance/wasmtime/releases)
- [Changelog](https://github.com/bytecodealliance/wasmtime/blob/main/docs/WASI-some-possible-changes.md)
- [Commits](https://github.com/bytecodealliance/wasmtime/compare/v0.19.0...v0.22.0)

Signed-off-by: dependabot[bot] <support@github.com>

* Account for ImportType::name() being an Optional

* Account for parameters being a impl Iterator now

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alexander Theißen <alex.theissen@me.com>
Co-authored-by: Bastian Köcher <info@kchr.de>
This commit is contained in:
dependabot[bot]
2021-02-08 13:03:05 +00:00
committed by GitHub
parent 0ed683ca13
commit 884d916559
4 changed files with 225 additions and 165 deletions
@@ -113,7 +113,7 @@ impl EntryPoint {
])
},
})
.map(|results|
.map(|results|
// the signature is checked to have i64 return type
results[0].unwrap_i64() as u64
)
@@ -124,27 +124,28 @@ impl EntryPoint {
}
pub fn direct(func: wasmtime::Func) -> std::result::Result<Self, &'static str> {
match (func.ty().params(), func.ty().results()) {
(&[wasmtime::ValType::I32, wasmtime::ValType::I32], &[wasmtime::ValType::I64]) => {
Ok(Self { func, call_type: EntryPointType::Direct })
}
_ => {
Err("Invalid signature for direct entry point")
}
use wasmtime::ValType;
let entry_point = wasmtime::FuncType::new(
[ValType::I32, ValType::I32].iter().cloned(),
[ValType::I64].iter().cloned(),
);
if func.ty() == entry_point {
Ok(Self { func, call_type: EntryPointType::Direct })
} else {
Err("Invalid signature for direct entry point")
}
}
pub fn wrapped(dispatcher: wasmtime::Func, func: u32) -> std::result::Result<Self, &'static str> {
match (dispatcher.ty().params(), dispatcher.ty().results()) {
(
&[wasmtime::ValType::I32, wasmtime::ValType::I32, wasmtime::ValType::I32],
&[wasmtime::ValType::I64],
) => {
Ok(Self { func: dispatcher, call_type: EntryPointType::Wrapped(func) })
},
_ => {
Err("Invalid signature for wrapped entry point")
}
use wasmtime::ValType;
let entry_point = wasmtime::FuncType::new(
[ValType::I32, ValType::I32, ValType::I32].iter().cloned(),
[ValType::I64].iter().cloned(),
);
if dispatcher.ty() == entry_point {
Ok(Self { func: dispatcher, call_type: EntryPointType::Wrapped(func) })
} else {
Err("Invalid signature for wrapped entry point")
}
}
}