Bug 1259699 - Adjust Windows stack limits to account for large PGO stack frames. r=bholley a=ritu
authorJan de Mooij <jdemooij@mozilla.com>
Tue, 29 Mar 2016 08:03:54 +0200
changeset 310411 21c01308022de9e326533480d4ba0f83ad9c76bb
parent 310410 4265845fa3474eadf3a0372d991da3902644bd73
child 310412 ee1fb75222074125e8be8b84ca942fc2fa87f5ba
push id9355
push userkwierso@gmail.com
push dateMon, 04 Apr 2016 19:12:36 +0000
treeherdermozilla-aurora@adb277d1c5a7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbholley, ritu
bugs1259699
milestone47.0a2
Bug 1259699 - Adjust Windows stack limits to account for large PGO stack frames. r=bholley a=ritu MozReview-Commit-ID: KVSDLG86Xmp
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,