| 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 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 519 HeapEntry() { } | 519 HeapEntry() { } |
| 520 HeapEntry(HeapSnapshot* snapshot, | 520 HeapEntry(HeapSnapshot* snapshot, |
| 521 Type type, | 521 Type type, |
| 522 const char* name, | 522 const char* name, |
| 523 SnapshotObjectId id, | 523 SnapshotObjectId id, |
| 524 int self_size); | 524 int self_size); |
| 525 | 525 |
| 526 HeapSnapshot* snapshot() { return snapshot_; } | 526 HeapSnapshot* snapshot() { return snapshot_; } |
| 527 Type type() { return static_cast<Type>(type_); } | 527 Type type() { return static_cast<Type>(type_); } |
| 528 const char* name() { return name_; } | 528 const char* name() { return name_; } |
| 529 void set_name(const char* name) { name_ = name; } | |
| 530 inline SnapshotObjectId id() { return id_; } | 529 inline SnapshotObjectId id() { return id_; } |
| 531 int self_size() { return self_size_; } | 530 int self_size() { return self_size_; } |
| 532 int retained_size() { return retained_size_; } | 531 int retained_size() { return retained_size_; } |
| 533 void add_retained_size(int size) { retained_size_ += size; } | 532 void add_retained_size(int size) { retained_size_ += size; } |
| 534 void set_retained_size(int size) { retained_size_ = size; } | 533 void set_retained_size(int size) { retained_size_ = size; } |
| 535 INLINE(int index() const); | 534 INLINE(int index() const); |
| 536 int postorder_index() { return postorder_index_; } | 535 int postorder_index() { return postorder_index_; } |
| 537 void set_postorder_index(int value) { postorder_index_ = value; } | 536 void set_postorder_index(int value) { postorder_index_ = value; } |
| 538 int children_count() const { return children_count_; } | 537 int children_count() const { return children_count_; } |
| 539 INLINE(int set_children_index(int index)); | 538 INLINE(int set_children_index(int index)); |
| (...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 882 // An implementation of V8 heap graph extractor. | 881 // An implementation of V8 heap graph extractor. |
| 883 class V8HeapExplorer : public HeapEntriesAllocator { | 882 class V8HeapExplorer : public HeapEntriesAllocator { |
| 884 public: | 883 public: |
| 885 V8HeapExplorer(HeapSnapshot* snapshot, | 884 V8HeapExplorer(HeapSnapshot* snapshot, |
| 886 SnapshottingProgressReportingInterface* progress); | 885 SnapshottingProgressReportingInterface* progress); |
| 887 virtual ~V8HeapExplorer(); | 886 virtual ~V8HeapExplorer(); |
| 888 virtual HeapEntry* AllocateEntry(HeapThing ptr); | 887 virtual HeapEntry* AllocateEntry(HeapThing ptr); |
| 889 void AddRootEntries(SnapshotFillerInterface* filler); | 888 void AddRootEntries(SnapshotFillerInterface* filler); |
| 890 int EstimateObjectsCount(HeapIterator* iterator); | 889 int EstimateObjectsCount(HeapIterator* iterator); |
| 891 bool IterateAndExtractReferences(SnapshotFillerInterface* filler); | 890 bool IterateAndExtractReferences(SnapshotFillerInterface* filler); |
| 892 bool IterateAndSetObjectNames(SnapshotFillerInterface* filler); | |
| 893 void TagGlobalObjects(); | 891 void TagGlobalObjects(); |
| 894 | 892 |
| 895 static String* GetConstructorName(JSObject* object); | 893 static String* GetConstructorName(JSObject* object); |
| 896 | 894 |
| 897 static HeapObject* const kInternalRootObject; | 895 static HeapObject* const kInternalRootObject; |
| 898 | 896 |
| 899 private: | 897 private: |
| 900 HeapEntry* AddEntry(HeapObject* object); | 898 HeapEntry* AddEntry(HeapObject* object); |
| 901 HeapEntry* AddEntry(HeapObject* object, | 899 HeapEntry* AddEntry(HeapObject* object, |
| 902 HeapEntry::Type type, | 900 HeapEntry::Type type, |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 961 void SetPropertyShortcutReference(HeapObject* parent_obj, | 959 void SetPropertyShortcutReference(HeapObject* parent_obj, |
| 962 int parent, | 960 int parent, |
| 963 String* reference_name, | 961 String* reference_name, |
| 964 Object* child); | 962 Object* child); |
| 965 void SetUserGlobalReference(Object* user_global); | 963 void SetUserGlobalReference(Object* user_global); |
| 966 void SetRootGcRootsReference(); | 964 void SetRootGcRootsReference(); |
| 967 void SetGcRootsReference(VisitorSynchronization::SyncTag tag); | 965 void SetGcRootsReference(VisitorSynchronization::SyncTag tag); |
| 968 void SetGcSubrootReference( | 966 void SetGcSubrootReference( |
| 969 VisitorSynchronization::SyncTag tag, bool is_weak, Object* child); | 967 VisitorSynchronization::SyncTag tag, bool is_weak, Object* child); |
| 970 const char* GetStrongGcSubrootName(Object* object); | 968 const char* GetStrongGcSubrootName(Object* object); |
| 971 void SetObjectName(HeapObject* object); | |
| 972 void TagObject(Object* obj, const char* tag); | 969 void TagObject(Object* obj, const char* tag); |
| 973 | 970 |
| 974 HeapEntry* GetEntry(Object* obj); | 971 HeapEntry* GetEntry(Object* obj); |
| 975 | 972 |
| 976 static inline HeapObject* GetNthGcSubrootObject(int delta); | 973 static inline HeapObject* GetNthGcSubrootObject(int delta); |
| 977 static inline int GetGcSubrootOrder(HeapObject* subroot); | 974 static inline int GetGcSubrootOrder(HeapObject* subroot); |
| 978 | 975 |
| 979 Heap* heap_; | 976 Heap* heap_; |
| 980 HeapSnapshot* snapshot_; | 977 HeapSnapshot* snapshot_; |
| 981 HeapSnapshotsCollection* collection_; | 978 HeapSnapshotsCollection* collection_; |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1136 | 1133 |
| 1137 friend class HeapSnapshotJSONSerializerEnumerator; | 1134 friend class HeapSnapshotJSONSerializerEnumerator; |
| 1138 friend class HeapSnapshotJSONSerializerIterator; | 1135 friend class HeapSnapshotJSONSerializerIterator; |
| 1139 | 1136 |
| 1140 DISALLOW_COPY_AND_ASSIGN(HeapSnapshotJSONSerializer); | 1137 DISALLOW_COPY_AND_ASSIGN(HeapSnapshotJSONSerializer); |
| 1141 }; | 1138 }; |
| 1142 | 1139 |
| 1143 } } // namespace v8::internal | 1140 } } // namespace v8::internal |
| 1144 | 1141 |
| 1145 #endif // V8_PROFILE_GENERATOR_H_ | 1142 #endif // V8_PROFILE_GENERATOR_H_ |
| OLD | NEW |