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 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
337 #undef PRINT_COUNTER | 337 #undef PRINT_COUNTER |
338 | 338 |
339 #define PRINT_COUNTER(name) entries.Add(&this->Handler_##name); | 339 #define PRINT_COUNTER(name) entries.Add(&this->Handler_##name); |
340 FOR_EACH_HANDLER_COUNTER(PRINT_COUNTER) | 340 FOR_EACH_HANDLER_COUNTER(PRINT_COUNTER) |
341 #undef PRINT_COUNTER | 341 #undef PRINT_COUNTER |
342 | 342 |
343 entries.Print(os); | 343 entries.Print(os); |
344 } | 344 } |
345 | 345 |
346 void RuntimeCallStats::Reset() { | 346 void RuntimeCallStats::Reset() { |
347 if (!FLAG_runtime_call_stats && | 347 if (V8_LIKELY(FLAG_runtime_stats == 0)) return; |
348 !TRACE_EVENT_RUNTIME_CALL_STATS_TRACING_ENABLED()) | 348 |
349 return; | |
350 #define RESET_COUNTER(name) this->name.Reset(); | 349 #define RESET_COUNTER(name) this->name.Reset(); |
351 FOR_EACH_MANUAL_COUNTER(RESET_COUNTER) | 350 FOR_EACH_MANUAL_COUNTER(RESET_COUNTER) |
352 #undef RESET_COUNTER | 351 #undef RESET_COUNTER |
353 | 352 |
354 #define RESET_COUNTER(name, nargs, result_size) this->Runtime_##name.Reset(); | 353 #define RESET_COUNTER(name, nargs, result_size) this->Runtime_##name.Reset(); |
355 FOR_EACH_INTRINSIC(RESET_COUNTER) | 354 FOR_EACH_INTRINSIC(RESET_COUNTER) |
356 #undef RESET_COUNTER | 355 #undef RESET_COUNTER |
357 | 356 |
358 #define RESET_COUNTER(name) this->Builtin_##name.Reset(); | 357 #define RESET_COUNTER(name) this->Builtin_##name.Reset(); |
359 BUILTIN_LIST_C(RESET_COUNTER) | 358 BUILTIN_LIST_C(RESET_COUNTER) |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
397 #define DUMP_COUNTER(name) \ | 396 #define DUMP_COUNTER(name) \ |
398 if (this->Handler_##name.count > 0) this->Handler_##name.Dump(value); | 397 if (this->Handler_##name.count > 0) this->Handler_##name.Dump(value); |
399 FOR_EACH_HANDLER_COUNTER(DUMP_COUNTER) | 398 FOR_EACH_HANDLER_COUNTER(DUMP_COUNTER) |
400 #undef DUMP_COUNTER | 399 #undef DUMP_COUNTER |
401 | 400 |
402 in_use_ = false; | 401 in_use_ = false; |
403 } | 402 } |
404 | 403 |
405 } // namespace internal | 404 } // namespace internal |
406 } // namespace v8 | 405 } // namespace v8 |
OLD | NEW |