Bump wasmtime again (#5950)

* Update wasmtime (#5822)

* update wasmtime

* update tests

* Update client/executor/wasmtime/src/host.rs

Co-Authored-By: Bastian Köcher <bkchr@users.noreply.github.com>

* wip

* use master-candidate

* update with patches

* update versions

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

* Bump version

* Added parallel execution test

Co-authored-by: Nikolay Volf <nikvolf@gmail.com>
Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
This commit is contained in:
Arkadiy Paronyan
2020-05-08 22:22:54 +02:00
committed by GitHub
parent 2ae3fe121c
commit e0b17dd7a9
8 changed files with 233 additions and 177 deletions
@@ -21,6 +21,7 @@ use sc_executor_common::{
use sp_wasm_interface::Value;
use cranelift_codegen::ir;
use cranelift_wasm::GlobalIndex;
use wasmtime_runtime::{ExportGlobal, Export};
/// A snapshot of a global variables values. This snapshot can be used later for restoring the
/// values to the preserved state.
@@ -37,17 +38,15 @@ impl GlobalsSnapshot {
pub fn take(instance_wrapper: &InstanceWrapper) -> Result<Self> {
// EVIL:
// Usage of an undocumented function.
let handle = instance_wrapper.instance.handle().clone();
let handle = unsafe { instance_wrapper.instance.handle().clone() };
let mut preserved_mut_globals = vec![];
for global_idx in instance_wrapper.imported_globals_count..instance_wrapper.globals_count {
let (def, global) = match handle.lookup_by_declaration(
&wasmtime_environ::Export::Global(GlobalIndex::from_u32(global_idx)),
&wasmtime_environ::EntityIndex::Global(GlobalIndex::from_u32(global_idx)),
) {
wasmtime_runtime::Export::Global {
definition, global, ..
} => (definition, global),
Export::Global(ExportGlobal { definition, global, .. }) => (definition, global),
_ => unreachable!("only globals can be returned for a global request"),
};