| 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 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 | 298 |
| 299 #define PRINT_COUNTER(name, nargs, ressize) entries.Add(&this->Runtime_##name); | 299 #define PRINT_COUNTER(name, nargs, ressize) entries.Add(&this->Runtime_##name); |
| 300 FOR_EACH_INTRINSIC(PRINT_COUNTER) | 300 FOR_EACH_INTRINSIC(PRINT_COUNTER) |
| 301 #undef PRINT_COUNTER | 301 #undef PRINT_COUNTER |
| 302 | 302 |
| 303 #define PRINT_COUNTER(name, type) entries.Add(&this->Builtin_##name); | 303 #define PRINT_COUNTER(name, type) entries.Add(&this->Builtin_##name); |
| 304 BUILTIN_LIST_C(PRINT_COUNTER) | 304 BUILTIN_LIST_C(PRINT_COUNTER) |
| 305 #undef PRINT_COUNTER | 305 #undef PRINT_COUNTER |
| 306 | 306 |
| 307 entries.Add(&this->ExternalCallback); | 307 entries.Add(&this->ExternalCallback); |
| 308 entries.Add(&this->GC); | |
| 309 entries.Add(&this->UnexpectedStubMiss); | 308 entries.Add(&this->UnexpectedStubMiss); |
| 310 | 309 |
| 311 entries.Print(os); | 310 entries.Print(os); |
| 312 } | 311 } |
| 313 | 312 |
| 314 void RuntimeCallStats::Reset() { | 313 void RuntimeCallStats::Reset() { |
| 315 if (!FLAG_runtime_call_stats) return; | 314 if (!FLAG_runtime_call_stats) return; |
| 316 #define RESET_COUNTER(name, nargs, ressize) this->Runtime_##name.Reset(); | 315 #define RESET_COUNTER(name, nargs, ressize) this->Runtime_##name.Reset(); |
| 317 FOR_EACH_INTRINSIC(RESET_COUNTER) | 316 FOR_EACH_INTRINSIC(RESET_COUNTER) |
| 318 #undef RESET_COUNTER | 317 #undef RESET_COUNTER |
| 319 #define RESET_COUNTER(name, type) this->Builtin_##name.Reset(); | 318 #define RESET_COUNTER(name, type) this->Builtin_##name.Reset(); |
| 320 BUILTIN_LIST_C(RESET_COUNTER) | 319 BUILTIN_LIST_C(RESET_COUNTER) |
| 321 #undef RESET_COUNTER | 320 #undef RESET_COUNTER |
| 322 this->ExternalCallback.Reset(); | 321 this->ExternalCallback.Reset(); |
| 323 this->GC.Reset(); | |
| 324 this->UnexpectedStubMiss.Reset(); | 322 this->UnexpectedStubMiss.Reset(); |
| 325 } | 323 } |
| 326 | 324 |
| 327 void RuntimeCallTimerScope::Enter(Isolate* isolate, | 325 void RuntimeCallTimerScope::Enter(Isolate* isolate, |
| 328 RuntimeCallCounter* counter) { | 326 RuntimeCallCounter* counter) { |
| 329 isolate_ = isolate; | 327 isolate_ = isolate; |
| 330 RuntimeCallStats* stats = isolate->counters()->runtime_call_stats(); | 328 RuntimeCallStats* stats = isolate->counters()->runtime_call_stats(); |
| 331 timer_.Initialize(counter, stats->current_timer()); | 329 timer_.Initialize(counter, stats->current_timer()); |
| 332 stats->Enter(&timer_); | 330 stats->Enter(&timer_); |
| 333 } | 331 } |
| 334 | 332 |
| 335 void RuntimeCallTimerScope::Leave() { | 333 void RuntimeCallTimerScope::Leave() { |
| 336 isolate_->counters()->runtime_call_stats()->Leave(&timer_); | 334 isolate_->counters()->runtime_call_stats()->Leave(&timer_); |
| 337 } | 335 } |
| 338 | 336 |
| 339 } // namespace internal | 337 } // namespace internal |
| 340 } // namespace v8 | 338 } // namespace v8 |
| OLD | NEW |