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

Unified Diff: src/counters-inl.h

Issue 2526843002: Revert of [counters] RuntimeStats: fix wrong bookkeeping when dynamically changing counters. (Closed)
Patch Set: Created 4 years, 1 month 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/counters.cc ('k') | src/log.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/counters-inl.h
diff --git a/src/counters-inl.h b/src/counters-inl.h
index ce77806cdcfa4d5117da06aae41edcc5bea13e83..7219ef778a6ea6a06ce25ad457b7a1299c5d7194 100644
--- a/src/counters-inl.h
+++ b/src/counters-inl.h
@@ -9,57 +9,6 @@
namespace v8 {
namespace internal {
-
-void RuntimeCallTimer::Start(RuntimeCallCounter* counter,
- RuntimeCallTimer* parent) {
- DCHECK(!IsStarted());
- counter_ = counter;
- parent_.SetValue(parent);
- if (FLAG_runtime_stats ==
- v8::tracing::TracingCategoryObserver::ENABLED_BY_SAMPLING) {
- return;
- }
- base::TimeTicks now = Now();
- if (parent) parent->Pause(now);
- Resume(now);
- DCHECK(IsStarted());
-}
-
-void RuntimeCallTimer::Pause(base::TimeTicks now) {
- DCHECK(IsStarted());
- elapsed_ += (now - start_ticks_);
- start_ticks_ = base::TimeTicks();
-}
-
-void RuntimeCallTimer::Resume(base::TimeTicks now) {
- DCHECK(!IsStarted());
- start_ticks_ = now;
-}
-
-RuntimeCallTimer* RuntimeCallTimer::Stop() {
- if (!IsStarted()) return parent();
- base::TimeTicks now = Now();
- Pause(now);
- counter_->Increment();
- CommitTimeToCounter();
-
- RuntimeCallTimer* parent_timer = parent();
- if (parent_timer) {
- parent_timer->Resume(now);
- }
- return parent_timer;
-}
-
-void RuntimeCallTimer::CommitTimeToCounter() {
- counter_->Add(elapsed_);
- elapsed_ = base::TimeDelta();
-}
-
-bool RuntimeCallTimer::IsStarted() { return start_ticks_ != base::TimeTicks(); }
-
-base::TimeTicks RuntimeCallTimer::Now() {
- return base::TimeTicks::HighResolutionNow();
-}
RuntimeCallTimerScope::RuntimeCallTimerScope(
Isolate* isolate, RuntimeCallStats::CounterId counter_id) {
« no previous file with comments | « src/counters.cc ('k') | src/log.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698