Chromium Code Reviews| OLD | NEW | 
|---|---|
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 570 int index, | 570 int index, | 
| 571 HeapEntry* entry, | 571 HeapEntry* entry, | 
| 572 int retainer_index); | 572 int retainer_index); | 
| 573 void SetNamedReference(HeapGraphEdge::Type type, | 573 void SetNamedReference(HeapGraphEdge::Type type, | 
| 574 int child_index, | 574 int child_index, | 
| 575 const char* name, | 575 const char* name, | 
| 576 HeapEntry* entry, | 576 HeapEntry* entry, | 
| 577 int retainer_index); | 577 int retainer_index); | 
| 578 void SetUnidirElementReference(int child_index, int index, HeapEntry* entry); | 578 void SetUnidirElementReference(int child_index, int index, HeapEntry* entry); | 
| 579 | 579 | 
| 580 int EntrySize() { return EntriesSize(1, children_count_, retainers_count_); } | 580 size_t EntrySize() { return EntriesSize(1, children_count_, retainers_count_); } | 
| 
 
mnaganov (inactive)
2012/03/11 14:43:57
nit: 80 chars
 
 | |
| 581 | 581 | 
| 582 void Print( | 582 void Print( | 
| 583 const char* prefix, const char* edge_name, int max_depth, int indent); | 583 const char* prefix, const char* edge_name, int max_depth, int indent); | 
| 584 | 584 | 
| 585 Handle<HeapObject> GetHeapObject(); | 585 Handle<HeapObject> GetHeapObject(); | 
| 586 | 586 | 
| 587 static int EntriesSize(int entries_count, | 587 static size_t EntriesSize(int entries_count, | 
| 588 int children_count, | 588 int children_count, | 
| 589 int retainers_count); | 589 int retainers_count); | 
| 590 | 590 | 
| 591 private: | 591 private: | 
| 592 HeapGraphEdge* children_arr() { | 592 HeapGraphEdge* children_arr() { | 
| 593 return reinterpret_cast<HeapGraphEdge*>(this + 1); | 593 return reinterpret_cast<HeapGraphEdge*>(this + 1); | 
| 594 } | 594 } | 
| 595 HeapGraphEdge** retainers_arr() { | 595 HeapGraphEdge** retainers_arr() { | 
| 596 return reinterpret_cast<HeapGraphEdge**>(children_arr() + children_count_); | 596 return reinterpret_cast<HeapGraphEdge**>(children_arr() + children_count_); | 
| 597 } | 597 } | 
| 598 const char* TypeAsString(); | 598 const char* TypeAsString(); | 
| 599 | 599 | 
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 640 | 640 | 
| 641 HeapSnapshotsCollection* collection() { return collection_; } | 641 HeapSnapshotsCollection* collection() { return collection_; } | 
| 642 Type type() { return type_; } | 642 Type type() { return type_; } | 
| 643 const char* title() { return title_; } | 643 const char* title() { return title_; } | 
| 644 unsigned uid() { return uid_; } | 644 unsigned uid() { return uid_; } | 
| 645 HeapEntry* root() { return root_entry_; } | 645 HeapEntry* root() { return root_entry_; } | 
| 646 HeapEntry* gc_roots() { return gc_roots_entry_; } | 646 HeapEntry* gc_roots() { return gc_roots_entry_; } | 
| 647 HeapEntry* natives_root() { return natives_root_entry_; } | 647 HeapEntry* natives_root() { return natives_root_entry_; } | 
| 648 HeapEntry* gc_subroot(int index) { return gc_subroot_entries_[index]; } | 648 HeapEntry* gc_subroot(int index) { return gc_subroot_entries_[index]; } | 
| 649 List<HeapEntry*>* entries() { return &entries_; } | 649 List<HeapEntry*>* entries() { return &entries_; } | 
| 650 int raw_entries_size() { return raw_entries_size_; } | 650 size_t raw_entries_size() { return raw_entries_size_; } | 
| 651 | 651 | 
| 652 void AllocateEntries( | 652 void AllocateEntries( | 
| 653 int entries_count, int children_count, int retainers_count); | 653 int entries_count, int children_count, int retainers_count); | 
| 654 HeapEntry* AddEntry(HeapEntry::Type type, | 654 HeapEntry* AddEntry(HeapEntry::Type type, | 
| 655 const char* name, | 655 const char* name, | 
| 656 SnapshotObjectId id, | 656 SnapshotObjectId id, | 
| 657 int size, | 657 int size, | 
| 658 int children_count, | 658 int children_count, | 
| 659 int retainers_count); | 659 int retainers_count); | 
| 660 HeapEntry* AddRootEntry(int children_count); | 660 HeapEntry* AddRootEntry(int children_count); | 
| (...skipping 19 matching lines...) Expand all Loading... | |
| 680 Type type_; | 680 Type type_; | 
| 681 const char* title_; | 681 const char* title_; | 
| 682 unsigned uid_; | 682 unsigned uid_; | 
| 683 HeapEntry* root_entry_; | 683 HeapEntry* root_entry_; | 
| 684 HeapEntry* gc_roots_entry_; | 684 HeapEntry* gc_roots_entry_; | 
| 685 HeapEntry* natives_root_entry_; | 685 HeapEntry* natives_root_entry_; | 
| 686 HeapEntry* gc_subroot_entries_[VisitorSynchronization::kNumberOfSyncTags]; | 686 HeapEntry* gc_subroot_entries_[VisitorSynchronization::kNumberOfSyncTags]; | 
| 687 char* raw_entries_; | 687 char* raw_entries_; | 
| 688 List<HeapEntry*> entries_; | 688 List<HeapEntry*> entries_; | 
| 689 bool entries_sorted_; | 689 bool entries_sorted_; | 
| 690 int raw_entries_size_; | 690 size_t raw_entries_size_; | 
| 691 | 691 | 
| 692 friend class HeapSnapshotTester; | 692 friend class HeapSnapshotTester; | 
| 693 | 693 | 
| 694 DISALLOW_COPY_AND_ASSIGN(HeapSnapshot); | 694 DISALLOW_COPY_AND_ASSIGN(HeapSnapshot); | 
| 695 }; | 695 }; | 
| 696 | 696 | 
| 697 | 697 | 
| 698 class HeapObjectsMap { | 698 class HeapObjectsMap { | 
| 699 public: | 699 public: | 
| 700 HeapObjectsMap(); | 700 HeapObjectsMap(); | 
| (...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1157 | 1157 | 
| 1158 friend class HeapSnapshotJSONSerializerEnumerator; | 1158 friend class HeapSnapshotJSONSerializerEnumerator; | 
| 1159 friend class HeapSnapshotJSONSerializerIterator; | 1159 friend class HeapSnapshotJSONSerializerIterator; | 
| 1160 | 1160 | 
| 1161 DISALLOW_COPY_AND_ASSIGN(HeapSnapshotJSONSerializer); | 1161 DISALLOW_COPY_AND_ASSIGN(HeapSnapshotJSONSerializer); | 
| 1162 }; | 1162 }; | 
| 1163 | 1163 | 
| 1164 } } // namespace v8::internal | 1164 } } // namespace v8::internal | 
| 1165 | 1165 | 
| 1166 #endif // V8_PROFILE_GENERATOR_H_ | 1166 #endif // V8_PROFILE_GENERATOR_H_ | 
| OLD | NEW |