Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: src/heap-snapshot-generator.h

Issue 181453002: Reset trunk to 3.24.35.4 (Closed) Base URL: https://v8.googlecode.com/svn/trunk
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/heap-inl.h ('k') | src/heap-snapshot-generator.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 kConsString = v8::HeapGraphNode::kConsString, 107 kConsString = v8::HeapGraphNode::kConsString,
108 kSlicedString = v8::HeapGraphNode::kSlicedString 108 kSlicedString = v8::HeapGraphNode::kSlicedString
109 }; 109 };
110 static const int kNoEntry; 110 static const int kNoEntry;
111 111
112 HeapEntry() { } 112 HeapEntry() { }
113 HeapEntry(HeapSnapshot* snapshot, 113 HeapEntry(HeapSnapshot* snapshot,
114 Type type, 114 Type type,
115 const char* name, 115 const char* name,
116 SnapshotObjectId id, 116 SnapshotObjectId id,
117 size_t self_size); 117 int self_size);
118 118
119 HeapSnapshot* snapshot() { return snapshot_; } 119 HeapSnapshot* snapshot() { return snapshot_; }
120 Type type() { return static_cast<Type>(type_); } 120 Type type() { return static_cast<Type>(type_); }
121 const char* name() { return name_; } 121 const char* name() { return name_; }
122 void set_name(const char* name) { name_ = name; } 122 void set_name(const char* name) { name_ = name; }
123 inline SnapshotObjectId id() { return id_; } 123 inline SnapshotObjectId id() { return id_; }
124 size_t self_size() { return self_size_; } 124 int self_size() { return self_size_; }
125 INLINE(int index() const); 125 INLINE(int index() const);
126 int children_count() const { return children_count_; } 126 int children_count() const { return children_count_; }
127 INLINE(int set_children_index(int index)); 127 INLINE(int set_children_index(int index));
128 void add_child(HeapGraphEdge* edge) { 128 void add_child(HeapGraphEdge* edge) {
129 children_arr()[children_count_++] = edge; 129 children_arr()[children_count_++] = edge;
130 } 130 }
131 Vector<HeapGraphEdge*> children() { 131 Vector<HeapGraphEdge*> children() {
132 return Vector<HeapGraphEdge*>(children_arr(), children_count_); } 132 return Vector<HeapGraphEdge*>(children_arr(), children_count_); }
133 133
134 void SetIndexedReference( 134 void SetIndexedReference(
135 HeapGraphEdge::Type type, int index, HeapEntry* entry); 135 HeapGraphEdge::Type type, int index, HeapEntry* entry);
136 void SetNamedReference( 136 void SetNamedReference(
137 HeapGraphEdge::Type type, const char* name, HeapEntry* entry); 137 HeapGraphEdge::Type type, const char* name, HeapEntry* entry);
138 138
139 void Print( 139 void Print(
140 const char* prefix, const char* edge_name, int max_depth, int indent); 140 const char* prefix, const char* edge_name, int max_depth, int indent);
141 141
142 private: 142 private:
143 INLINE(HeapGraphEdge** children_arr()); 143 INLINE(HeapGraphEdge** children_arr());
144 const char* TypeAsString(); 144 const char* TypeAsString();
145 145
146 unsigned type_: 4; 146 unsigned type_: 4;
147 int children_count_: 28; 147 int children_count_: 28;
148 int children_index_; 148 int children_index_;
149 size_t self_size_; 149 int self_size_;
150 SnapshotObjectId id_; 150 SnapshotObjectId id_;
151 HeapSnapshot* snapshot_; 151 HeapSnapshot* snapshot_;
152 const char* name_; 152 const char* name_;
153 }; 153 };
154 154
155 155
156 // HeapSnapshot represents a single heap snapshot. It is stored in 156 // HeapSnapshot represents a single heap snapshot. It is stored in
157 // HeapProfiler, which is also a factory for 157 // HeapProfiler, which is also a factory for
158 // HeapSnapshots. All HeapSnapshots share strings copied from JS heap 158 // HeapSnapshots. All HeapSnapshots share strings copied from JS heap
159 // to be able to return them even if they were collected. 159 // to be able to return them even if they were collected.
(...skipping 19 matching lines...) Expand all
179 List<HeapGraphEdge>& edges() { return edges_; } 179 List<HeapGraphEdge>& edges() { return edges_; }
180 List<HeapGraphEdge*>& children() { return children_; } 180 List<HeapGraphEdge*>& children() { return children_; }
181 void RememberLastJSObjectId(); 181 void RememberLastJSObjectId();
182 SnapshotObjectId max_snapshot_js_object_id() const { 182 SnapshotObjectId max_snapshot_js_object_id() const {
183 return max_snapshot_js_object_id_; 183 return max_snapshot_js_object_id_;
184 } 184 }
185 185
186 HeapEntry* AddEntry(HeapEntry::Type type, 186 HeapEntry* AddEntry(HeapEntry::Type type,
187 const char* name, 187 const char* name,
188 SnapshotObjectId id, 188 SnapshotObjectId id,
189 size_t size); 189 int size);
190 HeapEntry* AddRootEntry(); 190 HeapEntry* AddRootEntry();
191 HeapEntry* AddGcRootsEntry(); 191 HeapEntry* AddGcRootsEntry();
192 HeapEntry* AddGcSubrootEntry(int tag); 192 HeapEntry* AddGcSubrootEntry(int tag);
193 HeapEntry* AddNativesRootEntry(); 193 HeapEntry* AddNativesRootEntry();
194 HeapEntry* GetEntryById(SnapshotObjectId id); 194 HeapEntry* GetEntryById(SnapshotObjectId id);
195 List<HeapEntry*>* GetSortedEntriesList(); 195 List<HeapEntry*>* GetSortedEntriesList();
196 void FillChildren(); 196 void FillChildren();
197 197
198 void Print(int max_depth); 198 void Print(int max_depth);
199 void PrintEntriesSize(); 199 void PrintEntriesSize();
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
379 SnapshottingProgressReportingInterface* progress, 379 SnapshottingProgressReportingInterface* progress,
380 v8::HeapProfiler::ObjectNameResolver* resolver); 380 v8::HeapProfiler::ObjectNameResolver* resolver);
381 virtual ~V8HeapExplorer(); 381 virtual ~V8HeapExplorer();
382 virtual HeapEntry* AllocateEntry(HeapThing ptr); 382 virtual HeapEntry* AllocateEntry(HeapThing ptr);
383 void AddRootEntries(SnapshotFillerInterface* filler); 383 void AddRootEntries(SnapshotFillerInterface* filler);
384 int EstimateObjectsCount(HeapIterator* iterator); 384 int EstimateObjectsCount(HeapIterator* iterator);
385 bool IterateAndExtractReferences(SnapshotFillerInterface* filler); 385 bool IterateAndExtractReferences(SnapshotFillerInterface* filler);
386 void TagGlobalObjects(); 386 void TagGlobalObjects();
387 void TagCodeObject(Code* code); 387 void TagCodeObject(Code* code);
388 void TagBuiltinCodeObject(Code* code, const char* name); 388 void TagBuiltinCodeObject(Code* code, const char* name);
389 HeapEntry* AddEntry(Address address,
390 HeapEntry::Type type,
391 const char* name,
392 size_t size);
393 389
394 static String* GetConstructorName(JSObject* object); 390 static String* GetConstructorName(JSObject* object);
395 391
396 static HeapObject* const kInternalRootObject; 392 static HeapObject* const kInternalRootObject;
397 393
398 private: 394 private:
399 HeapEntry* AddEntry(HeapObject* object); 395 HeapEntry* AddEntry(HeapObject* object);
400 HeapEntry* AddEntry(HeapObject* object, 396 HeapEntry* AddEntry(HeapObject* object,
401 HeapEntry::Type type, 397 HeapEntry::Type type,
402 const char* name); 398 const char* name);
403
404 const char* GetSystemEntryName(HeapObject* object); 399 const char* GetSystemEntryName(HeapObject* object);
405 400
406 void ExtractReferences(HeapObject* obj); 401 void ExtractReferences(HeapObject* obj);
407 void ExtractJSGlobalProxyReferences(int entry, JSGlobalProxy* proxy); 402 void ExtractJSGlobalProxyReferences(int entry, JSGlobalProxy* proxy);
408 void ExtractJSObjectReferences(int entry, JSObject* js_obj); 403 void ExtractJSObjectReferences(int entry, JSObject* js_obj);
409 void ExtractStringReferences(int entry, String* obj); 404 void ExtractStringReferences(int entry, String* obj);
410 void ExtractContextReferences(int entry, Context* context); 405 void ExtractContextReferences(int entry, Context* context);
411 void ExtractMapReferences(int entry, Map* map); 406 void ExtractMapReferences(int entry, Map* map);
412 void ExtractSharedFunctionInfoReferences(int entry, 407 void ExtractSharedFunctionInfoReferences(int entry,
413 SharedFunctionInfo* shared); 408 SharedFunctionInfo* shared);
414 void ExtractScriptReferences(int entry, Script* script); 409 void ExtractScriptReferences(int entry, Script* script);
415 void ExtractAccessorPairReferences(int entry, AccessorPair* accessors); 410 void ExtractAccessorPairReferences(int entry, AccessorPair* accessors);
416 void ExtractCodeCacheReferences(int entry, CodeCache* code_cache); 411 void ExtractCodeCacheReferences(int entry, CodeCache* code_cache);
417 void ExtractCodeReferences(int entry, Code* code); 412 void ExtractCodeReferences(int entry, Code* code);
418 void ExtractBoxReferences(int entry, Box* box); 413 void ExtractBoxReferences(int entry, Box* box);
419 void ExtractCellReferences(int entry, Cell* cell); 414 void ExtractCellReferences(int entry, Cell* cell);
420 void ExtractPropertyCellReferences(int entry, PropertyCell* cell); 415 void ExtractPropertyCellReferences(int entry, PropertyCell* cell);
421 void ExtractAllocationSiteReferences(int entry, AllocationSite* site); 416 void ExtractAllocationSiteReferences(int entry, AllocationSite* site);
422 void ExtractJSArrayBufferReferences(int entry, JSArrayBuffer* buffer);
423 void ExtractClosureReferences(JSObject* js_obj, int entry); 417 void ExtractClosureReferences(JSObject* js_obj, int entry);
424 void ExtractPropertyReferences(JSObject* js_obj, int entry); 418 void ExtractPropertyReferences(JSObject* js_obj, int entry);
425 bool ExtractAccessorPairProperty(JSObject* js_obj, int entry, 419 bool ExtractAccessorPairProperty(JSObject* js_obj, int entry,
426 Object* key, Object* callback_obj); 420 Object* key, Object* callback_obj);
427 void ExtractElementReferences(JSObject* js_obj, int entry); 421 void ExtractElementReferences(JSObject* js_obj, int entry);
428 void ExtractInternalReferences(JSObject* js_obj, int entry); 422 void ExtractInternalReferences(JSObject* js_obj, int entry);
429 bool IsEssentialObject(Object* object); 423 bool IsEssentialObject(Object* object);
430 void SetContextReference(HeapObject* parent_obj, 424 void SetContextReference(HeapObject* parent_obj,
431 int parent, 425 int parent,
432 String* reference_name, 426 String* reference_name,
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
642 friend class HeapSnapshotJSONSerializerEnumerator; 636 friend class HeapSnapshotJSONSerializerEnumerator;
643 friend class HeapSnapshotJSONSerializerIterator; 637 friend class HeapSnapshotJSONSerializerIterator;
644 638
645 DISALLOW_COPY_AND_ASSIGN(HeapSnapshotJSONSerializer); 639 DISALLOW_COPY_AND_ASSIGN(HeapSnapshotJSONSerializer);
646 }; 640 };
647 641
648 642
649 } } // namespace v8::internal 643 } } // namespace v8::internal
650 644
651 #endif // V8_HEAP_SNAPSHOT_GENERATOR_H_ 645 #endif // V8_HEAP_SNAPSHOT_GENERATOR_H_
OLDNEW
« no previous file with comments | « src/heap-inl.h ('k') | src/heap-snapshot-generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698