| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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_PROFILER_HEAP_SNAPSHOT_GENERATOR_H_ | 5 #ifndef V8_PROFILER_HEAP_SNAPSHOT_GENERATOR_H_ |
| 6 #define V8_PROFILER_HEAP_SNAPSHOT_GENERATOR_H_ | 6 #define V8_PROFILER_HEAP_SNAPSHOT_GENERATOR_H_ |
| 7 | 7 |
| 8 #include <deque> | 8 #include <deque> |
| 9 #include <unordered_map> | 9 #include <unordered_map> |
| 10 | 10 |
| (...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 489 class NativeObjectsExplorer { | 489 class NativeObjectsExplorer { |
| 490 public: | 490 public: |
| 491 NativeObjectsExplorer(HeapSnapshot* snapshot, | 491 NativeObjectsExplorer(HeapSnapshot* snapshot, |
| 492 SnapshottingProgressReportingInterface* progress); | 492 SnapshottingProgressReportingInterface* progress); |
| 493 virtual ~NativeObjectsExplorer(); | 493 virtual ~NativeObjectsExplorer(); |
| 494 int EstimateObjectsCount(); | 494 int EstimateObjectsCount(); |
| 495 bool IterateAndExtractReferences(SnapshotFiller* filler); | 495 bool IterateAndExtractReferences(SnapshotFiller* filler); |
| 496 | 496 |
| 497 private: | 497 private: |
| 498 void FillRetainedObjects(); | 498 void FillRetainedObjects(); |
| 499 void FillImplicitReferences(); | 499 void FillEdges(); |
| 500 List<HeapObject*>* GetListMaybeDisposeInfo(v8::RetainedObjectInfo* info); | 500 List<HeapObject*>* GetListMaybeDisposeInfo(v8::RetainedObjectInfo* info); |
| 501 void SetNativeRootReference(v8::RetainedObjectInfo* info); | 501 void SetNativeRootReference(v8::RetainedObjectInfo* info); |
| 502 void SetRootNativeRootsReference(); | 502 void SetRootNativeRootsReference(); |
| 503 void SetWrapperNativeReferences(HeapObject* wrapper, | 503 void SetWrapperNativeReferences(HeapObject* wrapper, |
| 504 v8::RetainedObjectInfo* info); | 504 v8::RetainedObjectInfo* info); |
| 505 void VisitSubtreeWrapper(Object** p, uint16_t class_id); | 505 void VisitSubtreeWrapper(Object** p, uint16_t class_id); |
| 506 | 506 |
| 507 static uint32_t InfoHash(v8::RetainedObjectInfo* info) { | 507 static uint32_t InfoHash(v8::RetainedObjectInfo* info) { |
| 508 return ComputeIntegerHash(static_cast<uint32_t>(info->GetHash()), | 508 return ComputeIntegerHash(static_cast<uint32_t>(info->GetHash()), |
| 509 v8::internal::kZeroHashSeed); | 509 v8::internal::kZeroHashSeed); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 525 StringsStorage* names_; | 525 StringsStorage* names_; |
| 526 bool embedder_queried_; | 526 bool embedder_queried_; |
| 527 HeapObjectsSet in_groups_; | 527 HeapObjectsSet in_groups_; |
| 528 // RetainedObjectInfo* -> List<HeapObject*>* | 528 // RetainedObjectInfo* -> List<HeapObject*>* |
| 529 base::CustomMatcherHashMap objects_by_info_; | 529 base::CustomMatcherHashMap objects_by_info_; |
| 530 base::CustomMatcherHashMap native_groups_; | 530 base::CustomMatcherHashMap native_groups_; |
| 531 HeapEntriesAllocator* synthetic_entries_allocator_; | 531 HeapEntriesAllocator* synthetic_entries_allocator_; |
| 532 HeapEntriesAllocator* native_entries_allocator_; | 532 HeapEntriesAllocator* native_entries_allocator_; |
| 533 // Used during references extraction. | 533 // Used during references extraction. |
| 534 SnapshotFiller* filler_; | 534 SnapshotFiller* filler_; |
| 535 v8::HeapProfiler::RetainerEdges edges_; |
| 535 | 536 |
| 536 static HeapThing const kNativesRootObject; | 537 static HeapThing const kNativesRootObject; |
| 537 | 538 |
| 538 friend class GlobalHandlesExtractor; | 539 friend class GlobalHandlesExtractor; |
| 539 | 540 |
| 540 DISALLOW_COPY_AND_ASSIGN(NativeObjectsExplorer); | 541 DISALLOW_COPY_AND_ASSIGN(NativeObjectsExplorer); |
| 541 }; | 542 }; |
| 542 | 543 |
| 543 | 544 |
| 544 class HeapSnapshotGenerator : public SnapshottingProgressReportingInterface { | 545 class HeapSnapshotGenerator : public SnapshottingProgressReportingInterface { |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 623 friend class HeapSnapshotJSONSerializerIterator; | 624 friend class HeapSnapshotJSONSerializerIterator; |
| 624 | 625 |
| 625 DISALLOW_COPY_AND_ASSIGN(HeapSnapshotJSONSerializer); | 626 DISALLOW_COPY_AND_ASSIGN(HeapSnapshotJSONSerializer); |
| 626 }; | 627 }; |
| 627 | 628 |
| 628 | 629 |
| 629 } // namespace internal | 630 } // namespace internal |
| 630 } // namespace v8 | 631 } // namespace v8 |
| 631 | 632 |
| 632 #endif // V8_PROFILER_HEAP_SNAPSHOT_GENERATOR_H_ | 633 #endif // V8_PROFILER_HEAP_SNAPSHOT_GENERATOR_H_ |
| OLD | NEW |