| 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 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 std::vector<Entry> entries; | 273 std::vector<Entry> entries; |
| 274 }; | 274 }; |
| 275 | 275 |
| 276 void RuntimeCallCounter::Reset() { | 276 void RuntimeCallCounter::Reset() { |
| 277 count_ = 0; | 277 count_ = 0; |
| 278 time_ = base::TimeDelta(); | 278 time_ = base::TimeDelta(); |
| 279 } | 279 } |
| 280 | 280 |
| 281 void RuntimeCallCounter::Dump(v8::tracing::TracedValue* value) { | 281 void RuntimeCallCounter::Dump(v8::tracing::TracedValue* value) { |
| 282 value->BeginArray(name_); | 282 value->BeginArray(name_); |
| 283 value->AppendLongInteger(count_); | 283 value->AppendDouble(count_); |
| 284 value->AppendLongInteger(time_.InMicroseconds()); | 284 value->AppendDouble(time_.InMicroseconds()); |
| 285 value->EndArray(); | 285 value->EndArray(); |
| 286 } | 286 } |
| 287 | 287 |
| 288 void RuntimeCallCounter::Add(RuntimeCallCounter* other) { | 288 void RuntimeCallCounter::Add(RuntimeCallCounter* other) { |
| 289 count_ += other->count(); | 289 count_ += other->count(); |
| 290 time_ += other->time(); | 290 time_ += other->time(); |
| 291 } | 291 } |
| 292 | 292 |
| 293 void RuntimeCallTimer::Snapshot() { | 293 void RuntimeCallTimer::Snapshot() { |
| 294 base::TimeTicks now = Now(); | 294 base::TimeTicks now = Now(); |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 407 RuntimeCallStats::counters) { | 407 RuntimeCallStats::counters) { |
| 408 RuntimeCallCounter* counter = &(this->*counter_id); | 408 RuntimeCallCounter* counter = &(this->*counter_id); |
| 409 if (counter->count() > 0) counter->Dump(value); | 409 if (counter->count() > 0) counter->Dump(value); |
| 410 } | 410 } |
| 411 | 411 |
| 412 in_use_ = false; | 412 in_use_ = false; |
| 413 } | 413 } |
| 414 | 414 |
| 415 } // namespace internal | 415 } // namespace internal |
| 416 } // namespace v8 | 416 } // namespace v8 |
| OLD | NEW |