From 877a914df808459e1e588cfbdf2fb91437a7dfb4 Mon Sep 17 00:00:00 2001 From: Luke Wagner Date: Fri, 6 May 2016 21:02:38 -0500 Subject: [PATCH] Bug 1270965 - Baldr: set min-heap-length (r=bbouvier) MozReview-Commit-ID: JwIuHQeHUic --HG-- extra : rebase_source : d5acf7be678ec86bedb89ff916274760edce435c --- js/src/asmjs/Wasm.cpp | 2 +- js/src/asmjs/WasmGenerator.cpp | 3 ++- js/src/asmjs/WasmGenerator.h | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/js/src/asmjs/Wasm.cpp b/js/src/asmjs/Wasm.cpp index 2d9e626b843d..13b3425323c3 100644 --- a/js/src/asmjs/Wasm.cpp +++ b/js/src/asmjs/Wasm.cpp @@ -824,7 +824,7 @@ DecodeMemorySection(JSContext* cx, Decoder& d, ModuleGenerator& mg, MutableHandl if (!heap) return false; - mg.initHeapUsage(HeapUsage::Unshared); + mg.initHeapUsage(HeapUsage::Unshared, initialSize.value()); return true; } diff --git a/js/src/asmjs/WasmGenerator.cpp b/js/src/asmjs/WasmGenerator.cpp index b2cf87fec949..4c758820ac90 100644 --- a/js/src/asmjs/WasmGenerator.cpp +++ b/js/src/asmjs/WasmGenerator.cpp @@ -597,10 +597,11 @@ ModuleGenerator::allocateGlobal(ValType type, bool isConst, uint32_t* index) } void -ModuleGenerator::initHeapUsage(HeapUsage heapUsage) +ModuleGenerator::initHeapUsage(HeapUsage heapUsage, uint32_t minHeapLength) { MOZ_ASSERT(module_->heapUsage == HeapUsage::None); module_->heapUsage = heapUsage; + shared_->minHeapLength = minHeapLength; } bool diff --git a/js/src/asmjs/WasmGenerator.h b/js/src/asmjs/WasmGenerator.h index dc83723b5514..c089f301a012 100644 --- a/js/src/asmjs/WasmGenerator.h +++ b/js/src/asmjs/WasmGenerator.h @@ -166,7 +166,7 @@ class MOZ_STACK_CLASS ModuleGenerator jit::MacroAssembler& masm() { return masm_; } // Heap usage: - void initHeapUsage(HeapUsage heapUsage); + void initHeapUsage(HeapUsage heapUsage, uint32_t minHeapLength = 0); bool usesHeap() const; // Signatures: