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

Unified Diff: Source/wtf/StackStats.cpp

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 | « Source/wtf/StackBounds.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/wtf/StackStats.cpp
diff --git a/Source/wtf/StackStats.cpp b/Source/wtf/StackStats.cpp
index 824bf466a2e5d47b88c3f94e880f36691de7b454..3df0c220085f86c3d0688cc39faacf75ad5f8e8d 100644
--- a/Source/wtf/StackStats.cpp
+++ b/Source/wtf/StackStats.cpp
@@ -81,7 +81,6 @@ StackStats::CheckPoint::CheckPoint()
StackStats::PerThreadStats& t = threadData->stackStats();
const StackBounds& stack = threadData->stack();
- bool isGrowingDownward = stack.isGrowingDownward();
bool needToLog = false;
char* current = reinterpret_cast<char*>(this);
char* last = reinterpret_cast<char*>(t.m_currentCheckPoint);
@@ -99,8 +98,6 @@ StackStats::CheckPoint::CheckPoint()
// Update the stack height stats:
int height = t.m_stackStart - current;
- if (!isGrowingDownward)
- height = -height;
if (height > StackStats::s_maxStackHeight) {
StackStats::s_maxStackHeight = height;
needToLog = true;
@@ -108,8 +105,6 @@ StackStats::CheckPoint::CheckPoint()
// Update the checkpoint diff stats:
int diff = last - current;
- if (!isGrowingDownward)
- diff = -diff;
if (diff > StackStats::s_maxCheckPointDiff) {
StackStats::s_maxCheckPointDiff = diff;
needToLog = true;
@@ -146,14 +141,10 @@ StackStats::CheckPoint::~CheckPoint()
#if ENABLE(VERBOSE_STACK_STATS)
if (!m_prev) {
const StackBounds& stack = threadData->stack();
- bool isGrowingDownward = stack.isGrowingDownward();
char* current = reinterpret_cast<char*>(this);
int height = t.m_stackStart - current;
- if (!isGrowingDownward)
- height = -height;
-
dataLogF(" POP to %p diff max %.1fk | reentry %d/%d max | height %.1fk/max %.1fk | stack %p size %.1fk)\n",
this, StackStats::s_maxCheckPointDiff / 1024.0,
t.m_reentryDepth, StackStats::s_maxReentryDepth,
@@ -170,8 +161,6 @@ void StackStats::probe()
StackStats::PerThreadStats& t = threadData->stackStats();
const StackBounds& stack = threadData->stack();
- bool isGrowingDownward = stack.isGrowingDownward();
-
bool needToLog = false;
int dummy;
@@ -187,8 +176,6 @@ void StackStats::probe()
// Update the stack height stats:
int height = t.m_stackStart - current;
- if (!isGrowingDownward)
- height = -height;
if (height > StackStats::s_maxStackHeight) {
StackStats::s_maxStackHeight = height;
needToLog = true;
@@ -196,8 +183,6 @@ void StackStats::probe()
// Update the checkpoint diff stats:
int diff = last - current;
- if (!isGrowingDownward)
- diff = -diff;
if (diff > StackStats::s_maxCheckPointDiff) {
StackStats::s_maxCheckPointDiff = diff;
needToLog = true;
@@ -231,8 +216,6 @@ StackStats::LayoutCheckPoint::LayoutCheckPoint()
StackStats::PerThreadStats& t = threadData->stackStats();
const StackBounds& stack = threadData->stack();
- bool isGrowingDownward = stack.isGrowingDownward();
-
// Push this checkpoint:
m_prev = StackStats::s_topLayoutCheckPoint;
if (m_prev)
@@ -258,24 +241,18 @@ StackStats::LayoutCheckPoint::LayoutCheckPoint()
// Update the stack height stats:
int height = t.m_stackStart - current;
- if (!isGrowingDownward)
- height = -height;
if (height > StackStats::s_maxStackHeight) {
StackStats::s_maxStackHeight = height;
needToLog = true;
}
// Update the layout checkpoint diff stats:
- if (!isGrowingDownward)
- diff = -diff;
if (diff > StackStats::s_maxLayoutCheckPointDiff) {
StackStats::s_maxLayoutCheckPointDiff = diff;
needToLog = true;
}
// Update the total layout checkpoint diff stats:
- if (!isGrowingDownward)
- totalDiff = -totalDiff;
if (totalDiff > StackStats::s_maxTotalLayoutCheckPointDiff) {
StackStats::s_maxTotalLayoutCheckPointDiff = totalDiff;
needToLog = true;
« no previous file with comments | « Source/wtf/StackBounds.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698