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

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

Issue 1670093002: Do not initiate Oilpan GC if under known stack pressure. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 8e459762a3b7ab125a3cf164076134b7a4166cde..c11218b3d8fa7b3a40e8475a002e14209c8064f3 100644
--- a/third_party/WebKit/Source/platform/heap/StackFrameDepth.cpp
+++ b/third_party/WebKit/Source/platform/heap/StackFrameDepth.cpp
@@ -58,6 +58,21 @@ void StackFrameDepth::enableStackLimit()
dummy[sizeof(dummy) - 1] = 0;
}
+bool StackFrameDepth::hasInsufficientStackForGC()
+{
+ size_t stackSize = getUnderestimatedStackSize();
+ if (!stackSize)
+ return false;
+
+ Address stackBase = reinterpret_cast<Address>(getStackStart());
+ RELEASE_ASSERT(stackBase > reinterpret_cast<Address>(stackSize));
+ uintptr_t stackLimit = reinterpret_cast<uintptr_t>(stackBase - stackSize);
+
+ // If less than 8k of stack space is left, better not run a GC.
+ char dummy[2];
+ return (currentStackFrameBaseOnCallee(dummy) - stackLimit) < 8 * 1024;
+}
+
size_t StackFrameDepth::getUnderestimatedStackSize()
{
// FIXME: ASAN bot uses a fake stack as a thread stack frame,
« no previous file with comments | « third_party/WebKit/Source/platform/heap/StackFrameDepth.h ('k') | third_party/WebKit/Source/platform/heap/ThreadState.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698