Get caching working again

This commit is contained in:
Lachlan Sneff
2019-02-20 16:41:41 -08:00
parent 82eea00a02
commit 9f40eedba8
21 changed files with 244 additions and 246 deletions

View File

@ -16,13 +16,12 @@ use wasmer_runtime_core::{
/// We check if a provided module is an Emscripten generated one
pub fn is_emscripten_module(module: &Module) -> bool {
for (_, import_name) in &module.0.info.imported_functions {
for (_, import_name) in &module.info().imported_functions {
let namespace = module
.0
.info
.info()
.namespace_table
.get(import_name.namespace_index);
let field = module.0.info.name_table.get(import_name.name_index);
let field = module.info().name_table.get(import_name.name_index);
if field == "_emscripten_memcpy_big" && namespace == "env" {
return true;
}
@ -31,12 +30,12 @@ pub fn is_emscripten_module(module: &Module) -> bool {
}
pub fn get_emscripten_table_size(module: &Module) -> (u32, Option<u32>) {
let (_, table) = &module.0.info.imported_tables[ImportedTableIndex::new(0)];
let (_, table) = &module.info().imported_tables[ImportedTableIndex::new(0)];
(table.minimum, table.maximum)
}
pub fn get_emscripten_memory_size(module: &Module) -> (Pages, Option<Pages>) {
let (_, memory) = &module.0.info.imported_memories[ImportedMemoryIndex::new(0)];
let (_, memory) = &module.info().imported_memories[ImportedMemoryIndex::new(0)];
(memory.minimum, memory.maximum)
}