diff --git a/lib/runtime-core/Cargo.toml b/lib/runtime-core/Cargo.toml index dc5998e4a..3cde70351 100644 --- a/lib/runtime-core/Cargo.toml +++ b/lib/runtime-core/Cargo.toml @@ -13,7 +13,6 @@ page_size = "0.4.1" wasmparser = "0.35.1" parking_lot = "0.9.0" lazy_static = "1.3.0" -indexmap = "1.0.2" errno = "0.2.4" libc = "0.2.60" hex = "0.3.2" @@ -21,6 +20,10 @@ smallvec = "0.6.10" bincode = "1.1" colored = "1.8" +[dependencies.indexmap] +version = "1.0.2" +features = ["serde-1"] + # Dependencies for caching. [dependencies.serde] version = "1.0.98" diff --git a/lib/runtime-core/src/export.rs b/lib/runtime-core/src/export.rs index 26bc14019..52ea9cf61 100644 --- a/lib/runtime-core/src/export.rs +++ b/lib/runtime-core/src/export.rs @@ -2,7 +2,7 @@ use crate::{ global::Global, instance::InstanceInner, memory::Memory, module::ExportIndex, module::ModuleInner, table::Table, types::FuncSig, vm, }; -use std::collections::hash_map; +use indexmap::map::Iter as IndexMapIter; use std::sync::Arc; #[derive(Debug, Copy, Clone)] @@ -41,7 +41,7 @@ impl FuncPointer { pub struct ExportIter<'a> { inner: &'a InstanceInner, - iter: hash_map::Iter<'a, String, ExportIndex>, + iter: IndexMapIter<'a, String, ExportIndex>, module: &'a ModuleInner, } diff --git a/lib/runtime-core/src/module.rs b/lib/runtime-core/src/module.rs index 1faad791c..6cc02343f 100644 --- a/lib/runtime-core/src/module.rs +++ b/lib/runtime-core/src/module.rs @@ -40,7 +40,7 @@ pub struct ModuleInfo { pub imported_tables: Map, pub imported_globals: Map, - pub exports: HashMap, + pub exports: IndexMap, pub data_initializers: Vec, pub elem_initializers: Vec, diff --git a/lib/runtime-core/src/vm.rs b/lib/runtime-core/src/vm.rs index 291c08bc2..d11220c73 100644 --- a/lib/runtime-core/src/vm.rs +++ b/lib/runtime-core/src/vm.rs @@ -850,6 +850,7 @@ mod vm_ctx_tests { use crate::cache::Error as CacheError; use crate::typed_func::Wasm; use crate::types::{LocalFuncIndex, SigIndex}; + use indexmap::IndexMap; use std::any::Any; use std::collections::HashMap; use std::ptr::NonNull; @@ -890,7 +891,7 @@ mod vm_ctx_tests { imported_tables: Map::new(), imported_globals: Map::new(), - exports: HashMap::new(), + exports: IndexMap::new(), data_initializers: Vec::new(), elem_initializers: Vec::new(),