Wasmtime: set the cranelift_wasm::Heap's min size (#5522)

This unlocks certain bounds checking optimizations in some
configurations. Wasn't able to measure any delta in sightglass, but still worth
doing anyways.
This commit is contained in:
Nick Fitzgerald
2023-01-04 17:18:46 -08:00
committed by GitHub
parent e2e98f694f
commit b46ad1b54d

View File

@@ -1471,7 +1471,7 @@ impl<'module_environment> cranelift_wasm::FuncEnvironment for FuncEnvironment<'m
}); });
Ok(self.heaps.push(HeapData { Ok(self.heaps.push(HeapData {
base: heap_base, base: heap_base,
min_size: 0, min_size: self.module.memory_plans[index].memory.minimum * u64::from(WASM_PAGE_SIZE),
offset_guard_size, offset_guard_size,
style: heap_style, style: heap_style,
index_type: self.memory_index_type(index), index_type: self.memory_index_type(index),