| OLD | NEW |
| 1 // Copyright 2010 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 |
| 11 // with the distribution. | 11 // with the distribution. |
| (...skipping 902 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 914 // An implementation of V8 heap graph extractor. | 914 // An implementation of V8 heap graph extractor. |
| 915 class V8HeapExplorer : public HeapEntriesAllocator { | 915 class V8HeapExplorer : public HeapEntriesAllocator { |
| 916 public: | 916 public: |
| 917 V8HeapExplorer(HeapSnapshot* snapshot, | 917 V8HeapExplorer(HeapSnapshot* snapshot, |
| 918 SnapshottingProgressReportingInterface* progress); | 918 SnapshottingProgressReportingInterface* progress); |
| 919 virtual ~V8HeapExplorer(); | 919 virtual ~V8HeapExplorer(); |
| 920 virtual HeapEntry* AllocateEntry( | 920 virtual HeapEntry* AllocateEntry( |
| 921 HeapThing ptr, int children_count, int retainers_count); | 921 HeapThing ptr, int children_count, int retainers_count); |
| 922 void AddRootEntries(SnapshotFillerInterface* filler); | 922 void AddRootEntries(SnapshotFillerInterface* filler); |
| 923 int EstimateObjectsCount(HeapIterator* iterator); | 923 int EstimateObjectsCount(HeapIterator* iterator); |
| 924 bool IterateAndExtractReferences(HeapIterator* iterator, | 924 bool IterateAndExtractReferences(SnapshotFillerInterface* filler); |
| 925 SnapshotFillerInterface* filler); | |
| 926 void TagGlobalObjects(); | 925 void TagGlobalObjects(); |
| 927 | 926 |
| 928 static HeapObject* const kInternalRootObject; | 927 static HeapObject* const kInternalRootObject; |
| 929 | 928 |
| 930 private: | 929 private: |
| 931 HeapEntry* AddEntry( | 930 HeapEntry* AddEntry( |
| 932 HeapObject* object, int children_count, int retainers_count); | 931 HeapObject* object, int children_count, int retainers_count); |
| 933 HeapEntry* AddEntry(HeapObject* object, | 932 HeapEntry* AddEntry(HeapObject* object, |
| 934 HeapEntry::Type type, | 933 HeapEntry::Type type, |
| 935 const char* name, | 934 const char* name, |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1046 class HeapSnapshotGenerator : public SnapshottingProgressReportingInterface { | 1045 class HeapSnapshotGenerator : public SnapshottingProgressReportingInterface { |
| 1047 public: | 1046 public: |
| 1048 HeapSnapshotGenerator(HeapSnapshot* snapshot, | 1047 HeapSnapshotGenerator(HeapSnapshot* snapshot, |
| 1049 v8::ActivityControl* control); | 1048 v8::ActivityControl* control); |
| 1050 bool GenerateSnapshot(); | 1049 bool GenerateSnapshot(); |
| 1051 | 1050 |
| 1052 private: | 1051 private: |
| 1053 bool ApproximateRetainedSizes(); | 1052 bool ApproximateRetainedSizes(); |
| 1054 bool BuildDominatorTree(const Vector<HeapEntry*>& entries, | 1053 bool BuildDominatorTree(const Vector<HeapEntry*>& entries, |
| 1055 Vector<HeapEntry*>* dominators); | 1054 Vector<HeapEntry*>* dominators); |
| 1056 bool CountEntriesAndReferences(HeapIterator* iterator); | 1055 bool CountEntriesAndReferences(); |
| 1057 bool FillReferences(HeapIterator* iterator); | 1056 bool FillReferences(); |
| 1058 void FillReversePostorderIndexes(Vector<HeapEntry*>* entries); | 1057 void FillReversePostorderIndexes(Vector<HeapEntry*>* entries); |
| 1059 void ProgressStep(); | 1058 void ProgressStep(); |
| 1060 bool ProgressReport(bool force = false); | 1059 bool ProgressReport(bool force = false); |
| 1061 bool SetEntriesDominators(); | 1060 bool SetEntriesDominators(); |
| 1062 void SetProgressTotal(HeapIterator* iterator, int iterations_count); | 1061 void SetProgressTotal(int iterations_count); |
| 1063 | 1062 |
| 1064 HeapSnapshot* snapshot_; | 1063 HeapSnapshot* snapshot_; |
| 1065 v8::ActivityControl* control_; | 1064 v8::ActivityControl* control_; |
| 1066 V8HeapExplorer v8_heap_explorer_; | 1065 V8HeapExplorer v8_heap_explorer_; |
| 1067 NativeObjectsExplorer dom_explorer_; | 1066 NativeObjectsExplorer dom_explorer_; |
| 1068 // Mapping from HeapThing pointers to HeapEntry* pointers. | 1067 // Mapping from HeapThing pointers to HeapEntry* pointers. |
| 1069 HeapEntriesMap entries_; | 1068 HeapEntriesMap entries_; |
| 1070 // Used during snapshot generation. | 1069 // Used during snapshot generation. |
| 1071 int progress_counter_; | 1070 int progress_counter_; |
| 1072 int progress_total_; | 1071 int progress_total_; |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1122 | 1121 |
| 1123 DISALLOW_COPY_AND_ASSIGN(HeapSnapshotJSONSerializer); | 1122 DISALLOW_COPY_AND_ASSIGN(HeapSnapshotJSONSerializer); |
| 1124 }; | 1123 }; |
| 1125 | 1124 |
| 1126 | 1125 |
| 1127 String* GetConstructorNameForHeapProfile(JSObject* object); | 1126 String* GetConstructorNameForHeapProfile(JSObject* object); |
| 1128 | 1127 |
| 1129 } } // namespace v8::internal | 1128 } } // namespace v8::internal |
| 1130 | 1129 |
| 1131 #endif // V8_PROFILE_GENERATOR_H_ | 1130 #endif // V8_PROFILE_GENERATOR_H_ |
| OLD | NEW |