| 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 523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 534 Type type, | 534 Type type, |
| 535 const char* name, | 535 const char* name, |
| 536 uint64_t id, | 536 uint64_t id, |
| 537 int self_size, | 537 int self_size, |
| 538 int children_count, | 538 int children_count, |
| 539 int retainers_count); | 539 int retainers_count); |
| 540 | 540 |
| 541 HeapSnapshot* snapshot() { return snapshot_; } | 541 HeapSnapshot* snapshot() { return snapshot_; } |
| 542 Type type() { return static_cast<Type>(type_); } | 542 Type type() { return static_cast<Type>(type_); } |
| 543 const char* name() { return name_; } | 543 const char* name() { return name_; } |
| 544 void set_name(const char* name) { name_ = name; } |
| 544 inline uint64_t id(); | 545 inline uint64_t id(); |
| 545 int self_size() { return self_size_; } | 546 int self_size() { return self_size_; } |
| 546 int retained_size() { return retained_size_; } | 547 int retained_size() { return retained_size_; } |
| 547 void add_retained_size(int size) { retained_size_ += size; } | 548 void add_retained_size(int size) { retained_size_ += size; } |
| 548 void set_retained_size(int value) { retained_size_ = value; } | 549 void set_retained_size(int value) { retained_size_ = value; } |
| 549 int ordered_index() { return ordered_index_; } | 550 int ordered_index() { return ordered_index_; } |
| 550 void set_ordered_index(int value) { ordered_index_ = value; } | 551 void set_ordered_index(int value) { ordered_index_ = value; } |
| 551 | 552 |
| 552 Vector<HeapGraphEdge> children() { | 553 Vector<HeapGraphEdge> children() { |
| 553 return Vector<HeapGraphEdge>(children_arr(), children_count_); } | 554 return Vector<HeapGraphEdge>(children_arr(), children_count_); } |
| (...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 911 class V8HeapExplorer : public HeapEntriesAllocator { | 912 class V8HeapExplorer : public HeapEntriesAllocator { |
| 912 public: | 913 public: |
| 913 V8HeapExplorer(HeapSnapshot* snapshot, | 914 V8HeapExplorer(HeapSnapshot* snapshot, |
| 914 SnapshottingProgressReportingInterface* progress); | 915 SnapshottingProgressReportingInterface* progress); |
| 915 virtual ~V8HeapExplorer(); | 916 virtual ~V8HeapExplorer(); |
| 916 virtual HeapEntry* AllocateEntry( | 917 virtual HeapEntry* AllocateEntry( |
| 917 HeapThing ptr, int children_count, int retainers_count); | 918 HeapThing ptr, int children_count, int retainers_count); |
| 918 void AddRootEntries(SnapshotFillerInterface* filler); | 919 void AddRootEntries(SnapshotFillerInterface* filler); |
| 919 int EstimateObjectsCount(HeapIterator* iterator); | 920 int EstimateObjectsCount(HeapIterator* iterator); |
| 920 bool IterateAndExtractReferences(SnapshotFillerInterface* filler); | 921 bool IterateAndExtractReferences(SnapshotFillerInterface* filler); |
| 922 bool IterateAndSetObjectNames(SnapshotFillerInterface* filler); |
| 921 void TagGlobalObjects(); | 923 void TagGlobalObjects(); |
| 922 | 924 |
| 923 static String* GetConstructorName(JSObject* object); | 925 static String* GetConstructorName(JSObject* object); |
| 924 | 926 |
| 925 static HeapObject* const kInternalRootObject; | 927 static HeapObject* const kInternalRootObject; |
| 926 | 928 |
| 927 private: | 929 private: |
| 928 HeapEntry* AddEntry( | 930 HeapEntry* AddEntry( |
| 929 HeapObject* object, int children_count, int retainers_count); | 931 HeapObject* object, int children_count, int retainers_count); |
| 930 HeapEntry* AddEntry(HeapObject* object, | 932 HeapEntry* AddEntry(HeapObject* object, |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 977 int field_offset = -1); | 979 int field_offset = -1); |
| 978 void SetPropertyShortcutReference(HeapObject* parent_obj, | 980 void SetPropertyShortcutReference(HeapObject* parent_obj, |
| 979 HeapEntry* parent, | 981 HeapEntry* parent, |
| 980 String* reference_name, | 982 String* reference_name, |
| 981 Object* child); | 983 Object* child); |
| 982 void SetRootShortcutReference(Object* child); | 984 void SetRootShortcutReference(Object* child); |
| 983 void SetRootGcRootsReference(); | 985 void SetRootGcRootsReference(); |
| 984 void SetGcRootsReference(VisitorSynchronization::SyncTag tag); | 986 void SetGcRootsReference(VisitorSynchronization::SyncTag tag); |
| 985 void SetGcSubrootReference( | 987 void SetGcSubrootReference( |
| 986 VisitorSynchronization::SyncTag tag, bool is_weak, Object* child); | 988 VisitorSynchronization::SyncTag tag, bool is_weak, Object* child); |
| 989 void SetObjectName(HeapObject* object); |
| 987 void TagObject(Object* obj, const char* tag); | 990 void TagObject(Object* obj, const char* tag); |
| 988 | 991 |
| 989 HeapEntry* GetEntry(Object* obj); | 992 HeapEntry* GetEntry(Object* obj); |
| 990 | 993 |
| 991 static inline HeapObject* GetNthGcSubrootObject(int delta); | 994 static inline HeapObject* GetNthGcSubrootObject(int delta); |
| 992 static inline int GetGcSubrootOrder(HeapObject* subroot); | 995 static inline int GetGcSubrootOrder(HeapObject* subroot); |
| 993 | 996 |
| 994 Heap* heap_; | 997 Heap* heap_; |
| 995 HeapSnapshot* snapshot_; | 998 HeapSnapshot* snapshot_; |
| 996 HeapSnapshotsCollection* collection_; | 999 HeapSnapshotsCollection* collection_; |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1150 | 1153 |
| 1151 friend class HeapSnapshotJSONSerializerEnumerator; | 1154 friend class HeapSnapshotJSONSerializerEnumerator; |
| 1152 friend class HeapSnapshotJSONSerializerIterator; | 1155 friend class HeapSnapshotJSONSerializerIterator; |
| 1153 | 1156 |
| 1154 DISALLOW_COPY_AND_ASSIGN(HeapSnapshotJSONSerializer); | 1157 DISALLOW_COPY_AND_ASSIGN(HeapSnapshotJSONSerializer); |
| 1155 }; | 1158 }; |
| 1156 | 1159 |
| 1157 } } // namespace v8::internal | 1160 } } // namespace v8::internal |
| 1158 | 1161 |
| 1159 #endif // V8_PROFILE_GENERATOR_H_ | 1162 #endif // V8_PROFILE_GENERATOR_H_ |
| OLD | NEW |