| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 531 }; | 531 }; |
| 532 | 532 |
| 533 | 533 |
| 534 class NativeGroupRetainedObjectInfo; | 534 class NativeGroupRetainedObjectInfo; |
| 535 | 535 |
| 536 | 536 |
| 537 // An implementation of retained native objects extractor. | 537 // An implementation of retained native objects extractor. |
| 538 class NativeObjectsExplorer { | 538 class NativeObjectsExplorer { |
| 539 public: | 539 public: |
| 540 NativeObjectsExplorer(HeapSnapshot* snapshot, | 540 NativeObjectsExplorer(HeapSnapshot* snapshot, |
| 541 SnapshottingProgressReportingInterface* progress); | 541 SnapshottingProgressReportingInterface* progress); |
| 542 virtual ~NativeObjectsExplorer(); | 542 virtual ~NativeObjectsExplorer(); |
| 543 void AddRootEntries(SnapshotFillerInterface* filler); | 543 void AddRootEntries(SnapshotFillerInterface* filler); |
| 544 int EstimateObjectsCount(); | 544 int EstimateObjectsCount(); |
| 545 bool IterateAndExtractReferences(SnapshotFillerInterface* filler); | 545 bool IterateAndExtractReferences(SnapshotFillerInterface* filler); |
| 546 | 546 |
| 547 private: | 547 private: |
| 548 void FillRetainedObjects(); | 548 void FillRetainedObjects(); |
| 549 void FillImplicitReferences(); | 549 void FillImplicitReferences(); |
| 550 List<HeapObject*>* GetListMaybeDisposeInfo(v8::RetainedObjectInfo* info); | 550 List<HeapObject*>* GetListMaybeDisposeInfo(v8::RetainedObjectInfo* info); |
| 551 void SetNativeRootReference(v8::RetainedObjectInfo* info); | 551 void SetNativeRootReference(v8::RetainedObjectInfo* info); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 563 (reinterpret_cast<v8::RetainedObjectInfo*>(key1))->IsEquivalent( | 563 (reinterpret_cast<v8::RetainedObjectInfo*>(key1))->IsEquivalent( |
| 564 reinterpret_cast<v8::RetainedObjectInfo*>(key2)); | 564 reinterpret_cast<v8::RetainedObjectInfo*>(key2)); |
| 565 } | 565 } |
| 566 INLINE(static bool StringsMatch(void* key1, void* key2)) { | 566 INLINE(static bool StringsMatch(void* key1, void* key2)) { |
| 567 return strcmp(reinterpret_cast<char*>(key1), | 567 return strcmp(reinterpret_cast<char*>(key1), |
| 568 reinterpret_cast<char*>(key2)) == 0; | 568 reinterpret_cast<char*>(key2)) == 0; |
| 569 } | 569 } |
| 570 | 570 |
| 571 NativeGroupRetainedObjectInfo* FindOrAddGroupInfo(const char* label); | 571 NativeGroupRetainedObjectInfo* FindOrAddGroupInfo(const char* label); |
| 572 | 572 |
| 573 Isolate* isolate_; |
| 573 HeapSnapshot* snapshot_; | 574 HeapSnapshot* snapshot_; |
| 574 HeapSnapshotsCollection* collection_; | 575 HeapSnapshotsCollection* collection_; |
| 575 SnapshottingProgressReportingInterface* progress_; | 576 SnapshottingProgressReportingInterface* progress_; |
| 576 bool embedder_queried_; | 577 bool embedder_queried_; |
| 577 HeapObjectsSet in_groups_; | 578 HeapObjectsSet in_groups_; |
| 578 // RetainedObjectInfo* -> List<HeapObject*>* | 579 // RetainedObjectInfo* -> List<HeapObject*>* |
| 579 HashMap objects_by_info_; | 580 HashMap objects_by_info_; |
| 580 HashMap native_groups_; | 581 HashMap native_groups_; |
| 581 HeapEntriesAllocator* synthetic_entries_allocator_; | 582 HeapEntriesAllocator* synthetic_entries_allocator_; |
| 582 HeapEntriesAllocator* native_entries_allocator_; | 583 HeapEntriesAllocator* native_entries_allocator_; |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 668 friend class HeapSnapshotJSONSerializerIterator; | 669 friend class HeapSnapshotJSONSerializerIterator; |
| 669 | 670 |
| 670 DISALLOW_COPY_AND_ASSIGN(HeapSnapshotJSONSerializer); | 671 DISALLOW_COPY_AND_ASSIGN(HeapSnapshotJSONSerializer); |
| 671 }; | 672 }; |
| 672 | 673 |
| 673 | 674 |
| 674 } } // namespace v8::internal | 675 } } // namespace v8::internal |
| 675 | 676 |
| 676 #endif // V8_HEAP_SNAPSHOT_GENERATOR_H_ | 677 #endif // V8_HEAP_SNAPSHOT_GENERATOR_H_ |
| 677 | 678 |
| OLD | NEW |