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 841 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
852 DISALLOW_COPY_AND_ASSIGN(HeapEntriesMap); | 852 DISALLOW_COPY_AND_ASSIGN(HeapEntriesMap); |
853 }; | 853 }; |
854 | 854 |
855 | 855 |
856 class HeapObjectsSet { | 856 class HeapObjectsSet { |
857 public: | 857 public: |
858 HeapObjectsSet(); | 858 HeapObjectsSet(); |
859 void Clear(); | 859 void Clear(); |
860 bool Contains(Object* object); | 860 bool Contains(Object* object); |
861 void Insert(Object* obj); | 861 void Insert(Object* obj); |
| 862 const char* GetTag(Object* obj); |
| 863 void SetTag(Object* obj, const char* tag); |
862 | 864 |
863 private: | 865 private: |
864 HashMap entries_; | 866 HashMap entries_; |
865 | 867 |
866 DISALLOW_COPY_AND_ASSIGN(HeapObjectsSet); | 868 DISALLOW_COPY_AND_ASSIGN(HeapObjectsSet); |
867 }; | 869 }; |
868 | 870 |
869 | 871 |
870 // An interface used to populate a snapshot with nodes and edges. | 872 // An interface used to populate a snapshot with nodes and edges. |
871 class SnapshotFillerInterface { | 873 class SnapshotFillerInterface { |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
913 class V8HeapExplorer : public HeapEntriesAllocator { | 915 class V8HeapExplorer : public HeapEntriesAllocator { |
914 public: | 916 public: |
915 V8HeapExplorer(HeapSnapshot* snapshot, | 917 V8HeapExplorer(HeapSnapshot* snapshot, |
916 SnapshottingProgressReportingInterface* progress); | 918 SnapshottingProgressReportingInterface* progress); |
917 virtual ~V8HeapExplorer(); | 919 virtual ~V8HeapExplorer(); |
918 virtual HeapEntry* AllocateEntry( | 920 virtual HeapEntry* AllocateEntry( |
919 HeapThing ptr, int children_count, int retainers_count); | 921 HeapThing ptr, int children_count, int retainers_count); |
920 void AddRootEntries(SnapshotFillerInterface* filler); | 922 void AddRootEntries(SnapshotFillerInterface* filler); |
921 int EstimateObjectsCount(); | 923 int EstimateObjectsCount(); |
922 bool IterateAndExtractReferences(SnapshotFillerInterface* filler); | 924 bool IterateAndExtractReferences(SnapshotFillerInterface* filler); |
| 925 void TagGlobalObjects(); |
923 | 926 |
924 static HeapObject* const kInternalRootObject; | 927 static HeapObject* const kInternalRootObject; |
925 | 928 |
926 private: | 929 private: |
927 HeapEntry* AddEntry( | 930 HeapEntry* AddEntry( |
928 HeapObject* object, int children_count, int retainers_count); | 931 HeapObject* object, int children_count, int retainers_count); |
929 HeapEntry* AddEntry(HeapObject* object, | 932 HeapEntry* AddEntry(HeapObject* object, |
930 HeapEntry::Type type, | 933 HeapEntry::Type type, |
931 const char* name, | 934 const char* name, |
932 int children_count, | 935 int children_count, |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
971 void SetRootShortcutReference(Object* child); | 974 void SetRootShortcutReference(Object* child); |
972 void SetRootGcRootsReference(); | 975 void SetRootGcRootsReference(); |
973 void SetGcRootsReference(Object* child); | 976 void SetGcRootsReference(Object* child); |
974 | 977 |
975 HeapEntry* GetEntry(Object* obj); | 978 HeapEntry* GetEntry(Object* obj); |
976 | 979 |
977 HeapSnapshot* snapshot_; | 980 HeapSnapshot* snapshot_; |
978 HeapSnapshotsCollection* collection_; | 981 HeapSnapshotsCollection* collection_; |
979 SnapshottingProgressReportingInterface* progress_; | 982 SnapshottingProgressReportingInterface* progress_; |
980 SnapshotFillerInterface* filler_; | 983 SnapshotFillerInterface* filler_; |
| 984 HeapObjectsSet objects_tags_; |
981 | 985 |
982 static HeapObject* const kGcRootsObject; | 986 static HeapObject* const kGcRootsObject; |
983 | 987 |
984 friend class IndexedReferencesExtractor; | 988 friend class IndexedReferencesExtractor; |
985 friend class RootsReferencesExtractor; | 989 friend class RootsReferencesExtractor; |
986 | 990 |
987 DISALLOW_COPY_AND_ASSIGN(V8HeapExplorer); | 991 DISALLOW_COPY_AND_ASSIGN(V8HeapExplorer); |
988 }; | 992 }; |
989 | 993 |
990 | 994 |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1117 }; | 1121 }; |
1118 | 1122 |
1119 | 1123 |
1120 String* GetConstructorNameForHeapProfile(JSObject* object); | 1124 String* GetConstructorNameForHeapProfile(JSObject* object); |
1121 | 1125 |
1122 } } // namespace v8::internal | 1126 } } // namespace v8::internal |
1123 | 1127 |
1124 #endif // ENABLE_LOGGING_AND_PROFILING | 1128 #endif // ENABLE_LOGGING_AND_PROFILING |
1125 | 1129 |
1126 #endif // V8_PROFILE_GENERATOR_H_ | 1130 #endif // V8_PROFILE_GENERATOR_H_ |
OLD | NEW |