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