| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 /* Parsing timers. */ \ | 44 /* Parsing timers. */ \ |
| 45 HT(parse, V8.Parse) \ | 45 HT(parse, V8.Parse) \ |
| 46 HT(parse_lazy, V8.ParseLazy) \ | 46 HT(parse_lazy, V8.ParseLazy) \ |
| 47 HT(pre_parse, V8.PreParse) \ | 47 HT(pre_parse, V8.PreParse) \ |
| 48 /* Total compilation times. */ \ | 48 /* Total compilation times. */ \ |
| 49 HT(compile, V8.Compile) \ | 49 HT(compile, V8.Compile) \ |
| 50 HT(compile_eval, V8.CompileEval) \ | 50 HT(compile_eval, V8.CompileEval) \ |
| 51 HT(compile_lazy, V8.CompileLazy) | 51 HT(compile_lazy, V8.CompileLazy) |
| 52 | 52 |
| 53 #define HISTOGRAM_PERCENTAGE_LIST(HP) \ | 53 #define HISTOGRAM_PERCENTAGE_LIST(HP) \ |
| 54 /* Heap fragmentation. */ \ |
| 54 HP(external_fragmentation_total, \ | 55 HP(external_fragmentation_total, \ |
| 55 V8.MemoryExternalFragmentationTotal) \ | 56 V8.MemoryExternalFragmentationTotal) \ |
| 56 HP(external_fragmentation_old_pointer_space, \ | 57 HP(external_fragmentation_old_pointer_space, \ |
| 57 V8.MemoryExternalFragmentationOldPointerSpace) \ | 58 V8.MemoryExternalFragmentationOldPointerSpace) \ |
| 58 HP(external_fragmentation_old_data_space, \ | 59 HP(external_fragmentation_old_data_space, \ |
| 59 V8.MemoryExternalFragmentationOldDataSpace) \ | 60 V8.MemoryExternalFragmentationOldDataSpace) \ |
| 60 HP(external_fragmentation_code_space, \ | 61 HP(external_fragmentation_code_space, \ |
| 61 V8.MemoryExternalFragmentationCodeSpace) \ | 62 V8.MemoryExternalFragmentationCodeSpace) \ |
| 62 HP(external_fragmentation_map_space, \ | 63 HP(external_fragmentation_map_space, \ |
| 63 V8.MemoryExternalFragmentationMapSpace) \ | 64 V8.MemoryExternalFragmentationMapSpace) \ |
| 64 HP(external_fragmentation_cell_space, \ | 65 HP(external_fragmentation_cell_space, \ |
| 65 V8.MemoryExternalFragmentationCellSpace) \ | 66 V8.MemoryExternalFragmentationCellSpace) \ |
| 66 HP(external_fragmentation_property_cell_space, \ | 67 HP(external_fragmentation_property_cell_space, \ |
| 67 V8.MemoryExternalFragmentationPropertyCellSpace) \ | 68 V8.MemoryExternalFragmentationPropertyCellSpace) \ |
| 68 HP(external_fragmentation_lo_space, \ | 69 HP(external_fragmentation_lo_space, \ |
| 69 V8.MemoryExternalFragmentationLoSpace) \ | 70 V8.MemoryExternalFragmentationLoSpace) \ |
| 71 /* Percentages of heap committed to each space. */ \ |
| 72 HP(heap_fraction_new_space, \ |
| 73 V8.MemoryHeapFractionNewSpace) \ |
| 74 HP(heap_fraction_old_pointer_space, \ |
| 75 V8.MemoryHeapFractionOldPointerSpace) \ |
| 76 HP(heap_fraction_old_data_space, \ |
| 77 V8.MemoryHeapFractionOldDataSpace) \ |
| 78 HP(heap_fraction_code_space, \ |
| 79 V8.MemoryHeapFractionCodeSpace) \ |
| 70 HP(heap_fraction_map_space, \ | 80 HP(heap_fraction_map_space, \ |
| 71 V8.MemoryHeapFractionMapSpace) \ | 81 V8.MemoryHeapFractionMapSpace) \ |
| 72 HP(heap_fraction_cell_space, \ | 82 HP(heap_fraction_cell_space, \ |
| 73 V8.MemoryHeapFractionCellSpace) \ | 83 V8.MemoryHeapFractionCellSpace) \ |
| 74 HP(heap_fraction_property_cell_space, \ | 84 HP(heap_fraction_property_cell_space, \ |
| 75 V8.MemoryHeapFractionPropertyCellSpace) \ | 85 V8.MemoryHeapFractionPropertyCellSpace) \ |
| 86 HP(heap_fraction_lo_space, \ |
| 87 V8.MemoryHeapFractionLoSpace) \ |
| 88 /* Percentage of crankshafted codegen. */ \ |
| 89 HP(codegen_fraction_crankshaft, \ |
| 90 V8.CodegenFractionCrankshaft) \ |
| 76 | 91 |
| 77 | 92 |
| 78 #define HISTOGRAM_MEMORY_LIST(HM) \ | 93 #define HISTOGRAM_MEMORY_LIST(HM) \ |
| 79 HM(heap_sample_total_committed, V8.MemoryHeapSampleTotalCommitted) \ | 94 HM(heap_sample_total_committed, V8.MemoryHeapSampleTotalCommitted) \ |
| 80 HM(heap_sample_total_used, V8.MemoryHeapSampleTotalUsed) \ | 95 HM(heap_sample_total_used, V8.MemoryHeapSampleTotalUsed) \ |
| 81 HM(heap_sample_map_space_committed, \ | 96 HM(heap_sample_map_space_committed, \ |
| 82 V8.MemoryHeapSampleMapSpaceCommitted) \ | 97 V8.MemoryHeapSampleMapSpaceCommitted) \ |
| 83 HM(heap_sample_cell_space_committed, \ | 98 HM(heap_sample_cell_space_committed, \ |
| 84 V8.MemoryHeapSampleCellSpaceCommitted) \ | 99 V8.MemoryHeapSampleCellSpaceCommitted) \ |
| 85 HM(heap_sample_property_cell_space_committed, \ | 100 HM(heap_sample_property_cell_space_committed, \ |
| 86 V8.MemoryHeapSamplePropertyCellSpaceCommitted) \ | 101 V8.MemoryHeapSamplePropertyCellSpaceCommitted) \ |
| 102 HM(heap_sample_code_space_committed, \ |
| 103 V8.MemoryHeapSampleCodeSpaceCommitted) \ |
| 87 | 104 |
| 88 | 105 |
| 89 // WARNING: STATS_COUNTER_LIST_* is a very large macro that is causing MSVC | 106 // WARNING: STATS_COUNTER_LIST_* is a very large macro that is causing MSVC |
| 90 // Intellisense to crash. It was broken into two macros (each of length 40 | 107 // Intellisense to crash. It was broken into two macros (each of length 40 |
| 91 // lines) rather than one macro (of length about 80 lines) to work around | 108 // lines) rather than one macro (of length about 80 lines) to work around |
| 92 // this problem. Please avoid using recursive macros of this length when | 109 // this problem. Please avoid using recursive macros of this length when |
| 93 // possible. | 110 // possible. |
| 94 #define STATS_COUNTER_LIST_1(SC) \ | 111 #define STATS_COUNTER_LIST_1(SC) \ |
| 95 /* Global Handle Count*/ \ | 112 /* Global Handle Count*/ \ |
| 96 SC(global_handles, V8.GlobalHandles) \ | 113 SC(global_handles, V8.GlobalHandles) \ |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 312 #undef SC | 329 #undef SC |
| 313 | 330 |
| 314 #define SC(name) \ | 331 #define SC(name) \ |
| 315 StatsCounter* count_of_FIXED_ARRAY_##name() \ | 332 StatsCounter* count_of_FIXED_ARRAY_##name() \ |
| 316 { return &count_of_FIXED_ARRAY_##name##_; } \ | 333 { return &count_of_FIXED_ARRAY_##name##_; } \ |
| 317 StatsCounter* size_of_FIXED_ARRAY_##name() \ | 334 StatsCounter* size_of_FIXED_ARRAY_##name() \ |
| 318 { return &size_of_FIXED_ARRAY_##name##_; } | 335 { return &size_of_FIXED_ARRAY_##name##_; } |
| 319 FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(SC) | 336 FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(SC) |
| 320 #undef SC | 337 #undef SC |
| 321 | 338 |
| 339 #define SC(name) \ |
| 340 StatsCounter* count_of_CODE_AGE_##name() \ |
| 341 { return &count_of_CODE_AGE_##name##_; } \ |
| 342 StatsCounter* size_of_CODE_AGE_##name() \ |
| 343 { return &size_of_CODE_AGE_##name##_; } |
| 344 CODE_AGE_LIST_WITH_NO_AGE(SC) |
| 345 #undef SC |
| 346 |
| 322 enum Id { | 347 enum Id { |
| 323 #define RATE_ID(name, caption) k_##name, | 348 #define RATE_ID(name, caption) k_##name, |
| 324 HISTOGRAM_TIMER_LIST(RATE_ID) | 349 HISTOGRAM_TIMER_LIST(RATE_ID) |
| 325 #undef RATE_ID | 350 #undef RATE_ID |
| 326 #define PERCENTAGE_ID(name, caption) k_##name, | 351 #define PERCENTAGE_ID(name, caption) k_##name, |
| 327 HISTOGRAM_PERCENTAGE_LIST(PERCENTAGE_ID) | 352 HISTOGRAM_PERCENTAGE_LIST(PERCENTAGE_ID) |
| 328 #undef PERCENTAGE_ID | 353 #undef PERCENTAGE_ID |
| 329 #define MEMORY_ID(name, caption) k_##name, | 354 #define MEMORY_ID(name, caption) k_##name, |
| 330 HISTOGRAM_MEMORY_LIST(MEMORY_ID) | 355 HISTOGRAM_MEMORY_LIST(MEMORY_ID) |
| 331 #undef MEMORY_ID | 356 #undef MEMORY_ID |
| 332 #define COUNTER_ID(name, caption) k_##name, | 357 #define COUNTER_ID(name, caption) k_##name, |
| 333 STATS_COUNTER_LIST_1(COUNTER_ID) | 358 STATS_COUNTER_LIST_1(COUNTER_ID) |
| 334 STATS_COUNTER_LIST_2(COUNTER_ID) | 359 STATS_COUNTER_LIST_2(COUNTER_ID) |
| 335 #undef COUNTER_ID | 360 #undef COUNTER_ID |
| 336 #define COUNTER_ID(name) kCountOf##name, kSizeOf##name, | 361 #define COUNTER_ID(name) kCountOf##name, kSizeOf##name, |
| 337 INSTANCE_TYPE_LIST(COUNTER_ID) | 362 INSTANCE_TYPE_LIST(COUNTER_ID) |
| 338 #undef COUNTER_ID | 363 #undef COUNTER_ID |
| 339 #define COUNTER_ID(name) kCountOfCODE_TYPE_##name, \ | 364 #define COUNTER_ID(name) kCountOfCODE_TYPE_##name, \ |
| 340 kSizeOfCODE_TYPE_##name, | 365 kSizeOfCODE_TYPE_##name, |
| 341 CODE_KIND_LIST(COUNTER_ID) | 366 CODE_KIND_LIST(COUNTER_ID) |
| 342 #undef COUNTER_ID | 367 #undef COUNTER_ID |
| 343 #define COUNTER_ID(name) kCountOfFIXED_ARRAY__##name, \ | 368 #define COUNTER_ID(name) kCountOfFIXED_ARRAY__##name, \ |
| 344 kSizeOfFIXED_ARRAY__##name, | 369 kSizeOfFIXED_ARRAY__##name, |
| 345 FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(COUNTER_ID) | 370 FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(COUNTER_ID) |
| 346 #undef COUNTER_ID | 371 #undef COUNTER_ID |
| 372 #define COUNTER_ID(name) kCountOfCODE_AGE__##name, \ |
| 373 kSizeOfCODE_AGE__##name, |
| 374 CODE_AGE_LIST_WITH_NO_AGE(COUNTER_ID) |
| 375 #undef COUNTER_ID |
| 347 stats_counter_count | 376 stats_counter_count |
| 348 }; | 377 }; |
| 349 | 378 |
| 350 void ResetHistograms(); | 379 void ResetHistograms(); |
| 351 | 380 |
| 352 private: | 381 private: |
| 353 #define HT(name, caption) \ | 382 #define HT(name, caption) \ |
| 354 HistogramTimer name##_; | 383 HistogramTimer name##_; |
| 355 HISTOGRAM_TIMER_LIST(HT) | 384 HISTOGRAM_TIMER_LIST(HT) |
| 356 #undef HT | 385 #undef HT |
| (...skipping 25 matching lines...) Expand all Loading... |
| 382 StatsCounter count_of_CODE_TYPE_##name##_; | 411 StatsCounter count_of_CODE_TYPE_##name##_; |
| 383 CODE_KIND_LIST(SC) | 412 CODE_KIND_LIST(SC) |
| 384 #undef SC | 413 #undef SC |
| 385 | 414 |
| 386 #define SC(name) \ | 415 #define SC(name) \ |
| 387 StatsCounter size_of_FIXED_ARRAY_##name##_; \ | 416 StatsCounter size_of_FIXED_ARRAY_##name##_; \ |
| 388 StatsCounter count_of_FIXED_ARRAY_##name##_; | 417 StatsCounter count_of_FIXED_ARRAY_##name##_; |
| 389 FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(SC) | 418 FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(SC) |
| 390 #undef SC | 419 #undef SC |
| 391 | 420 |
| 421 #define SC(name) \ |
| 422 StatsCounter size_of_CODE_AGE_##name##_; \ |
| 423 StatsCounter count_of_CODE_AGE_##name##_; |
| 424 CODE_AGE_LIST_WITH_NO_AGE(SC) |
| 425 #undef SC |
| 426 |
| 392 friend class Isolate; | 427 friend class Isolate; |
| 393 | 428 |
| 394 explicit Counters(Isolate* isolate); | 429 explicit Counters(Isolate* isolate); |
| 395 | 430 |
| 396 DISALLOW_IMPLICIT_CONSTRUCTORS(Counters); | 431 DISALLOW_IMPLICIT_CONSTRUCTORS(Counters); |
| 397 }; | 432 }; |
| 398 | 433 |
| 399 } } // namespace v8::internal | 434 } } // namespace v8::internal |
| 400 | 435 |
| 401 #endif // V8_V8_COUNTERS_H_ | 436 #endif // V8_V8_COUNTERS_H_ |
| OLD | NEW |