Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(229)

Side by Side Diff: src/profiler/heap-snapshot-generator.h

Issue 2627033002: [profiler] Query retainer infos from embedder instead of using object grouping (Closed)
Patch Set: Rebase and fixes Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/profiler/heap-snapshot-generator.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
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_
OLDNEW
« no previous file with comments | « no previous file | src/profiler/heap-snapshot-generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698