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 "src/allocation.h" | 9 #include "src/allocation.h" |
10 #include "src/base/platform/elapsed-timer.h" | 10 #include "src/base/platform/elapsed-timer.h" |
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
418 /* Number of contexts created by partial snapshot. */ \ | 418 /* Number of contexts created by partial snapshot. */ \ |
419 SC(contexts_created_by_snapshot, V8.ContextsCreatedBySnapshot) \ | 419 SC(contexts_created_by_snapshot, V8.ContextsCreatedBySnapshot) \ |
420 /* Number of code objects found from pc. */ \ | 420 /* Number of code objects found from pc. */ \ |
421 SC(pc_to_code, V8.PcToCode) \ | 421 SC(pc_to_code, V8.PcToCode) \ |
422 SC(pc_to_code_cached, V8.PcToCodeCached) \ | 422 SC(pc_to_code_cached, V8.PcToCodeCached) \ |
423 /* The store-buffer implementation of the write barrier. */ \ | 423 /* The store-buffer implementation of the write barrier. */ \ |
424 SC(store_buffer_compactions, V8.StoreBufferCompactions) \ | 424 SC(store_buffer_compactions, V8.StoreBufferCompactions) \ |
425 SC(store_buffer_overflows, V8.StoreBufferOverflows) | 425 SC(store_buffer_overflows, V8.StoreBufferOverflows) |
426 | 426 |
427 | 427 |
428 #define STATS_COUNTER_LIST_2(SC) \ | 428 #define STATS_COUNTER_LIST_2(SC) \ |
429 /* Number of code stubs. */ \ | 429 /* Number of code stubs. */ \ |
430 SC(code_stubs, V8.CodeStubs) \ | 430 SC(code_stubs, V8.CodeStubs) \ |
431 /* Amount of stub code. */ \ | 431 /* Amount of stub code. */ \ |
432 SC(total_stubs_code_size, V8.TotalStubsCodeSize) \ | 432 SC(total_stubs_code_size, V8.TotalStubsCodeSize) \ |
433 /* Amount of (JS) compiled code. */ \ | 433 /* Amount of (JS) compiled code. */ \ |
434 SC(total_compiled_code_size, V8.TotalCompiledCodeSize) \ | 434 SC(total_compiled_code_size, V8.TotalCompiledCodeSize) \ |
435 SC(gc_compactor_caused_by_request, V8.GCCompactorCausedByRequest) \ | 435 SC(gc_compactor_caused_by_request, V8.GCCompactorCausedByRequest) \ |
436 SC(gc_compactor_caused_by_promoted_data, \ | 436 SC(gc_compactor_caused_by_promoted_data, V8.GCCompactorCausedByPromotedData) \ |
437 V8.GCCompactorCausedByPromotedData) \ | 437 SC(gc_compactor_caused_by_oldspace_exhaustion, \ |
438 SC(gc_compactor_caused_by_oldspace_exhaustion, \ | 438 V8.GCCompactorCausedByOldspaceExhaustion) \ |
439 V8.GCCompactorCausedByOldspaceExhaustion) \ | 439 SC(gc_last_resort_from_js, V8.GCLastResortFromJS) \ |
440 SC(gc_last_resort_from_js, V8.GCLastResortFromJS) \ | 440 SC(gc_last_resort_from_handles, V8.GCLastResortFromHandles) \ |
441 SC(gc_last_resort_from_handles, V8.GCLastResortFromHandles) \ | 441 /* How is the generic keyed-load stub used? */ \ |
442 /* How is the generic keyed-load stub used? */ \ | 442 SC(keyed_load_generic_smi, V8.KeyedLoadGenericSmi) \ |
443 SC(keyed_load_generic_smi, V8.KeyedLoadGenericSmi) \ | 443 SC(keyed_load_generic_symbol, V8.KeyedLoadGenericSymbol) \ |
444 SC(keyed_load_generic_symbol, V8.KeyedLoadGenericSymbol) \ | 444 SC(keyed_load_generic_lookup_cache, V8.KeyedLoadGenericLookupCache) \ |
445 SC(keyed_load_generic_lookup_cache, V8.KeyedLoadGenericLookupCache) \ | 445 SC(keyed_load_generic_slow, V8.KeyedLoadGenericSlow) \ |
446 SC(keyed_load_generic_slow, V8.KeyedLoadGenericSlow) \ | 446 SC(keyed_load_polymorphic_stubs, V8.KeyedLoadPolymorphicStubs) \ |
447 SC(keyed_load_polymorphic_stubs, V8.KeyedLoadPolymorphicStubs) \ | 447 SC(keyed_load_external_array_slow, V8.KeyedLoadExternalArraySlow) \ |
448 SC(keyed_load_external_array_slow, V8.KeyedLoadExternalArraySlow) \ | 448 /* How is the generic keyed-call stub used? */ \ |
449 /* How is the generic keyed-call stub used? */ \ | 449 SC(keyed_call_generic_smi_fast, V8.KeyedCallGenericSmiFast) \ |
450 SC(keyed_call_generic_smi_fast, V8.KeyedCallGenericSmiFast) \ | 450 SC(keyed_call_generic_smi_dict, V8.KeyedCallGenericSmiDict) \ |
451 SC(keyed_call_generic_smi_dict, V8.KeyedCallGenericSmiDict) \ | 451 SC(keyed_call_generic_lookup_cache, V8.KeyedCallGenericLookupCache) \ |
452 SC(keyed_call_generic_lookup_cache, V8.KeyedCallGenericLookupCache) \ | 452 SC(keyed_call_generic_lookup_dict, V8.KeyedCallGenericLookupDict) \ |
453 SC(keyed_call_generic_lookup_dict, V8.KeyedCallGenericLookupDict) \ | 453 SC(keyed_call_generic_slow, V8.KeyedCallGenericSlow) \ |
454 SC(keyed_call_generic_slow, V8.KeyedCallGenericSlow) \ | 454 SC(keyed_call_generic_slow_load, V8.KeyedCallGenericSlowLoad) \ |
455 SC(keyed_call_generic_slow_load, V8.KeyedCallGenericSlowLoad) \ | 455 SC(named_load_global_stub, V8.NamedLoadGlobalStub) \ |
456 SC(named_load_global_stub, V8.NamedLoadGlobalStub) \ | 456 SC(named_store_global_inline, V8.NamedStoreGlobalInline) \ |
457 SC(named_store_global_inline, V8.NamedStoreGlobalInline) \ | 457 SC(named_store_global_inline_miss, V8.NamedStoreGlobalInlineMiss) \ |
458 SC(named_store_global_inline_miss, V8.NamedStoreGlobalInlineMiss) \ | 458 SC(keyed_store_polymorphic_stubs, V8.KeyedStorePolymorphicStubs) \ |
459 SC(keyed_store_polymorphic_stubs, V8.KeyedStorePolymorphicStubs) \ | 459 SC(keyed_store_external_array_slow, V8.KeyedStoreExternalArraySlow) \ |
460 SC(keyed_store_external_array_slow, V8.KeyedStoreExternalArraySlow) \ | 460 SC(store_normal_miss, V8.StoreNormalMiss) \ |
461 SC(store_normal_miss, V8.StoreNormalMiss) \ | 461 SC(store_normal_hit, V8.StoreNormalHit) \ |
462 SC(store_normal_hit, V8.StoreNormalHit) \ | 462 SC(cow_arrays_created_stub, V8.COWArraysCreatedStub) \ |
463 SC(cow_arrays_created_stub, V8.COWArraysCreatedStub) \ | 463 SC(cow_arrays_created_runtime, V8.COWArraysCreatedRuntime) \ |
464 SC(cow_arrays_created_runtime, V8.COWArraysCreatedRuntime) \ | 464 SC(cow_arrays_converted, V8.COWArraysConverted) \ |
465 SC(cow_arrays_converted, V8.COWArraysConverted) \ | 465 SC(call_miss, V8.CallMiss) \ |
466 SC(call_miss, V8.CallMiss) \ | 466 SC(keyed_call_miss, V8.KeyedCallMiss) \ |
467 SC(keyed_call_miss, V8.KeyedCallMiss) \ | 467 SC(load_miss, V8.LoadMiss) \ |
468 SC(load_miss, V8.LoadMiss) \ | 468 SC(keyed_load_miss, V8.KeyedLoadMiss) \ |
469 SC(keyed_load_miss, V8.KeyedLoadMiss) \ | 469 SC(call_const, V8.CallConst) \ |
470 SC(call_const, V8.CallConst) \ | 470 SC(call_const_fast_api, V8.CallConstFastApi) \ |
471 SC(call_const_fast_api, V8.CallConstFastApi) \ | 471 SC(call_const_interceptor, V8.CallConstInterceptor) \ |
472 SC(call_const_interceptor, V8.CallConstInterceptor) \ | 472 SC(call_const_interceptor_fast_api, V8.CallConstInterceptorFastApi) \ |
473 SC(call_const_interceptor_fast_api, V8.CallConstInterceptorFastApi) \ | 473 SC(call_global_inline, V8.CallGlobalInline) \ |
474 SC(call_global_inline, V8.CallGlobalInline) \ | 474 SC(call_global_inline_miss, V8.CallGlobalInlineMiss) \ |
475 SC(call_global_inline_miss, V8.CallGlobalInlineMiss) \ | 475 SC(constructed_objects, V8.ConstructedObjects) \ |
476 SC(constructed_objects, V8.ConstructedObjects) \ | 476 SC(constructed_objects_runtime, V8.ConstructedObjectsRuntime) \ |
477 SC(constructed_objects_runtime, V8.ConstructedObjectsRuntime) \ | 477 SC(negative_lookups, V8.NegativeLookups) \ |
478 SC(negative_lookups, V8.NegativeLookups) \ | 478 SC(negative_lookups_miss, V8.NegativeLookupsMiss) \ |
479 SC(negative_lookups_miss, V8.NegativeLookupsMiss) \ | 479 SC(megamorphic_stub_cache_probes, V8.MegamorphicStubCacheProbes) \ |
480 SC(megamorphic_stub_cache_probes, V8.MegamorphicStubCacheProbes) \ | 480 SC(megamorphic_stub_cache_misses, V8.MegamorphicStubCacheMisses) \ |
481 SC(megamorphic_stub_cache_misses, V8.MegamorphicStubCacheMisses) \ | 481 SC(megamorphic_stub_cache_updates, V8.MegamorphicStubCacheUpdates) \ |
482 SC(megamorphic_stub_cache_updates, V8.MegamorphicStubCacheUpdates) \ | 482 SC(array_function_runtime, V8.ArrayFunctionRuntime) \ |
483 SC(array_function_runtime, V8.ArrayFunctionRuntime) \ | 483 SC(array_function_native, V8.ArrayFunctionNative) \ |
484 SC(array_function_native, V8.ArrayFunctionNative) \ | 484 SC(for_in, V8.ForIn) \ |
485 SC(for_in, V8.ForIn) \ | 485 SC(enum_cache_hits, V8.EnumCacheHits) \ |
486 SC(enum_cache_hits, V8.EnumCacheHits) \ | 486 SC(enum_cache_misses, V8.EnumCacheMisses) \ |
487 SC(enum_cache_misses, V8.EnumCacheMisses) \ | 487 SC(zone_segment_bytes, V8.ZoneSegmentBytes) \ |
488 SC(zone_segment_bytes, V8.ZoneSegmentBytes) \ | 488 SC(fast_new_closure_total, V8.FastNewClosureTotal) \ |
489 SC(fast_new_closure_total, V8.FastNewClosureTotal) \ | 489 SC(fast_new_closure_try_optimized, V8.FastNewClosureTryOptimized) \ |
490 SC(fast_new_closure_try_optimized, V8.FastNewClosureTryOptimized) \ | 490 SC(fast_new_closure_install_optimized, V8.FastNewClosureInstallOptimized) \ |
491 SC(fast_new_closure_install_optimized, V8.FastNewClosureInstallOptimized) \ | 491 SC(string_add_runtime, V8.StringAddRuntime) \ |
492 SC(string_add_runtime, V8.StringAddRuntime) \ | 492 SC(string_add_native, V8.StringAddNative) \ |
493 SC(string_add_native, V8.StringAddNative) \ | 493 SC(string_add_runtime_ext_to_one_byte, V8.StringAddRuntimeExtToOneByte) \ |
494 SC(string_add_runtime_ext_to_ascii, V8.StringAddRuntimeExtToAscii) \ | 494 SC(sub_string_runtime, V8.SubStringRuntime) \ |
495 SC(sub_string_runtime, V8.SubStringRuntime) \ | 495 SC(sub_string_native, V8.SubStringNative) \ |
496 SC(sub_string_native, V8.SubStringNative) \ | 496 SC(string_add_make_two_char, V8.StringAddMakeTwoChar) \ |
497 SC(string_add_make_two_char, V8.StringAddMakeTwoChar) \ | 497 SC(string_compare_native, V8.StringCompareNative) \ |
498 SC(string_compare_native, V8.StringCompareNative) \ | 498 SC(string_compare_runtime, V8.StringCompareRuntime) \ |
499 SC(string_compare_runtime, V8.StringCompareRuntime) \ | 499 SC(regexp_entry_runtime, V8.RegExpEntryRuntime) \ |
500 SC(regexp_entry_runtime, V8.RegExpEntryRuntime) \ | 500 SC(regexp_entry_native, V8.RegExpEntryNative) \ |
501 SC(regexp_entry_native, V8.RegExpEntryNative) \ | 501 SC(number_to_string_native, V8.NumberToStringNative) \ |
502 SC(number_to_string_native, V8.NumberToStringNative) \ | 502 SC(number_to_string_runtime, V8.NumberToStringRuntime) \ |
503 SC(number_to_string_runtime, V8.NumberToStringRuntime) \ | 503 SC(math_acos, V8.MathAcos) \ |
504 SC(math_acos, V8.MathAcos) \ | 504 SC(math_asin, V8.MathAsin) \ |
505 SC(math_asin, V8.MathAsin) \ | 505 SC(math_atan, V8.MathAtan) \ |
506 SC(math_atan, V8.MathAtan) \ | 506 SC(math_atan2, V8.MathAtan2) \ |
507 SC(math_atan2, V8.MathAtan2) \ | 507 SC(math_exp, V8.MathExp) \ |
508 SC(math_exp, V8.MathExp) \ | 508 SC(math_floor, V8.MathFloor) \ |
509 SC(math_floor, V8.MathFloor) \ | 509 SC(math_log, V8.MathLog) \ |
510 SC(math_log, V8.MathLog) \ | 510 SC(math_pow, V8.MathPow) \ |
511 SC(math_pow, V8.MathPow) \ | 511 SC(math_round, V8.MathRound) \ |
512 SC(math_round, V8.MathRound) \ | 512 SC(math_sqrt, V8.MathSqrt) \ |
513 SC(math_sqrt, V8.MathSqrt) \ | 513 SC(stack_interrupts, V8.StackInterrupts) \ |
514 SC(stack_interrupts, V8.StackInterrupts) \ | 514 SC(runtime_profiler_ticks, V8.RuntimeProfilerTicks) \ |
515 SC(runtime_profiler_ticks, V8.RuntimeProfilerTicks) \ | 515 SC(bounds_checks_eliminated, V8.BoundsChecksEliminated) \ |
516 SC(bounds_checks_eliminated, V8.BoundsChecksEliminated) \ | 516 SC(bounds_checks_hoisted, V8.BoundsChecksHoisted) \ |
517 SC(bounds_checks_hoisted, V8.BoundsChecksHoisted) \ | 517 SC(soft_deopts_requested, V8.SoftDeoptsRequested) \ |
518 SC(soft_deopts_requested, V8.SoftDeoptsRequested) \ | 518 SC(soft_deopts_inserted, V8.SoftDeoptsInserted) \ |
519 SC(soft_deopts_inserted, V8.SoftDeoptsInserted) \ | 519 SC(soft_deopts_executed, V8.SoftDeoptsExecuted) \ |
520 SC(soft_deopts_executed, V8.SoftDeoptsExecuted) \ | 520 /* Number of write barriers in generated code. */ \ |
521 /* Number of write barriers in generated code. */ \ | 521 SC(write_barriers_dynamic, V8.WriteBarriersDynamic) \ |
522 SC(write_barriers_dynamic, V8.WriteBarriersDynamic) \ | 522 SC(write_barriers_static, V8.WriteBarriersStatic) \ |
523 SC(write_barriers_static, V8.WriteBarriersStatic) \ | 523 SC(new_space_bytes_available, V8.MemoryNewSpaceBytesAvailable) \ |
524 SC(new_space_bytes_available, V8.MemoryNewSpaceBytesAvailable) \ | 524 SC(new_space_bytes_committed, V8.MemoryNewSpaceBytesCommitted) \ |
525 SC(new_space_bytes_committed, V8.MemoryNewSpaceBytesCommitted) \ | 525 SC(new_space_bytes_used, V8.MemoryNewSpaceBytesUsed) \ |
526 SC(new_space_bytes_used, V8.MemoryNewSpaceBytesUsed) \ | 526 SC(old_pointer_space_bytes_available, \ |
527 SC(old_pointer_space_bytes_available, \ | 527 V8.MemoryOldPointerSpaceBytesAvailable) \ |
528 V8.MemoryOldPointerSpaceBytesAvailable) \ | 528 SC(old_pointer_space_bytes_committed, \ |
529 SC(old_pointer_space_bytes_committed, \ | 529 V8.MemoryOldPointerSpaceBytesCommitted) \ |
530 V8.MemoryOldPointerSpaceBytesCommitted) \ | 530 SC(old_pointer_space_bytes_used, V8.MemoryOldPointerSpaceBytesUsed) \ |
531 SC(old_pointer_space_bytes_used, V8.MemoryOldPointerSpaceBytesUsed) \ | 531 SC(old_data_space_bytes_available, V8.MemoryOldDataSpaceBytesAvailable) \ |
532 SC(old_data_space_bytes_available, V8.MemoryOldDataSpaceBytesAvailable) \ | 532 SC(old_data_space_bytes_committed, V8.MemoryOldDataSpaceBytesCommitted) \ |
533 SC(old_data_space_bytes_committed, V8.MemoryOldDataSpaceBytesCommitted) \ | 533 SC(old_data_space_bytes_used, V8.MemoryOldDataSpaceBytesUsed) \ |
534 SC(old_data_space_bytes_used, V8.MemoryOldDataSpaceBytesUsed) \ | 534 SC(code_space_bytes_available, V8.MemoryCodeSpaceBytesAvailable) \ |
535 SC(code_space_bytes_available, V8.MemoryCodeSpaceBytesAvailable) \ | 535 SC(code_space_bytes_committed, V8.MemoryCodeSpaceBytesCommitted) \ |
536 SC(code_space_bytes_committed, V8.MemoryCodeSpaceBytesCommitted) \ | 536 SC(code_space_bytes_used, V8.MemoryCodeSpaceBytesUsed) \ |
537 SC(code_space_bytes_used, V8.MemoryCodeSpaceBytesUsed) \ | 537 SC(map_space_bytes_available, V8.MemoryMapSpaceBytesAvailable) \ |
538 SC(map_space_bytes_available, V8.MemoryMapSpaceBytesAvailable) \ | 538 SC(map_space_bytes_committed, V8.MemoryMapSpaceBytesCommitted) \ |
539 SC(map_space_bytes_committed, V8.MemoryMapSpaceBytesCommitted) \ | 539 SC(map_space_bytes_used, V8.MemoryMapSpaceBytesUsed) \ |
540 SC(map_space_bytes_used, V8.MemoryMapSpaceBytesUsed) \ | 540 SC(cell_space_bytes_available, V8.MemoryCellSpaceBytesAvailable) \ |
541 SC(cell_space_bytes_available, V8.MemoryCellSpaceBytesAvailable) \ | 541 SC(cell_space_bytes_committed, V8.MemoryCellSpaceBytesCommitted) \ |
542 SC(cell_space_bytes_committed, V8.MemoryCellSpaceBytesCommitted) \ | 542 SC(cell_space_bytes_used, V8.MemoryCellSpaceBytesUsed) \ |
543 SC(cell_space_bytes_used, V8.MemoryCellSpaceBytesUsed) \ | 543 SC(property_cell_space_bytes_available, \ |
544 SC(property_cell_space_bytes_available, \ | 544 V8.MemoryPropertyCellSpaceBytesAvailable) \ |
545 V8.MemoryPropertyCellSpaceBytesAvailable) \ | 545 SC(property_cell_space_bytes_committed, \ |
546 SC(property_cell_space_bytes_committed, \ | 546 V8.MemoryPropertyCellSpaceBytesCommitted) \ |
547 V8.MemoryPropertyCellSpaceBytesCommitted) \ | 547 SC(property_cell_space_bytes_used, V8.MemoryPropertyCellSpaceBytesUsed) \ |
548 SC(property_cell_space_bytes_used, \ | 548 SC(lo_space_bytes_available, V8.MemoryLoSpaceBytesAvailable) \ |
549 V8.MemoryPropertyCellSpaceBytesUsed) \ | 549 SC(lo_space_bytes_committed, V8.MemoryLoSpaceBytesCommitted) \ |
550 SC(lo_space_bytes_available, V8.MemoryLoSpaceBytesAvailable) \ | |
551 SC(lo_space_bytes_committed, V8.MemoryLoSpaceBytesCommitted) \ | |
552 SC(lo_space_bytes_used, V8.MemoryLoSpaceBytesUsed) | 550 SC(lo_space_bytes_used, V8.MemoryLoSpaceBytesUsed) |
553 | 551 |
554 | 552 |
555 // This file contains all the v8 counters that are in use. | 553 // This file contains all the v8 counters that are in use. |
556 class Counters { | 554 class Counters { |
557 public: | 555 public: |
558 #define HR(name, caption, min, max, num_buckets) \ | 556 #define HR(name, caption, min, max, num_buckets) \ |
559 Histogram* name() { return &name##_; } | 557 Histogram* name() { return &name##_; } |
560 HISTOGRAM_RANGE_LIST(HR) | 558 HISTOGRAM_RANGE_LIST(HR) |
561 #undef HR | 559 #undef HR |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
699 friend class Isolate; | 697 friend class Isolate; |
700 | 698 |
701 explicit Counters(Isolate* isolate); | 699 explicit Counters(Isolate* isolate); |
702 | 700 |
703 DISALLOW_IMPLICIT_CONSTRUCTORS(Counters); | 701 DISALLOW_IMPLICIT_CONSTRUCTORS(Counters); |
704 }; | 702 }; |
705 | 703 |
706 } } // namespace v8::internal | 704 } } // namespace v8::internal |
707 | 705 |
708 #endif // V8_COUNTERS_H_ | 706 #endif // V8_COUNTERS_H_ |
OLD | NEW |