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

Side by Side Diff: src/counters.cc

Issue 2519073002: 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 unified diff | Download patch
« no previous file with comments | « src/counters.h ('k') | src/counters-inl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/counters.h" 5 #include "src/counters.h"
6 6
7 #include <iomanip> 7 #include <iomanip>
8 8
9 #include "src/base/platform/platform.h" 9 #include "src/base/platform/platform.h"
10 #include "src/isolate.h" 10 #include "src/isolate.h"
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 CounterId counter_id) { 347 CounterId counter_id) {
348 RuntimeCallTimer* timer = stats->current_timer_.Value(); 348 RuntimeCallTimer* timer = stats->current_timer_.Value();
349 // When RCS are enabled dynamically there might be no current timer set up. 349 // When RCS are enabled dynamically there might be no current timer set up.
350 if (timer == nullptr) return; 350 if (timer == nullptr) return;
351 timer->counter_ = &(stats->*counter_id); 351 timer->counter_ = &(stats->*counter_id);
352 } 352 }
353 353
354 void RuntimeCallStats::Print(std::ostream& os) { 354 void RuntimeCallStats::Print(std::ostream& os) {
355 RuntimeCallStatEntries entries; 355 RuntimeCallStatEntries entries;
356 if (current_timer_.Value() != nullptr) { 356 if (current_timer_.Value() != nullptr) {
357 current_timer_.Value()->Snapshot(); 357 current_timer_.Value()->Elapsed();
358 } 358 }
359 for (const RuntimeCallStats::CounterId counter_id : 359 for (const RuntimeCallStats::CounterId counter_id :
360 RuntimeCallStats::counters) { 360 RuntimeCallStats::counters) {
361 RuntimeCallCounter* counter = &(this->*counter_id); 361 RuntimeCallCounter* counter = &(this->*counter_id);
362 entries.Add(counter); 362 entries.Add(counter);
363 } 363 }
364 entries.Print(os); 364 entries.Print(os);
365 } 365 }
366 366
367 void RuntimeCallStats::Reset() { 367 void RuntimeCallStats::Reset() {
(...skipping 21 matching lines...) Expand all
389 RuntimeCallStats::counters) { 389 RuntimeCallStats::counters) {
390 RuntimeCallCounter* counter = &(this->*counter_id); 390 RuntimeCallCounter* counter = &(this->*counter_id);
391 if (counter->count > 0) counter->Dump(value); 391 if (counter->count > 0) counter->Dump(value);
392 } 392 }
393 393
394 in_use_ = false; 394 in_use_ = false;
395 } 395 }
396 396
397 } // namespace internal 397 } // namespace internal
398 } // namespace v8 398 } // namespace v8
OLDNEW
« no previous file with comments | « src/counters.h ('k') | src/counters-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698