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

Unified Diff: src/counters.cc

Issue 2054133002: [--runtime-call-stats] Fix ACCESSOR handler computation (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebased Created 4 years, 6 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 | « src/builtins.cc ('k') | src/ic/arm/ic-arm.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/counters.cc
diff --git a/src/counters.cc b/src/counters.cc
index 14a6ff7f8c90de8a082f21d1cbe6949620808d83..b71b28ce526a161c11be95d67d213f5509b47ffd 100644
--- a/src/counters.cc
+++ b/src/counters.cc
@@ -285,8 +285,17 @@ void RuntimeCallStats::Enter(Isolate* isolate, RuntimeCallTimer* timer,
// static
void RuntimeCallStats::Leave(Isolate* isolate, RuntimeCallTimer* timer) {
RuntimeCallStats* stats = isolate->counters()->runtime_call_stats();
- DCHECK_EQ(stats->current_timer_, timer);
- stats->current_timer_ = timer->Stop();
+
+ if (stats->current_timer_ == timer) {
+ stats->current_timer_ = timer->Stop();
+ } else {
+ // Must be a Threading cctest. Walk the chain of Timers to find the
+ // buried one that's leaving. We don't care about keeping nested timings
+ // accurate, just avoid crashing by keeping the chain intact.
+ RuntimeCallTimer* next = stats->current_timer_;
+ while (next->parent_ != timer) next = next->parent_;
+ next->parent_ = timer->Stop();
+ }
}
// static
« no previous file with comments | « src/builtins.cc ('k') | src/ic/arm/ic-arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698