Use Page units for memory operations

This commit is contained in:
Syrus
2020-04-22 12:33:10 -07:00
parent eb68125f30
commit 1ef248658b
12 changed files with 213 additions and 66 deletions

View File

@@ -11,9 +11,7 @@ use cranelift_codegen::isa::TargetFrontendConfig;
use std::convert::TryFrom;
use wasm_common::entity::EntityRef;
use wasm_common::entity::PrimaryMap;
use wasm_common::{
FuncIndex, GlobalIndex, MemoryIndex, SignatureIndex, TableIndex, WASM_PAGE_SIZE,
};
use wasm_common::{FuncIndex, GlobalIndex, MemoryIndex, SignatureIndex, TableIndex};
use wasmer_compiler::{WasmError, WasmResult};
use wasmer_runtime::VMBuiltinFunctionIndex;
use wasmer_runtime::VMOffsets;
@@ -669,7 +667,7 @@ impl<'module_environment> BaseFuncEnvironment for FuncEnvironment<'module_enviro
} => (
Uimm64::new(offset_guard_size),
ir::HeapStyle::Static {
bound: Uimm64::new(u64::from(bound) * u64::from(WASM_PAGE_SIZE)),
bound: Uimm64::new(bound.bytes().0 as u64),
},
true,
),