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

Unified Diff: Source/wtf/StackBounds.h

Issue 13890009: Simplify StackBounds. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 7 years, 8 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 | « no previous file | Source/wtf/StackStats.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/wtf/StackBounds.h
diff --git a/Source/wtf/StackBounds.h b/Source/wtf/StackBounds.h
index 069e4cf4476bbce263741ecddb261414983c695d..f7e3d764917087d886b65ab24ef92cfd39df7903 100644
--- a/Source/wtf/StackBounds.h
+++ b/Source/wtf/StackBounds.h
@@ -52,9 +52,7 @@ public:
bool isSafeToRecurse(size_t minAvailableDelta = s_defaultAvailabilityDelta) const
{
checkConsistency();
- if (isGrowingDownward())
- return current() >= recursionLimit(minAvailableDelta);
- return current() <= recursionLimit(minAvailableDelta);
+ return current() >= recursionLimit(minAvailableDelta);
}
void* origin() const
@@ -65,9 +63,7 @@ public:
size_t size() const
{
- if (isGrowingDownward())
- return static_cast<char*>(m_origin) - static_cast<char*>(m_bound);
- return static_cast<char*>(m_bound) - static_cast<char*>(m_origin);
+ return static_cast<char*>(m_origin) - static_cast<char*>(m_bound);
}
private:
@@ -89,15 +85,7 @@ private:
void* recursionLimit(size_t minAvailableDelta = s_defaultAvailabilityDelta) const
{
checkConsistency();
- if (isGrowingDownward())
- return static_cast<char*>(m_bound) + minAvailableDelta;
- return static_cast<char*>(m_bound) - minAvailableDelta;
- }
-
- bool isGrowingDownward() const
- {
- ASSERT(m_origin && m_bound);
- return true;
+ return static_cast<char*>(m_bound) + minAvailableDelta;
}
void checkConsistency() const
@@ -105,9 +93,7 @@ private:
#if !ASSERT_DISABLED
void* currentPosition = &currentPosition;
ASSERT(m_origin != m_bound);
- ASSERT(isGrowingDownward()
- ? (currentPosition < m_origin && currentPosition > m_bound)
- : (currentPosition > m_origin && currentPosition < m_bound));
+ ASSERT(currentPosition < m_origin && currentPosition > m_bound);
#endif
}
« no previous file with comments | « no previous file | Source/wtf/StackStats.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698