OLD | NEW |
1 // Copyright 2009-2010 the V8 project authors. All rights reserved. | 1 // Copyright 2009-2010 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 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 RetainerHeapProfile* js_retainer_profile() { return &js_retainer_profile_; } | 333 RetainerHeapProfile* js_retainer_profile() { return &js_retainer_profile_; } |
334 | 334 |
335 private: | 335 private: |
336 HistogramInfo* info_; | 336 HistogramInfo* info_; |
337 ConstructorHeapProfile js_cons_profile_; | 337 ConstructorHeapProfile js_cons_profile_; |
338 RetainerHeapProfile js_retainer_profile_; | 338 RetainerHeapProfile js_retainer_profile_; |
339 }; | 339 }; |
340 | 340 |
341 | 341 |
342 class HeapEntriesMap; | 342 class HeapEntriesMap; |
| 343 class HeapEntriesAllocator; |
343 class HeapSnapshot; | 344 class HeapSnapshot; |
344 | 345 |
345 class AggregatedHeapSnapshotGenerator { | 346 class AggregatedHeapSnapshotGenerator { |
346 public: | 347 public: |
347 explicit AggregatedHeapSnapshotGenerator(AggregatedHeapSnapshot* snapshot); | 348 explicit AggregatedHeapSnapshotGenerator(AggregatedHeapSnapshot* snapshot); |
348 void GenerateSnapshot(); | 349 void GenerateSnapshot(); |
349 void FillHeapSnapshot(HeapSnapshot* snapshot); | 350 void FillHeapSnapshot(HeapSnapshot* snapshot); |
350 | 351 |
351 static const int kAllStringsType = LAST_TYPE + 1; | 352 static const int kAllStringsType = LAST_TYPE + 1; |
352 | 353 |
353 private: | 354 private: |
354 void CalculateStringsStats(); | 355 void CalculateStringsStats(); |
355 void CollectStats(HeapObject* obj); | 356 void CollectStats(HeapObject* obj); |
356 template<class Iterator> | 357 template<class Iterator> |
357 void IterateRetainers(HeapEntriesMap* entries_map); | 358 void IterateRetainers( |
| 359 HeapEntriesAllocator* allocator, HeapEntriesMap* entries_map); |
358 | 360 |
359 AggregatedHeapSnapshot* agg_snapshot_; | 361 AggregatedHeapSnapshot* agg_snapshot_; |
360 }; | 362 }; |
361 | 363 |
362 | 364 |
363 class ProducerHeapProfile : public AllStatic { | 365 class ProducerHeapProfile : public AllStatic { |
364 public: | 366 public: |
365 static void Setup(); | 367 static void Setup(); |
366 static void RecordJSObjectAllocation(Object* obj) { | 368 static void RecordJSObjectAllocation(Object* obj) { |
367 if (FLAG_log_producers) DoRecordJSObjectAllocation(obj); | 369 if (FLAG_log_producers) DoRecordJSObjectAllocation(obj); |
368 } | 370 } |
369 | 371 |
370 private: | 372 private: |
371 static void DoRecordJSObjectAllocation(Object* obj); | 373 static void DoRecordJSObjectAllocation(Object* obj); |
372 static bool can_log_; | 374 static bool can_log_; |
373 }; | 375 }; |
374 | 376 |
375 #endif // ENABLE_LOGGING_AND_PROFILING | 377 #endif // ENABLE_LOGGING_AND_PROFILING |
376 | 378 |
377 } } // namespace v8::internal | 379 } } // namespace v8::internal |
378 | 380 |
379 #endif // V8_HEAP_PROFILER_H_ | 381 #endif // V8_HEAP_PROFILER_H_ |
OLD | NEW |