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)) { |
alph
2016/10/31 20:46:53
nit: no need {} for return;
lpy
2016/10/31 20:54:19
I think Yang once mentioned V8 prefers {}
alph
2016/10/31 21:17:19
Interesting. the code style guide https://google.g
| |
348 !TRACE_EVENT_RUNTIME_CALL_STATS_TRACING_ENABLED()) | |
349 return; | 348 return; |
349 } | |
350 #define RESET_COUNTER(name) this->name.Reset(); | 350 #define RESET_COUNTER(name) this->name.Reset(); |
351 FOR_EACH_MANUAL_COUNTER(RESET_COUNTER) | 351 FOR_EACH_MANUAL_COUNTER(RESET_COUNTER) |
352 #undef RESET_COUNTER | 352 #undef RESET_COUNTER |
353 | 353 |
354 #define RESET_COUNTER(name, nargs, result_size) this->Runtime_##name.Reset(); | 354 #define RESET_COUNTER(name, nargs, result_size) this->Runtime_##name.Reset(); |
355 FOR_EACH_INTRINSIC(RESET_COUNTER) | 355 FOR_EACH_INTRINSIC(RESET_COUNTER) |
356 #undef RESET_COUNTER | 356 #undef RESET_COUNTER |
357 | 357 |
358 #define RESET_COUNTER(name) this->Builtin_##name.Reset(); | 358 #define RESET_COUNTER(name) this->Builtin_##name.Reset(); |
359 BUILTIN_LIST_C(RESET_COUNTER) | 359 BUILTIN_LIST_C(RESET_COUNTER) |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
397 #define DUMP_COUNTER(name) \ | 397 #define DUMP_COUNTER(name) \ |
398 if (this->Handler_##name.count > 0) this->Handler_##name.Dump(value); | 398 if (this->Handler_##name.count > 0) this->Handler_##name.Dump(value); |
399 FOR_EACH_HANDLER_COUNTER(DUMP_COUNTER) | 399 FOR_EACH_HANDLER_COUNTER(DUMP_COUNTER) |
400 #undef DUMP_COUNTER | 400 #undef DUMP_COUNTER |
401 | 401 |
402 in_use_ = false; | 402 in_use_ = false; |
403 } | 403 } |
404 | 404 |
405 } // namespace internal | 405 } // namespace internal |
406 } // namespace v8 | 406 } // namespace v8 |
OLD | NEW |