Bug 1259699 - Adjust Windows stack limits to account for large PGO stack frames. r=bholley
authorJan de Mooij <jdemooij@mozilla.com>
Tue, 29 Mar 2016 08:03:54 +0200
changeset 290782 72c2846e2d161e3c73f04c679e52717ccde38f7b
parent 290781 7a043400e5be3b3199017e85d9853721f880abcc
child 290783 d5d53a3b4e50b94cdf85d20690526e5a00d5b63e
child 290902 0ce8b97e0e6921dde82f2eb30b33ba4042e822df
push id19656
push usergwagner@mozilla.com
push dateMon, 04 Apr 2016 13:43:23 +0000
treeherderb2g-inbound@e99061fde28a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbholley
bugs1259699
milestone48.0a1
Bug 1259699 - Adjust Windows stack limits to account for large PGO stack frames. r=bholley
js/xpconnect/src/XPCJSRuntime.cpp
--- a/js/xpconnect/src/XPCJSRuntime.cpp
+++ b/js/xpconnect/src/XPCJSRuntime.cpp
@@ -3390,18 +3390,19 @@ GetWindowsStackSize()
 
     const uint8_t* stackBottom = reinterpret_cast<const uint8_t*>(mbi.AllocationBase);
 
     // Do some sanity checks.
     size_t stackSize = size_t(stackTop - stackBottom);
     MOZ_RELEASE_ASSERT(stackSize >= 1 * 1024 * 1024);
     MOZ_RELEASE_ASSERT(stackSize <= 32 * 1024 * 1024);
 
-    // Subtract 20 KB to account for things like the guard page.
-    return stackSize - 20 * 1024;
+    // Subtract 40 KB (Win32) or 80 KB (Win64) to account for things like
+    // the guard page and large PGO stack frames.
+    return stackSize - 10 * sizeof(uintptr_t) * 1024;
 }
 #endif
 
 nsresult
 XPCJSRuntime::Initialize()
 {
     nsresult rv = CycleCollectedJSRuntime::Initialize(nullptr,
                                                       JS::DefaultHeapMaxBytes,