| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |