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 #ifndef V8_COUNTERS_H_ | 5 #ifndef V8_COUNTERS_H_ |
6 #define V8_COUNTERS_H_ | 6 #define V8_COUNTERS_H_ |
7 | 7 |
8 #include "../include/v8.h" | 8 #include "../include/v8.h" |
9 #include "allocation.h" | 9 #include "allocation.h" |
| 10 #include "objects.h" |
| 11 #include "platform/elapsed-timer.h" |
| 12 #include "v8globals.h" |
10 | 13 |
11 namespace v8 { | 14 namespace v8 { |
12 namespace internal { | 15 namespace internal { |
13 | 16 |
14 // StatsCounters is an interface for plugging into external | 17 // StatsCounters is an interface for plugging into external |
15 // counters for monitoring. Counters can be looked up and | 18 // counters for monitoring. Counters can be looked up and |
16 // manipulated by name. | 19 // manipulated by name. |
17 | 20 |
18 class StatsTable { | 21 class StatsTable { |
19 public: | 22 public: |
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 #endif | 280 #endif |
278 } | 281 } |
279 private: | 282 private: |
280 HistogramTimer* timer_; | 283 HistogramTimer* timer_; |
281 #ifdef DEBUG | 284 #ifdef DEBUG |
282 bool skipped_timer_start_; | 285 bool skipped_timer_start_; |
283 #endif | 286 #endif |
284 }; | 287 }; |
285 | 288 |
286 | 289 |
| 290 #define HISTOGRAM_TIMER_LIST(HT) \ |
| 291 /* Garbage collection timers. */ \ |
| 292 HT(gc_compactor, V8.GCCompactor) \ |
| 293 HT(gc_scavenger, V8.GCScavenger) \ |
| 294 HT(gc_context, V8.GCContext) /* GC context cleanup time */ \ |
| 295 /* Parsing timers. */ \ |
| 296 HT(parse, V8.Parse) \ |
| 297 HT(parse_lazy, V8.ParseLazy) \ |
| 298 HT(pre_parse, V8.PreParse) \ |
| 299 /* Total compilation times. */ \ |
| 300 HT(compile, V8.Compile) \ |
| 301 HT(compile_eval, V8.CompileEval) \ |
| 302 HT(compile_lazy, V8.CompileLazy) |
| 303 |
| 304 #define HISTOGRAM_PERCENTAGE_LIST(HP) \ |
| 305 /* Heap fragmentation. */ \ |
| 306 HP(external_fragmentation_total, \ |
| 307 V8.MemoryExternalFragmentationTotal) \ |
| 308 HP(external_fragmentation_old_pointer_space, \ |
| 309 V8.MemoryExternalFragmentationOldPointerSpace) \ |
| 310 HP(external_fragmentation_old_data_space, \ |
| 311 V8.MemoryExternalFragmentationOldDataSpace) \ |
| 312 HP(external_fragmentation_code_space, \ |
| 313 V8.MemoryExternalFragmentationCodeSpace) \ |
| 314 HP(external_fragmentation_map_space, \ |
| 315 V8.MemoryExternalFragmentationMapSpace) \ |
| 316 HP(external_fragmentation_cell_space, \ |
| 317 V8.MemoryExternalFragmentationCellSpace) \ |
| 318 HP(external_fragmentation_property_cell_space, \ |
| 319 V8.MemoryExternalFragmentationPropertyCellSpace) \ |
| 320 HP(external_fragmentation_lo_space, \ |
| 321 V8.MemoryExternalFragmentationLoSpace) \ |
| 322 /* Percentages of heap committed to each space. */ \ |
| 323 HP(heap_fraction_new_space, \ |
| 324 V8.MemoryHeapFractionNewSpace) \ |
| 325 HP(heap_fraction_old_pointer_space, \ |
| 326 V8.MemoryHeapFractionOldPointerSpace) \ |
| 327 HP(heap_fraction_old_data_space, \ |
| 328 V8.MemoryHeapFractionOldDataSpace) \ |
| 329 HP(heap_fraction_code_space, \ |
| 330 V8.MemoryHeapFractionCodeSpace) \ |
| 331 HP(heap_fraction_map_space, \ |
| 332 V8.MemoryHeapFractionMapSpace) \ |
| 333 HP(heap_fraction_cell_space, \ |
| 334 V8.MemoryHeapFractionCellSpace) \ |
| 335 HP(heap_fraction_property_cell_space, \ |
| 336 V8.MemoryHeapFractionPropertyCellSpace) \ |
| 337 HP(heap_fraction_lo_space, \ |
| 338 V8.MemoryHeapFractionLoSpace) \ |
| 339 /* Percentage of crankshafted codegen. */ \ |
| 340 HP(codegen_fraction_crankshaft, \ |
| 341 V8.CodegenFractionCrankshaft) \ |
| 342 |
| 343 |
| 344 #define HISTOGRAM_MEMORY_LIST(HM) \ |
| 345 HM(heap_sample_total_committed, V8.MemoryHeapSampleTotalCommitted) \ |
| 346 HM(heap_sample_total_used, V8.MemoryHeapSampleTotalUsed) \ |
| 347 HM(heap_sample_map_space_committed, \ |
| 348 V8.MemoryHeapSampleMapSpaceCommitted) \ |
| 349 HM(heap_sample_cell_space_committed, \ |
| 350 V8.MemoryHeapSampleCellSpaceCommitted) \ |
| 351 HM(heap_sample_property_cell_space_committed, \ |
| 352 V8.MemoryHeapSamplePropertyCellSpaceCommitted) \ |
| 353 HM(heap_sample_code_space_committed, \ |
| 354 V8.MemoryHeapSampleCodeSpaceCommitted) \ |
| 355 HM(heap_sample_maximum_committed, \ |
| 356 V8.MemoryHeapSampleMaximumCommitted) \ |
| 357 |
| 358 |
| 359 // WARNING: STATS_COUNTER_LIST_* is a very large macro that is causing MSVC |
| 360 // Intellisense to crash. It was broken into two macros (each of length 40 |
| 361 // lines) rather than one macro (of length about 80 lines) to work around |
| 362 // this problem. Please avoid using recursive macros of this length when |
| 363 // possible. |
| 364 #define STATS_COUNTER_LIST_1(SC) \ |
| 365 /* Global Handle Count*/ \ |
| 366 SC(global_handles, V8.GlobalHandles) \ |
| 367 /* OS Memory allocated */ \ |
| 368 SC(memory_allocated, V8.OsMemoryAllocated) \ |
| 369 SC(normalized_maps, V8.NormalizedMaps) \ |
| 370 SC(props_to_dictionary, V8.ObjectPropertiesToDictionary) \ |
| 371 SC(elements_to_dictionary, V8.ObjectElementsToDictionary) \ |
| 372 SC(alive_after_last_gc, V8.AliveAfterLastGC) \ |
| 373 SC(objs_since_last_young, V8.ObjsSinceLastYoung) \ |
| 374 SC(objs_since_last_full, V8.ObjsSinceLastFull) \ |
| 375 SC(string_table_capacity, V8.StringTableCapacity) \ |
| 376 SC(number_of_symbols, V8.NumberOfSymbols) \ |
| 377 SC(script_wrappers, V8.ScriptWrappers) \ |
| 378 SC(call_initialize_stubs, V8.CallInitializeStubs) \ |
| 379 SC(call_premonomorphic_stubs, V8.CallPreMonomorphicStubs) \ |
| 380 SC(call_normal_stubs, V8.CallNormalStubs) \ |
| 381 SC(call_megamorphic_stubs, V8.CallMegamorphicStubs) \ |
| 382 SC(arguments_adaptors, V8.ArgumentsAdaptors) \ |
| 383 SC(compilation_cache_hits, V8.CompilationCacheHits) \ |
| 384 SC(compilation_cache_misses, V8.CompilationCacheMisses) \ |
| 385 SC(string_ctor_calls, V8.StringConstructorCalls) \ |
| 386 SC(string_ctor_conversions, V8.StringConstructorConversions) \ |
| 387 SC(string_ctor_cached_number, V8.StringConstructorCachedNumber) \ |
| 388 SC(string_ctor_string_value, V8.StringConstructorStringValue) \ |
| 389 SC(string_ctor_gc_required, V8.StringConstructorGCRequired) \ |
| 390 /* Amount of evaled source code. */ \ |
| 391 SC(total_eval_size, V8.TotalEvalSize) \ |
| 392 /* Amount of loaded source code. */ \ |
| 393 SC(total_load_size, V8.TotalLoadSize) \ |
| 394 /* Amount of parsed source code. */ \ |
| 395 SC(total_parse_size, V8.TotalParseSize) \ |
| 396 /* Amount of source code skipped over using preparsing. */ \ |
| 397 SC(total_preparse_skipped, V8.TotalPreparseSkipped) \ |
| 398 /* Number of symbol lookups skipped using preparsing */ \ |
| 399 SC(total_preparse_symbols_skipped, V8.TotalPreparseSymbolSkipped) \ |
| 400 /* Amount of compiled source code. */ \ |
| 401 SC(total_compile_size, V8.TotalCompileSize) \ |
| 402 /* Amount of source code compiled with the full codegen. */ \ |
| 403 SC(total_full_codegen_source_size, V8.TotalFullCodegenSourceSize) \ |
| 404 /* Number of contexts created from scratch. */ \ |
| 405 SC(contexts_created_from_scratch, V8.ContextsCreatedFromScratch) \ |
| 406 /* Number of contexts created by partial snapshot. */ \ |
| 407 SC(contexts_created_by_snapshot, V8.ContextsCreatedBySnapshot) \ |
| 408 /* Number of code objects found from pc. */ \ |
| 409 SC(pc_to_code, V8.PcToCode) \ |
| 410 SC(pc_to_code_cached, V8.PcToCodeCached) \ |
| 411 /* The store-buffer implementation of the write barrier. */ \ |
| 412 SC(store_buffer_compactions, V8.StoreBufferCompactions) \ |
| 413 SC(store_buffer_overflows, V8.StoreBufferOverflows) |
| 414 |
| 415 |
| 416 #define STATS_COUNTER_LIST_2(SC) \ |
| 417 /* Number of code stubs. */ \ |
| 418 SC(code_stubs, V8.CodeStubs) \ |
| 419 /* Amount of stub code. */ \ |
| 420 SC(total_stubs_code_size, V8.TotalStubsCodeSize) \ |
| 421 /* Amount of (JS) compiled code. */ \ |
| 422 SC(total_compiled_code_size, V8.TotalCompiledCodeSize) \ |
| 423 SC(gc_compactor_caused_by_request, V8.GCCompactorCausedByRequest) \ |
| 424 SC(gc_compactor_caused_by_promoted_data, \ |
| 425 V8.GCCompactorCausedByPromotedData) \ |
| 426 SC(gc_compactor_caused_by_oldspace_exhaustion, \ |
| 427 V8.GCCompactorCausedByOldspaceExhaustion) \ |
| 428 SC(gc_last_resort_from_js, V8.GCLastResortFromJS) \ |
| 429 SC(gc_last_resort_from_handles, V8.GCLastResortFromHandles) \ |
| 430 /* How is the generic keyed-load stub used? */ \ |
| 431 SC(keyed_load_generic_smi, V8.KeyedLoadGenericSmi) \ |
| 432 SC(keyed_load_generic_symbol, V8.KeyedLoadGenericSymbol) \ |
| 433 SC(keyed_load_generic_lookup_cache, V8.KeyedLoadGenericLookupCache) \ |
| 434 SC(keyed_load_generic_slow, V8.KeyedLoadGenericSlow) \ |
| 435 SC(keyed_load_polymorphic_stubs, V8.KeyedLoadPolymorphicStubs) \ |
| 436 SC(keyed_load_external_array_slow, V8.KeyedLoadExternalArraySlow) \ |
| 437 /* How is the generic keyed-call stub used? */ \ |
| 438 SC(keyed_call_generic_smi_fast, V8.KeyedCallGenericSmiFast) \ |
| 439 SC(keyed_call_generic_smi_dict, V8.KeyedCallGenericSmiDict) \ |
| 440 SC(keyed_call_generic_lookup_cache, V8.KeyedCallGenericLookupCache) \ |
| 441 SC(keyed_call_generic_lookup_dict, V8.KeyedCallGenericLookupDict) \ |
| 442 SC(keyed_call_generic_slow, V8.KeyedCallGenericSlow) \ |
| 443 SC(keyed_call_generic_slow_load, V8.KeyedCallGenericSlowLoad) \ |
| 444 SC(named_load_global_stub, V8.NamedLoadGlobalStub) \ |
| 445 SC(named_store_global_inline, V8.NamedStoreGlobalInline) \ |
| 446 SC(named_store_global_inline_miss, V8.NamedStoreGlobalInlineMiss) \ |
| 447 SC(keyed_store_polymorphic_stubs, V8.KeyedStorePolymorphicStubs) \ |
| 448 SC(keyed_store_external_array_slow, V8.KeyedStoreExternalArraySlow) \ |
| 449 SC(store_normal_miss, V8.StoreNormalMiss) \ |
| 450 SC(store_normal_hit, V8.StoreNormalHit) \ |
| 451 SC(cow_arrays_created_stub, V8.COWArraysCreatedStub) \ |
| 452 SC(cow_arrays_created_runtime, V8.COWArraysCreatedRuntime) \ |
| 453 SC(cow_arrays_converted, V8.COWArraysConverted) \ |
| 454 SC(call_miss, V8.CallMiss) \ |
| 455 SC(keyed_call_miss, V8.KeyedCallMiss) \ |
| 456 SC(load_miss, V8.LoadMiss) \ |
| 457 SC(keyed_load_miss, V8.KeyedLoadMiss) \ |
| 458 SC(call_const, V8.CallConst) \ |
| 459 SC(call_const_fast_api, V8.CallConstFastApi) \ |
| 460 SC(call_const_interceptor, V8.CallConstInterceptor) \ |
| 461 SC(call_const_interceptor_fast_api, V8.CallConstInterceptorFastApi) \ |
| 462 SC(call_global_inline, V8.CallGlobalInline) \ |
| 463 SC(call_global_inline_miss, V8.CallGlobalInlineMiss) \ |
| 464 SC(constructed_objects, V8.ConstructedObjects) \ |
| 465 SC(constructed_objects_runtime, V8.ConstructedObjectsRuntime) \ |
| 466 SC(negative_lookups, V8.NegativeLookups) \ |
| 467 SC(negative_lookups_miss, V8.NegativeLookupsMiss) \ |
| 468 SC(megamorphic_stub_cache_probes, V8.MegamorphicStubCacheProbes) \ |
| 469 SC(megamorphic_stub_cache_misses, V8.MegamorphicStubCacheMisses) \ |
| 470 SC(megamorphic_stub_cache_updates, V8.MegamorphicStubCacheUpdates) \ |
| 471 SC(array_function_runtime, V8.ArrayFunctionRuntime) \ |
| 472 SC(array_function_native, V8.ArrayFunctionNative) \ |
| 473 SC(for_in, V8.ForIn) \ |
| 474 SC(enum_cache_hits, V8.EnumCacheHits) \ |
| 475 SC(enum_cache_misses, V8.EnumCacheMisses) \ |
| 476 SC(zone_segment_bytes, V8.ZoneSegmentBytes) \ |
| 477 SC(fast_new_closure_total, V8.FastNewClosureTotal) \ |
| 478 SC(fast_new_closure_try_optimized, V8.FastNewClosureTryOptimized) \ |
| 479 SC(fast_new_closure_install_optimized, V8.FastNewClosureInstallOptimized) \ |
| 480 SC(string_add_runtime, V8.StringAddRuntime) \ |
| 481 SC(string_add_native, V8.StringAddNative) \ |
| 482 SC(string_add_runtime_ext_to_ascii, V8.StringAddRuntimeExtToAscii) \ |
| 483 SC(sub_string_runtime, V8.SubStringRuntime) \ |
| 484 SC(sub_string_native, V8.SubStringNative) \ |
| 485 SC(string_add_make_two_char, V8.StringAddMakeTwoChar) \ |
| 486 SC(string_compare_native, V8.StringCompareNative) \ |
| 487 SC(string_compare_runtime, V8.StringCompareRuntime) \ |
| 488 SC(regexp_entry_runtime, V8.RegExpEntryRuntime) \ |
| 489 SC(regexp_entry_native, V8.RegExpEntryNative) \ |
| 490 SC(number_to_string_native, V8.NumberToStringNative) \ |
| 491 SC(number_to_string_runtime, V8.NumberToStringRuntime) \ |
| 492 SC(math_acos, V8.MathAcos) \ |
| 493 SC(math_asin, V8.MathAsin) \ |
| 494 SC(math_atan, V8.MathAtan) \ |
| 495 SC(math_atan2, V8.MathAtan2) \ |
| 496 SC(math_exp, V8.MathExp) \ |
| 497 SC(math_floor, V8.MathFloor) \ |
| 498 SC(math_log, V8.MathLog) \ |
| 499 SC(math_pow, V8.MathPow) \ |
| 500 SC(math_round, V8.MathRound) \ |
| 501 SC(math_sqrt, V8.MathSqrt) \ |
| 502 SC(stack_interrupts, V8.StackInterrupts) \ |
| 503 SC(runtime_profiler_ticks, V8.RuntimeProfilerTicks) \ |
| 504 SC(bounds_checks_eliminated, V8.BoundsChecksEliminated) \ |
| 505 SC(bounds_checks_hoisted, V8.BoundsChecksHoisted) \ |
| 506 SC(soft_deopts_requested, V8.SoftDeoptsRequested) \ |
| 507 SC(soft_deopts_inserted, V8.SoftDeoptsInserted) \ |
| 508 SC(soft_deopts_executed, V8.SoftDeoptsExecuted) \ |
| 509 /* Number of write barriers in generated code. */ \ |
| 510 SC(write_barriers_dynamic, V8.WriteBarriersDynamic) \ |
| 511 SC(write_barriers_static, V8.WriteBarriersStatic) \ |
| 512 SC(new_space_bytes_available, V8.MemoryNewSpaceBytesAvailable) \ |
| 513 SC(new_space_bytes_committed, V8.MemoryNewSpaceBytesCommitted) \ |
| 514 SC(new_space_bytes_used, V8.MemoryNewSpaceBytesUsed) \ |
| 515 SC(old_pointer_space_bytes_available, \ |
| 516 V8.MemoryOldPointerSpaceBytesAvailable) \ |
| 517 SC(old_pointer_space_bytes_committed, \ |
| 518 V8.MemoryOldPointerSpaceBytesCommitted) \ |
| 519 SC(old_pointer_space_bytes_used, V8.MemoryOldPointerSpaceBytesUsed) \ |
| 520 SC(old_data_space_bytes_available, V8.MemoryOldDataSpaceBytesAvailable) \ |
| 521 SC(old_data_space_bytes_committed, V8.MemoryOldDataSpaceBytesCommitted) \ |
| 522 SC(old_data_space_bytes_used, V8.MemoryOldDataSpaceBytesUsed) \ |
| 523 SC(code_space_bytes_available, V8.MemoryCodeSpaceBytesAvailable) \ |
| 524 SC(code_space_bytes_committed, V8.MemoryCodeSpaceBytesCommitted) \ |
| 525 SC(code_space_bytes_used, V8.MemoryCodeSpaceBytesUsed) \ |
| 526 SC(map_space_bytes_available, V8.MemoryMapSpaceBytesAvailable) \ |
| 527 SC(map_space_bytes_committed, V8.MemoryMapSpaceBytesCommitted) \ |
| 528 SC(map_space_bytes_used, V8.MemoryMapSpaceBytesUsed) \ |
| 529 SC(cell_space_bytes_available, V8.MemoryCellSpaceBytesAvailable) \ |
| 530 SC(cell_space_bytes_committed, V8.MemoryCellSpaceBytesCommitted) \ |
| 531 SC(cell_space_bytes_used, V8.MemoryCellSpaceBytesUsed) \ |
| 532 SC(property_cell_space_bytes_available, \ |
| 533 V8.MemoryPropertyCellSpaceBytesAvailable) \ |
| 534 SC(property_cell_space_bytes_committed, \ |
| 535 V8.MemoryPropertyCellSpaceBytesCommitted) \ |
| 536 SC(property_cell_space_bytes_used, \ |
| 537 V8.MemoryPropertyCellSpaceBytesUsed) \ |
| 538 SC(lo_space_bytes_available, V8.MemoryLoSpaceBytesAvailable) \ |
| 539 SC(lo_space_bytes_committed, V8.MemoryLoSpaceBytesCommitted) \ |
| 540 SC(lo_space_bytes_used, V8.MemoryLoSpaceBytesUsed) |
| 541 |
| 542 |
| 543 // This file contains all the v8 counters that are in use. |
| 544 class Counters { |
| 545 public: |
| 546 #define HT(name, caption) \ |
| 547 HistogramTimer* name() { return &name##_; } |
| 548 HISTOGRAM_TIMER_LIST(HT) |
| 549 #undef HT |
| 550 |
| 551 #define HP(name, caption) \ |
| 552 Histogram* name() { return &name##_; } |
| 553 HISTOGRAM_PERCENTAGE_LIST(HP) |
| 554 #undef HP |
| 555 |
| 556 #define HM(name, caption) \ |
| 557 Histogram* name() { return &name##_; } |
| 558 HISTOGRAM_MEMORY_LIST(HM) |
| 559 #undef HM |
| 560 |
| 561 #define SC(name, caption) \ |
| 562 StatsCounter* name() { return &name##_; } |
| 563 STATS_COUNTER_LIST_1(SC) |
| 564 STATS_COUNTER_LIST_2(SC) |
| 565 #undef SC |
| 566 |
| 567 #define SC(name) \ |
| 568 StatsCounter* count_of_##name() { return &count_of_##name##_; } \ |
| 569 StatsCounter* size_of_##name() { return &size_of_##name##_; } |
| 570 INSTANCE_TYPE_LIST(SC) |
| 571 #undef SC |
| 572 |
| 573 #define SC(name) \ |
| 574 StatsCounter* count_of_CODE_TYPE_##name() \ |
| 575 { return &count_of_CODE_TYPE_##name##_; } \ |
| 576 StatsCounter* size_of_CODE_TYPE_##name() \ |
| 577 { return &size_of_CODE_TYPE_##name##_; } |
| 578 CODE_KIND_LIST(SC) |
| 579 #undef SC |
| 580 |
| 581 #define SC(name) \ |
| 582 StatsCounter* count_of_FIXED_ARRAY_##name() \ |
| 583 { return &count_of_FIXED_ARRAY_##name##_; } \ |
| 584 StatsCounter* size_of_FIXED_ARRAY_##name() \ |
| 585 { return &size_of_FIXED_ARRAY_##name##_; } |
| 586 FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(SC) |
| 587 #undef SC |
| 588 |
| 589 #define SC(name) \ |
| 590 StatsCounter* count_of_CODE_AGE_##name() \ |
| 591 { return &count_of_CODE_AGE_##name##_; } \ |
| 592 StatsCounter* size_of_CODE_AGE_##name() \ |
| 593 { return &size_of_CODE_AGE_##name##_; } |
| 594 CODE_AGE_LIST_COMPLETE(SC) |
| 595 #undef SC |
| 596 |
| 597 enum Id { |
| 598 #define RATE_ID(name, caption) k_##name, |
| 599 HISTOGRAM_TIMER_LIST(RATE_ID) |
| 600 #undef RATE_ID |
| 601 #define PERCENTAGE_ID(name, caption) k_##name, |
| 602 HISTOGRAM_PERCENTAGE_LIST(PERCENTAGE_ID) |
| 603 #undef PERCENTAGE_ID |
| 604 #define MEMORY_ID(name, caption) k_##name, |
| 605 HISTOGRAM_MEMORY_LIST(MEMORY_ID) |
| 606 #undef MEMORY_ID |
| 607 #define COUNTER_ID(name, caption) k_##name, |
| 608 STATS_COUNTER_LIST_1(COUNTER_ID) |
| 609 STATS_COUNTER_LIST_2(COUNTER_ID) |
| 610 #undef COUNTER_ID |
| 611 #define COUNTER_ID(name) kCountOf##name, kSizeOf##name, |
| 612 INSTANCE_TYPE_LIST(COUNTER_ID) |
| 613 #undef COUNTER_ID |
| 614 #define COUNTER_ID(name) kCountOfCODE_TYPE_##name, \ |
| 615 kSizeOfCODE_TYPE_##name, |
| 616 CODE_KIND_LIST(COUNTER_ID) |
| 617 #undef COUNTER_ID |
| 618 #define COUNTER_ID(name) kCountOfFIXED_ARRAY__##name, \ |
| 619 kSizeOfFIXED_ARRAY__##name, |
| 620 FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(COUNTER_ID) |
| 621 #undef COUNTER_ID |
| 622 #define COUNTER_ID(name) kCountOfCODE_AGE__##name, \ |
| 623 kSizeOfCODE_AGE__##name, |
| 624 CODE_AGE_LIST_COMPLETE(COUNTER_ID) |
| 625 #undef COUNTER_ID |
| 626 stats_counter_count |
| 627 }; |
| 628 |
| 629 void ResetHistograms(); |
| 630 |
| 631 private: |
| 632 #define HT(name, caption) \ |
| 633 HistogramTimer name##_; |
| 634 HISTOGRAM_TIMER_LIST(HT) |
| 635 #undef HT |
| 636 |
| 637 #define HP(name, caption) \ |
| 638 Histogram name##_; |
| 639 HISTOGRAM_PERCENTAGE_LIST(HP) |
| 640 #undef HP |
| 641 |
| 642 #define HM(name, caption) \ |
| 643 Histogram name##_; |
| 644 HISTOGRAM_MEMORY_LIST(HM) |
| 645 #undef HM |
| 646 |
| 647 #define SC(name, caption) \ |
| 648 StatsCounter name##_; |
| 649 STATS_COUNTER_LIST_1(SC) |
| 650 STATS_COUNTER_LIST_2(SC) |
| 651 #undef SC |
| 652 |
| 653 #define SC(name) \ |
| 654 StatsCounter size_of_##name##_; \ |
| 655 StatsCounter count_of_##name##_; |
| 656 INSTANCE_TYPE_LIST(SC) |
| 657 #undef SC |
| 658 |
| 659 #define SC(name) \ |
| 660 StatsCounter size_of_CODE_TYPE_##name##_; \ |
| 661 StatsCounter count_of_CODE_TYPE_##name##_; |
| 662 CODE_KIND_LIST(SC) |
| 663 #undef SC |
| 664 |
| 665 #define SC(name) \ |
| 666 StatsCounter size_of_FIXED_ARRAY_##name##_; \ |
| 667 StatsCounter count_of_FIXED_ARRAY_##name##_; |
| 668 FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(SC) |
| 669 #undef SC |
| 670 |
| 671 #define SC(name) \ |
| 672 StatsCounter size_of_CODE_AGE_##name##_; \ |
| 673 StatsCounter count_of_CODE_AGE_##name##_; |
| 674 CODE_AGE_LIST_COMPLETE(SC) |
| 675 #undef SC |
| 676 |
| 677 friend class Isolate; |
| 678 |
| 679 explicit Counters(Isolate* isolate); |
| 680 |
| 681 DISALLOW_IMPLICIT_CONSTRUCTORS(Counters); |
| 682 }; |
| 683 |
287 } } // namespace v8::internal | 684 } } // namespace v8::internal |
288 | 685 |
289 #endif // V8_COUNTERS_H_ | 686 #endif // V8_COUNTERS_H_ |
OLD | NEW |