| 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 545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 556 Vector<HeapGraphEdge*> retainers() { | 556 Vector<HeapGraphEdge*> retainers() { |
| 557 return Vector<HeapGraphEdge*>(retainers_arr(), retainers_count_); } | 557 return Vector<HeapGraphEdge*>(retainers_arr(), retainers_count_); } |
| 558 HeapEntry* dominator() { return dominator_; } | 558 HeapEntry* dominator() { return dominator_; } |
| 559 void set_dominator(HeapEntry* entry) { | 559 void set_dominator(HeapEntry* entry) { |
| 560 ASSERT(entry != NULL); | 560 ASSERT(entry != NULL); |
| 561 dominator_ = entry; | 561 dominator_ = entry; |
| 562 } | 562 } |
| 563 void clear_paint() { painted_ = false; } | 563 void clear_paint() { painted_ = false; } |
| 564 bool painted() { return painted_; } | 564 bool painted() { return painted_; } |
| 565 void paint() { painted_ = true; } | 565 void paint() { painted_ = true; } |
| 566 bool reachable_from_window() { return reachable_from_window_; } | 566 bool user_reachable() { return user_reachable_; } |
| 567 void set_reachable_from_window() { reachable_from_window_ = true; } | 567 void set_user_reachable() { user_reachable_ = true; } |
| 568 | 568 |
| 569 void SetIndexedReference(HeapGraphEdge::Type type, | 569 void SetIndexedReference(HeapGraphEdge::Type type, |
| 570 int child_index, | 570 int child_index, |
| 571 int index, | 571 int index, |
| 572 HeapEntry* entry, | 572 HeapEntry* entry, |
| 573 int retainer_index); | 573 int retainer_index); |
| 574 void SetNamedReference(HeapGraphEdge::Type type, | 574 void SetNamedReference(HeapGraphEdge::Type type, |
| 575 int child_index, | 575 int child_index, |
| 576 const char* name, | 576 const char* name, |
| 577 HeapEntry* entry, | 577 HeapEntry* entry, |
| (...skipping 16 matching lines...) Expand all Loading... |
| 594 private: | 594 private: |
| 595 HeapGraphEdge* children_arr() { | 595 HeapGraphEdge* children_arr() { |
| 596 return reinterpret_cast<HeapGraphEdge*>(this + 1); | 596 return reinterpret_cast<HeapGraphEdge*>(this + 1); |
| 597 } | 597 } |
| 598 HeapGraphEdge** retainers_arr() { | 598 HeapGraphEdge** retainers_arr() { |
| 599 return reinterpret_cast<HeapGraphEdge**>(children_arr() + children_count_); | 599 return reinterpret_cast<HeapGraphEdge**>(children_arr() + children_count_); |
| 600 } | 600 } |
| 601 const char* TypeAsString(); | 601 const char* TypeAsString(); |
| 602 | 602 |
| 603 unsigned painted_: 1; | 603 unsigned painted_: 1; |
| 604 unsigned reachable_from_window_: 1; | 604 unsigned user_reachable_: 1; |
| 605 unsigned type_: 4; | 605 unsigned type_: 4; |
| 606 int children_count_: 26; | 606 int children_count_: 26; |
| 607 int retainers_count_; | 607 int retainers_count_; |
| 608 int self_size_; | 608 int self_size_; |
| 609 union { | 609 union { |
| 610 int ordered_index_; // Used during dominator tree building. | 610 int ordered_index_; // Used during dominator tree building. |
| 611 int retained_size_; // At that moment, there is no retained size yet. | 611 int retained_size_; // At that moment, there is no retained size yet. |
| 612 }; | 612 }; |
| 613 int entry_index_; | 613 int entry_index_; |
| 614 SnapshotObjectId id_; | 614 SnapshotObjectId id_; |
| (...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1014 void SetPropertyReference(HeapObject* parent_obj, | 1014 void SetPropertyReference(HeapObject* parent_obj, |
| 1015 HeapEntry* parent, | 1015 HeapEntry* parent, |
| 1016 String* reference_name, | 1016 String* reference_name, |
| 1017 Object* child, | 1017 Object* child, |
| 1018 const char* name_format_string = NULL, | 1018 const char* name_format_string = NULL, |
| 1019 int field_offset = -1); | 1019 int field_offset = -1); |
| 1020 void SetPropertyShortcutReference(HeapObject* parent_obj, | 1020 void SetPropertyShortcutReference(HeapObject* parent_obj, |
| 1021 HeapEntry* parent, | 1021 HeapEntry* parent, |
| 1022 String* reference_name, | 1022 String* reference_name, |
| 1023 Object* child); | 1023 Object* child); |
| 1024 void SetWindowReference(Object* window); | 1024 void SetUserGlobalReference(Object* window); |
| 1025 void SetRootGcRootsReference(); | 1025 void SetRootGcRootsReference(); |
| 1026 void SetGcRootsReference(VisitorSynchronization::SyncTag tag); | 1026 void SetGcRootsReference(VisitorSynchronization::SyncTag tag); |
| 1027 void SetGcSubrootReference( | 1027 void SetGcSubrootReference( |
| 1028 VisitorSynchronization::SyncTag tag, bool is_weak, Object* child); | 1028 VisitorSynchronization::SyncTag tag, bool is_weak, Object* child); |
| 1029 void SetObjectName(HeapObject* object); | 1029 void SetObjectName(HeapObject* object); |
| 1030 void TagObject(Object* obj, const char* tag); | 1030 void TagObject(Object* obj, const char* tag); |
| 1031 | 1031 |
| 1032 HeapEntry* GetEntry(Object* obj); | 1032 HeapEntry* GetEntry(Object* obj); |
| 1033 | 1033 |
| 1034 static inline HeapObject* GetNthGcSubrootObject(int delta); | 1034 static inline HeapObject* GetNthGcSubrootObject(int delta); |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1119 v8::ActivityControl* control); | 1119 v8::ActivityControl* control); |
| 1120 bool GenerateSnapshot(); | 1120 bool GenerateSnapshot(); |
| 1121 | 1121 |
| 1122 private: | 1122 private: |
| 1123 bool BuildDominatorTree(const Vector<HeapEntry*>& entries, | 1123 bool BuildDominatorTree(const Vector<HeapEntry*>& entries, |
| 1124 Vector<int>* dominators); | 1124 Vector<int>* dominators); |
| 1125 bool CalculateRetainedSizes(); | 1125 bool CalculateRetainedSizes(); |
| 1126 bool CountEntriesAndReferences(); | 1126 bool CountEntriesAndReferences(); |
| 1127 bool FillReferences(); | 1127 bool FillReferences(); |
| 1128 void FillPostorderIndexes(Vector<HeapEntry*>* entries); | 1128 void FillPostorderIndexes(Vector<HeapEntry*>* entries); |
| 1129 bool IsWindowReference(const HeapGraphEdge& edge); | 1129 bool IsUserGlobalReference(const HeapGraphEdge& edge); |
| 1130 void MarkWindowReachableObjects(); | 1130 void MarkUserReachableObjects(); |
| 1131 void ProgressStep(); | 1131 void ProgressStep(); |
| 1132 bool ProgressReport(bool force = false); | 1132 bool ProgressReport(bool force = false); |
| 1133 bool SetEntriesDominators(); | 1133 bool SetEntriesDominators(); |
| 1134 void SetProgressTotal(int iterations_count); | 1134 void SetProgressTotal(int iterations_count); |
| 1135 | 1135 |
| 1136 HeapSnapshot* snapshot_; | 1136 HeapSnapshot* snapshot_; |
| 1137 v8::ActivityControl* control_; | 1137 v8::ActivityControl* control_; |
| 1138 V8HeapExplorer v8_heap_explorer_; | 1138 V8HeapExplorer v8_heap_explorer_; |
| 1139 NativeObjectsExplorer dom_explorer_; | 1139 NativeObjectsExplorer dom_explorer_; |
| 1140 // Mapping from HeapThing pointers to HeapEntry* pointers. | 1140 // Mapping from HeapThing pointers to HeapEntry* pointers. |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1193 | 1193 |
| 1194 friend class HeapSnapshotJSONSerializerEnumerator; | 1194 friend class HeapSnapshotJSONSerializerEnumerator; |
| 1195 friend class HeapSnapshotJSONSerializerIterator; | 1195 friend class HeapSnapshotJSONSerializerIterator; |
| 1196 | 1196 |
| 1197 DISALLOW_COPY_AND_ASSIGN(HeapSnapshotJSONSerializer); | 1197 DISALLOW_COPY_AND_ASSIGN(HeapSnapshotJSONSerializer); |
| 1198 }; | 1198 }; |
| 1199 | 1199 |
| 1200 } } // namespace v8::internal | 1200 } } // namespace v8::internal |
| 1201 | 1201 |
| 1202 #endif // V8_PROFILE_GENERATOR_H_ | 1202 #endif // V8_PROFILE_GENERATOR_H_ |
| OLD | NEW |