| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 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 567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 578 const char* name, | 578 const char* name, |
| 579 HeapEntry* entry, | 579 HeapEntry* entry, |
| 580 int retainer_index); | 580 int retainer_index); |
| 581 void SetUnidirElementReference(int child_index, int index, HeapEntry* entry); | 581 void SetUnidirElementReference(int child_index, int index, HeapEntry* entry); |
| 582 | 582 |
| 583 int EntrySize() { return EntriesSize(1, children_count_, retainers_count_); } | 583 int EntrySize() { return EntriesSize(1, children_count_, retainers_count_); } |
| 584 int RetainedSize(bool exact); | 584 int RetainedSize(bool exact); |
| 585 | 585 |
| 586 void Print(int max_depth, int indent); | 586 void Print(int max_depth, int indent); |
| 587 | 587 |
| 588 Handle<HeapObject> GetHeapObject(); |
| 589 |
| 588 static int EntriesSize(int entries_count, | 590 static int EntriesSize(int entries_count, |
| 589 int children_count, | 591 int children_count, |
| 590 int retainers_count); | 592 int retainers_count); |
| 591 | 593 |
| 592 private: | 594 private: |
| 593 HeapGraphEdge* children_arr() { | 595 HeapGraphEdge* children_arr() { |
| 594 return reinterpret_cast<HeapGraphEdge*>(this + 1); | 596 return reinterpret_cast<HeapGraphEdge*>(this + 1); |
| 595 } | 597 } |
| 596 HeapGraphEdge** retainers_arr() { | 598 HeapGraphEdge** retainers_arr() { |
| 597 return reinterpret_cast<HeapGraphEdge**>(children_arr() + children_count_); | 599 return reinterpret_cast<HeapGraphEdge**>(children_arr() + children_count_); |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 756 HeapSnapshot::Type type, const char* name, unsigned uid); | 758 HeapSnapshot::Type type, const char* name, unsigned uid); |
| 757 void SnapshotGenerationFinished(HeapSnapshot* snapshot); | 759 void SnapshotGenerationFinished(HeapSnapshot* snapshot); |
| 758 List<HeapSnapshot*>* snapshots() { return &snapshots_; } | 760 List<HeapSnapshot*>* snapshots() { return &snapshots_; } |
| 759 HeapSnapshot* GetSnapshot(unsigned uid); | 761 HeapSnapshot* GetSnapshot(unsigned uid); |
| 760 void RemoveSnapshot(HeapSnapshot* snapshot); | 762 void RemoveSnapshot(HeapSnapshot* snapshot); |
| 761 | 763 |
| 762 StringsStorage* names() { return &names_; } | 764 StringsStorage* names() { return &names_; } |
| 763 TokenEnumerator* token_enumerator() { return token_enumerator_; } | 765 TokenEnumerator* token_enumerator() { return token_enumerator_; } |
| 764 | 766 |
| 765 uint64_t GetObjectId(Address addr) { return ids_.FindObject(addr); } | 767 uint64_t GetObjectId(Address addr) { return ids_.FindObject(addr); } |
| 768 Handle<HeapObject> FindHeapObjectById(uint64_t id); |
| 766 void ObjectMoveEvent(Address from, Address to) { ids_.MoveObject(from, to); } | 769 void ObjectMoveEvent(Address from, Address to) { ids_.MoveObject(from, to); } |
| 767 | 770 |
| 768 private: | 771 private: |
| 769 INLINE(static bool HeapSnapshotsMatch(void* key1, void* key2)) { | 772 INLINE(static bool HeapSnapshotsMatch(void* key1, void* key2)) { |
| 770 return key1 == key2; | 773 return key1 == key2; |
| 771 } | 774 } |
| 772 | 775 |
| 773 bool is_tracking_objects_; // Whether tracking object moves is needed. | 776 bool is_tracking_objects_; // Whether tracking object moves is needed. |
| 774 List<HeapSnapshot*> snapshots_; | 777 List<HeapSnapshot*> snapshots_; |
| 775 // Mapping from snapshots' uids to HeapSnapshot* pointers. | 778 // Mapping from snapshots' uids to HeapSnapshot* pointers. |
| (...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1120 | 1123 |
| 1121 friend class HeapSnapshotJSONSerializerEnumerator; | 1124 friend class HeapSnapshotJSONSerializerEnumerator; |
| 1122 friend class HeapSnapshotJSONSerializerIterator; | 1125 friend class HeapSnapshotJSONSerializerIterator; |
| 1123 | 1126 |
| 1124 DISALLOW_COPY_AND_ASSIGN(HeapSnapshotJSONSerializer); | 1127 DISALLOW_COPY_AND_ASSIGN(HeapSnapshotJSONSerializer); |
| 1125 }; | 1128 }; |
| 1126 | 1129 |
| 1127 } } // namespace v8::internal | 1130 } } // namespace v8::internal |
| 1128 | 1131 |
| 1129 #endif // V8_PROFILE_GENERATOR_H_ | 1132 #endif // V8_PROFILE_GENERATOR_H_ |
| OLD | NEW |