Bug 1345205 - Bump MaxCodeBytesPerProcess to 140mb on 32-bit and decrease BufferSize to 8mb r=jandem, a=gchang
authorLuke Wagner <luke@mozilla.com>
Fri, 10 Mar 2017 11:22:58 -0600
changeset 395234 2fb843512a94352c80f744798f8cfab3c575d40e
parent 395233 660fe0a12cf60fbb072e01e46b28267a8a9eeb00
child 395235 25890bbebba03c4d4d669a9d52af59b1549e4af8
push id1468
push userasasaki@mozilla.com
push dateMon, 05 Jun 2017 19:31:07 +0000
treeherdermozilla-release@0641fc6ee9d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjandem, gchang
bugs1345205
milestone54.0a2
Bug 1345205 - Bump MaxCodeBytesPerProcess to 140mb on 32-bit and decrease BufferSize to 8mb r=jandem, a=gchang MozReview-Commit-ID: 844p5Sh92eH
js/src/jit/ProcessExecutableMemory.cpp
js/src/jit/ProcessExecutableMemory.h
--- a/js/src/jit/ProcessExecutableMemory.cpp
+++ b/js/src/jit/ProcessExecutableMemory.cpp
@@ -620,18 +620,18 @@ void
 js::jit::ReleaseProcessExecutableMemory()
 {
     execMemory.release();
 }
 
 bool
 js::jit::CanLikelyAllocateMoreExecutableMemory()
 {
-    // Use a 16 MB buffer.
-    static const size_t BufferSize = 16 * 1024 * 1024;
+    // Use a 8 MB buffer.
+    static const size_t BufferSize = 8 * 1024 * 1024;
 
     MOZ_ASSERT(execMemory.bytesAllocated() <= MaxCodeBytesPerProcess);
 
     return execMemory.bytesAllocated() + BufferSize <= MaxCodeBytesPerProcess;
 }
 
 bool
 js::jit::ReprotectRegion(void* start, size_t size, ProtectionSetting protection)
--- a/js/src/jit/ProcessExecutableMemory.h
+++ b/js/src/jit/ProcessExecutableMemory.h
@@ -10,17 +10,17 @@
 #include "mozilla/Attributes.h"
 
 namespace js {
 namespace jit {
 
 // Limit on the number of bytes of executable memory to prevent JIT spraying
 // attacks.
 #if JS_BITS_PER_WORD == 32
-static const size_t MaxCodeBytesPerProcess = 128 * 1024 * 1024;
+static const size_t MaxCodeBytesPerProcess = 140 * 1024 * 1024;
 #else
 static const size_t MaxCodeBytesPerProcess = 1 * 1024 * 1024 * 1024;
 #endif
 
 // Executable code is allocated in 64K chunks. ExecutableAllocator uses pools
 // that are at least this big. Code we allocate does not necessarily have 64K
 // alignment though.
 static const size_t ExecutableCodePageSize = 64 * 1024;