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 317739 2354df610ae50aaf239f25250f11c043b32d36b2
parent 317738 540506f6aa91a999537f55d884dd080acd0d135a
child 317740 5a7dbc94f9ebef615c83d60ffd0f688790fb428f
push id5865
push userjandemooij@gmail.com
push dateThu, 07 Apr 2016 09:41:37 +0000
treeherdermozilla-beta@2354df610ae5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbholley, ritu
bugs1259699
milestone46.0
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
@@ -3341,18 +3341,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
 
 static const JSWrapObjectCallbacks WrapObjectCallbacks = {
     xpc::WrapperFactory::Rewrap,
     xpc::WrapperFactory::PrepareForWrapping
 };