Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(114)

Unified Diff: third_party/WebKit/Source/platform/heap/StackFrameDepth.cpp

Issue 1778353002: If under stack pressure, do not enable eager stack use. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: do not reset s_stackFrameLimit Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/platform/heap/StackFrameDepth.cpp
diff --git a/third_party/WebKit/Source/platform/heap/StackFrameDepth.cpp b/third_party/WebKit/Source/platform/heap/StackFrameDepth.cpp
index 2fc15209c3d8663a448dbc7092d79d88be856e40..8412e4ed8ed30bccd9d9823fae2b7616445807e8 100644
--- a/third_party/WebKit/Source/platform/heap/StackFrameDepth.cpp
+++ b/third_party/WebKit/Source/platform/heap/StackFrameDepth.cpp
@@ -71,6 +71,12 @@ void StackFrameDepth::enableStackLimit()
size_t stackRoom = stackSize - kStackRoomSize;
RELEASE_ASSERT(stackBase > reinterpret_cast<Address>(stackRoom));
s_stackFrameLimit = reinterpret_cast<uintptr_t>(stackBase - stackRoom);
+
+#if ENABLE(ASSERT)
+ // If current stack use is already exceeding estimated limit, mark as disabled.
+ if (!isSafeToRecurse())
+ s_isEnabled = false;
+#endif
}
size_t StackFrameDepth::getUnderestimatedStackSize()

Powered by Google App Engine
This is Rietveld 408576698