Bug 1259699 - Adjust Windows stack limits to account for large PGO stack frames. r=bholley a=ritu
MozReview-Commit-ID: KVSDLG86Xmp
--- 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,