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 835 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
846 void CountReference(HeapThing from, HeapThing to, | 846 void CountReference(HeapThing from, HeapThing to, |
847 int* prev_children_count = NULL, | 847 int* prev_children_count = NULL, |
848 int* prev_retainers_count = NULL); | 848 int* prev_retainers_count = NULL); |
849 | 849 |
850 int entries_count() { return entries_count_; } | 850 int entries_count() { return entries_count_; } |
851 int total_children_count() { return total_children_count_; } | 851 int total_children_count() { return total_children_count_; } |
852 int total_retainers_count() { return total_retainers_count_; } | 852 int total_retainers_count() { return total_retainers_count_; } |
853 | 853 |
854 static HeapEntry* const kHeapEntryPlaceholder; | 854 static HeapEntry* const kHeapEntryPlaceholder; |
855 | 855 |
856 static uint32_t Hash(HeapThing thing) { | |
857 return ComputeIntegerHash( | |
858 static_cast<uint32_t>(reinterpret_cast<uintptr_t>(thing)), | |
859 v8::internal::kZeroHashSeed); | |
860 } | |
861 static bool HeapThingsMatch(HeapThing key1, HeapThing key2) { | |
862 return key1 == key2; | |
863 } | |
864 | |
856 private: | 865 private: |
857 struct EntryInfo { | 866 struct EntryInfo { |
858 EntryInfo(HeapEntry* entry, HeapEntriesAllocator* allocator) | 867 EntryInfo(HeapEntry* entry, HeapEntriesAllocator* allocator) |
859 : entry(entry), | 868 : entry(entry), |
860 allocator(allocator), | 869 allocator(allocator), |
861 children_count(0), | 870 children_count(0), |
862 retainers_count(0) { | 871 retainers_count(0) { |
863 } | 872 } |
864 HeapEntry* entry; | 873 HeapEntry* entry; |
865 HeapEntriesAllocator* allocator; | 874 HeapEntriesAllocator* allocator; |
866 int children_count; | 875 int children_count; |
867 int retainers_count; | 876 int retainers_count; |
868 }; | 877 }; |
869 | 878 |
870 static inline void AllocateHeapEntryForMapEntry(HashMap::Entry* map_entry); | 879 static inline void AllocateHeapEntryForMapEntry(HashMap::Entry* map_entry); |
871 | 880 |
872 static uint32_t Hash(HeapThing thing) { | |
873 return ComputeIntegerHash( | |
874 static_cast<uint32_t>(reinterpret_cast<uintptr_t>(thing)), | |
875 v8::internal::kZeroHashSeed); | |
876 } | |
877 static bool HeapThingsMatch(HeapThing key1, HeapThing key2) { | |
878 return key1 == key2; | |
879 } | |
880 | |
881 HashMap entries_; | 881 HashMap entries_; |
882 int entries_count_; | 882 int entries_count_; |
883 int total_children_count_; | 883 int total_children_count_; |
884 int total_retainers_count_; | 884 int total_retainers_count_; |
885 | 885 |
886 friend class HeapObjectsSet; | 886 friend class HeapObjectsSet; |
887 | 887 |
888 DISALLOW_COPY_AND_ASSIGN(HeapEntriesMap); | 888 DISALLOW_COPY_AND_ASSIGN(HeapEntriesMap); |
889 }; | 889 }; |
890 | 890 |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1018 int field_offset = -1); | 1018 int field_offset = -1); |
1019 void SetPropertyShortcutReference(HeapObject* parent_obj, | 1019 void SetPropertyShortcutReference(HeapObject* parent_obj, |
1020 HeapEntry* parent, | 1020 HeapEntry* parent, |
1021 String* reference_name, | 1021 String* reference_name, |
1022 Object* child); | 1022 Object* child); |
1023 void SetUserGlobalReference(Object* window); | 1023 void SetUserGlobalReference(Object* window); |
1024 void SetRootGcRootsReference(); | 1024 void SetRootGcRootsReference(); |
1025 void SetGcRootsReference(VisitorSynchronization::SyncTag tag); | 1025 void SetGcRootsReference(VisitorSynchronization::SyncTag tag); |
1026 void SetGcSubrootReference( | 1026 void SetGcSubrootReference( |
1027 VisitorSynchronization::SyncTag tag, bool is_weak, Object* child); | 1027 VisitorSynchronization::SyncTag tag, bool is_weak, Object* child); |
1028 const char* GetGcSubrootName(Object* object); | |
mnaganov (inactive)
2012/04/19 13:52:29
If it deals only with strong roots, perhaps call i
alexeif
2012/04/19 15:27:43
Done.
| |
1028 void SetObjectName(HeapObject* object); | 1029 void SetObjectName(HeapObject* object); |
1029 void TagObject(Object* obj, const char* tag); | 1030 void TagObject(Object* obj, const char* tag); |
1030 | 1031 |
1031 HeapEntry* GetEntry(Object* obj); | 1032 HeapEntry* GetEntry(Object* obj); |
1032 | 1033 |
1033 static inline HeapObject* GetNthGcSubrootObject(int delta); | 1034 static inline HeapObject* GetNthGcSubrootObject(int delta); |
1034 static inline int GetGcSubrootOrder(HeapObject* subroot); | 1035 static inline int GetGcSubrootOrder(HeapObject* subroot); |
1035 | 1036 |
1036 Heap* heap_; | 1037 Heap* heap_; |
1037 HeapSnapshot* snapshot_; | 1038 HeapSnapshot* snapshot_; |
1038 HeapSnapshotsCollection* collection_; | 1039 HeapSnapshotsCollection* collection_; |
1039 SnapshottingProgressReportingInterface* progress_; | 1040 SnapshottingProgressReportingInterface* progress_; |
1040 SnapshotFillerInterface* filler_; | 1041 SnapshotFillerInterface* filler_; |
1041 HeapObjectsSet objects_tags_; | 1042 HeapObjectsSet objects_tags_; |
1043 HashMap gc_subroot_names_; | |
mnaganov (inactive)
2012/04/19 13:52:29
Why are you using a generic HashMap? HeapObjectsSe
alexeif
2012/04/19 15:27:43
Done.
| |
1042 | 1044 |
1043 static HeapObject* const kGcRootsObject; | 1045 static HeapObject* const kGcRootsObject; |
1044 static HeapObject* const kFirstGcSubrootObject; | 1046 static HeapObject* const kFirstGcSubrootObject; |
1045 static HeapObject* const kLastGcSubrootObject; | 1047 static HeapObject* const kLastGcSubrootObject; |
1046 | 1048 |
1047 friend class IndexedReferencesExtractor; | 1049 friend class IndexedReferencesExtractor; |
1048 friend class GcSubrootsEnumerator; | 1050 friend class GcSubrootsEnumerator; |
1049 friend class RootsReferencesExtractor; | 1051 friend class RootsReferencesExtractor; |
1050 | 1052 |
1051 DISALLOW_COPY_AND_ASSIGN(V8HeapExplorer); | 1053 DISALLOW_COPY_AND_ASSIGN(V8HeapExplorer); |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1192 | 1194 |
1193 friend class HeapSnapshotJSONSerializerEnumerator; | 1195 friend class HeapSnapshotJSONSerializerEnumerator; |
1194 friend class HeapSnapshotJSONSerializerIterator; | 1196 friend class HeapSnapshotJSONSerializerIterator; |
1195 | 1197 |
1196 DISALLOW_COPY_AND_ASSIGN(HeapSnapshotJSONSerializer); | 1198 DISALLOW_COPY_AND_ASSIGN(HeapSnapshotJSONSerializer); |
1197 }; | 1199 }; |
1198 | 1200 |
1199 } } // namespace v8::internal | 1201 } } // namespace v8::internal |
1200 | 1202 |
1201 #endif // V8_PROFILE_GENERATOR_H_ | 1203 #endif // V8_PROFILE_GENERATOR_H_ |
OLD | NEW |