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

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

Issue 1779243002: Simplify StackFrameDepth's handling of stack limits. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix (un)signed mismatch 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
« no previous file with comments | « third_party/WebKit/Source/platform/heap/StackFrameDepth.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 8412e4ed8ed30bccd9d9823fae2b7616445807e8..3c0a0395b189b1abeddc2d96353084b9ebb9439a 100644
--- a/third_party/WebKit/Source/platform/heap/StackFrameDepth.cpp
+++ b/third_party/WebKit/Source/platform/heap/StackFrameDepth.cpp
@@ -18,11 +18,7 @@ namespace blink {
static const char* s_avoidOptimization = nullptr;
-uintptr_t StackFrameDepth::s_stackFrameLimit = 0;
-#if ENABLE(ASSERT)
-bool StackFrameDepth::s_isEnabled = false;
-bool StackFrameDepth::s_isUsingFallbackStackSize = false;
-#endif
+uintptr_t StackFrameDepth::s_stackFrameLimit = kMinimumStackLimit;
// NEVER_INLINE ensures that |dummy| array on configureLimit() is not optimized away,
// and the stack frame base register is adjusted |kSafeStackFrameSize|.
@@ -40,22 +36,11 @@ uintptr_t StackFrameDepth::getFallbackStackLimit()
// Check that the stack frame can be used.
dummy[sizeof(dummy) - 1] = 0;
-#if ENABLE(ASSERT)
- // Use a larger stack limit for what's acceptable if the platform
- // thread ends up using the fallback size to decide if switching to
- // lazy marking is in order.
- s_isUsingFallbackStackSize = true;
-#endif
return currentStackFrameBaseOnCallee(dummy);
}
void StackFrameDepth::enableStackLimit()
{
-#if ENABLE(ASSERT)
- s_isEnabled = true;
- s_isUsingFallbackStackSize = false;
-#endif
-
// All supported platforms will currently return a non-zero estimate,
// except if ASan is enabled.
size_t stackSize = getUnderestimatedStackSize();
@@ -72,11 +57,9 @@ void StackFrameDepth::enableStackLimit()
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
+ disableStackLimit();
}
size_t StackFrameDepth::getUnderestimatedStackSize()
« no previous file with comments | « third_party/WebKit/Source/platform/heap/StackFrameDepth.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698