Bug 939562 part 1 - Bump trusted script buffer size for ASAN builds. r=bholley
authorJan de Mooij <jdemooij@mozilla.com>
Wed, 26 Feb 2014 10:19:45 +0100
changeset 170983 af372888bbbf9deebd4d56ed82374ec6f85389ab
parent 170982 e931f64fda23042cb4b9ad2aa4684d0b7275f5f3
child 170984 802aa43ae8cc5948062a132efd3f9e798b949376
push id270
push userpvanderbeken@mozilla.com
push dateThu, 06 Mar 2014 09:24:21 +0000
reviewersbholley
bugs939562
milestone30.0a1
Bug 939562 part 1 - Bump trusted script buffer size for ASAN builds. r=bholley
js/xpconnect/src/XPCJSRuntime.cpp
--- a/js/xpconnect/src/XPCJSRuntime.cpp
+++ b/js/xpconnect/src/XPCJSRuntime.cpp
@@ -3065,21 +3065,21 @@ XPCJSRuntime::XPCJSRuntime(nsXPConnect* 
     // MacOS has a gargantuan default stack size of 8MB. Go wild with 7MB,
     // and give trusted script 140k extra. The stack is huge on mac anyway.
     const size_t kStackQuota = 7 * 1024 * 1024;
     const size_t kTrustedScriptBuffer = 140 * 1024;
 #elif defined(MOZ_ASAN)
     // ASan requires more stack space due to red-zones, so give it double the
     // default (2MB on 32-bit, 4MB on 64-bit). ASAN stack frame measurements
     // were not taken at the time of this writing, so we hazard a guess that
-    // ASAN builds have roughly twice the stack overhead as normal builds.
+    // ASAN builds have roughly thrice the stack overhead as normal builds.
     // On normal builds, the largest stack frame size we might encounter is
-    // 8.2k, so let's use a buffer of 8.2 * 2 * 10 = 164k.
+    // 8.2k, so let's use a buffer of 8.2 * 3 * 10 = 246k.
     const size_t kStackQuota =  2 * kDefaultStackQuota;
-    const size_t kTrustedScriptBuffer = 164 * 1024;
+    const size_t kTrustedScriptBuffer = 246 * 1024;
 #elif defined(XP_WIN)
     // 1MB is the default stack size on Windows, so the default 1MB stack quota
     // we'd get on win32 is slightly too large. Use 900k instead. And since
     // windows stack frames are 3.4k each, let's use a buffer of 40k.
     const size_t kStackQuota = 900 * 1024;
     const size_t kTrustedScriptBuffer = 40 * 1024;
     // The following two configurations are linux-only. Given the numbers above,
     // we use 50k and 100k trusted buffers on 32-bit and 64-bit respectively.