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 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
329 #undef SC | 329 #undef SC |
330 | 330 |
331 #define SC(name) \ | 331 #define SC(name) \ |
332 StatsCounter* count_of_FIXED_ARRAY_##name() \ | 332 StatsCounter* count_of_FIXED_ARRAY_##name() \ |
333 { return &count_of_FIXED_ARRAY_##name##_; } \ | 333 { return &count_of_FIXED_ARRAY_##name##_; } \ |
334 StatsCounter* size_of_FIXED_ARRAY_##name() \ | 334 StatsCounter* size_of_FIXED_ARRAY_##name() \ |
335 { return &size_of_FIXED_ARRAY_##name##_; } | 335 { return &size_of_FIXED_ARRAY_##name##_; } |
336 FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(SC) | 336 FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(SC) |
337 #undef SC | 337 #undef SC |
338 | 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 |
339 enum Id { | 347 enum Id { |
340 #define RATE_ID(name, caption) k_##name, | 348 #define RATE_ID(name, caption) k_##name, |
341 HISTOGRAM_TIMER_LIST(RATE_ID) | 349 HISTOGRAM_TIMER_LIST(RATE_ID) |
342 #undef RATE_ID | 350 #undef RATE_ID |
343 #define PERCENTAGE_ID(name, caption) k_##name, | 351 #define PERCENTAGE_ID(name, caption) k_##name, |
344 HISTOGRAM_PERCENTAGE_LIST(PERCENTAGE_ID) | 352 HISTOGRAM_PERCENTAGE_LIST(PERCENTAGE_ID) |
345 #undef PERCENTAGE_ID | 353 #undef PERCENTAGE_ID |
346 #define MEMORY_ID(name, caption) k_##name, | 354 #define MEMORY_ID(name, caption) k_##name, |
347 HISTOGRAM_MEMORY_LIST(MEMORY_ID) | 355 HISTOGRAM_MEMORY_LIST(MEMORY_ID) |
348 #undef MEMORY_ID | 356 #undef MEMORY_ID |
349 #define COUNTER_ID(name, caption) k_##name, | 357 #define COUNTER_ID(name, caption) k_##name, |
350 STATS_COUNTER_LIST_1(COUNTER_ID) | 358 STATS_COUNTER_LIST_1(COUNTER_ID) |
351 STATS_COUNTER_LIST_2(COUNTER_ID) | 359 STATS_COUNTER_LIST_2(COUNTER_ID) |
352 #undef COUNTER_ID | 360 #undef COUNTER_ID |
353 #define COUNTER_ID(name) kCountOf##name, kSizeOf##name, | 361 #define COUNTER_ID(name) kCountOf##name, kSizeOf##name, |
354 INSTANCE_TYPE_LIST(COUNTER_ID) | 362 INSTANCE_TYPE_LIST(COUNTER_ID) |
355 #undef COUNTER_ID | 363 #undef COUNTER_ID |
356 #define COUNTER_ID(name) kCountOfCODE_TYPE_##name, \ | 364 #define COUNTER_ID(name) kCountOfCODE_TYPE_##name, \ |
357 kSizeOfCODE_TYPE_##name, | 365 kSizeOfCODE_TYPE_##name, |
358 CODE_KIND_LIST(COUNTER_ID) | 366 CODE_KIND_LIST(COUNTER_ID) |
359 #undef COUNTER_ID | 367 #undef COUNTER_ID |
360 #define COUNTER_ID(name) kCountOfFIXED_ARRAY__##name, \ | 368 #define COUNTER_ID(name) kCountOfFIXED_ARRAY__##name, \ |
361 kSizeOfFIXED_ARRAY__##name, | 369 kSizeOfFIXED_ARRAY__##name, |
362 FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(COUNTER_ID) | 370 FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(COUNTER_ID) |
363 #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 |
364 stats_counter_count | 376 stats_counter_count |
365 }; | 377 }; |
366 | 378 |
367 void ResetHistograms(); | 379 void ResetHistograms(); |
368 | 380 |
369 private: | 381 private: |
370 #define HT(name, caption) \ | 382 #define HT(name, caption) \ |
371 HistogramTimer name##_; | 383 HistogramTimer name##_; |
372 HISTOGRAM_TIMER_LIST(HT) | 384 HISTOGRAM_TIMER_LIST(HT) |
373 #undef HT | 385 #undef HT |
(...skipping 25 matching lines...) Expand all Loading... |
399 StatsCounter count_of_CODE_TYPE_##name##_; | 411 StatsCounter count_of_CODE_TYPE_##name##_; |
400 CODE_KIND_LIST(SC) | 412 CODE_KIND_LIST(SC) |
401 #undef SC | 413 #undef SC |
402 | 414 |
403 #define SC(name) \ | 415 #define SC(name) \ |
404 StatsCounter size_of_FIXED_ARRAY_##name##_; \ | 416 StatsCounter size_of_FIXED_ARRAY_##name##_; \ |
405 StatsCounter count_of_FIXED_ARRAY_##name##_; | 417 StatsCounter count_of_FIXED_ARRAY_##name##_; |
406 FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(SC) | 418 FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(SC) |
407 #undef SC | 419 #undef SC |
408 | 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 |
409 friend class Isolate; | 427 friend class Isolate; |
410 | 428 |
411 explicit Counters(Isolate* isolate); | 429 explicit Counters(Isolate* isolate); |
412 | 430 |
413 DISALLOW_IMPLICIT_CONSTRUCTORS(Counters); | 431 DISALLOW_IMPLICIT_CONSTRUCTORS(Counters); |
414 }; | 432 }; |
415 | 433 |
416 } } // namespace v8::internal | 434 } } // namespace v8::internal |
417 | 435 |
418 #endif // V8_V8_COUNTERS_H_ | 436 #endif // V8_V8_COUNTERS_H_ |
OLD | NEW |