OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_PROFILER_HEAP_SNAPSHOT_GENERATOR_H_ | 5 #ifndef V8_PROFILER_HEAP_SNAPSHOT_GENERATOR_H_ |
6 #define V8_PROFILER_HEAP_SNAPSHOT_GENERATOR_H_ | 6 #define V8_PROFILER_HEAP_SNAPSHOT_GENERATOR_H_ |
7 | 7 |
8 #include "include/v8-profiler.h" | 8 #include "include/v8-profiler.h" |
9 #include "src/base/platform/time.h" | 9 #include "src/base/platform/time.h" |
10 #include "src/objects.h" | 10 #include "src/objects.h" |
11 #include "src/profiler/strings-storage.h" | 11 #include "src/profiler/strings-storage.h" |
12 | 12 |
13 namespace v8 { | 13 namespace v8 { |
14 namespace internal { | 14 namespace internal { |
15 | 15 |
16 class AllocationTracker; | 16 class AllocationTracker; |
17 class AllocationTraceNode; | 17 class AllocationTraceNode; |
18 class HeapEntry; | 18 class HeapEntry; |
19 class HeapIterator; | 19 class HeapIterator; |
20 class HeapProfiler; | 20 class HeapProfiler; |
21 class HeapSnapshot; | 21 class HeapSnapshot; |
| 22 enum class HeapObjectsFiltering; |
22 class SnapshotFiller; | 23 class SnapshotFiller; |
23 | 24 |
24 class HeapGraphEdge BASE_EMBEDDED { | 25 class HeapGraphEdge BASE_EMBEDDED { |
25 public: | 26 public: |
26 enum Type { | 27 enum Type { |
27 kContextVariable = v8::HeapGraphEdge::kContextVariable, | 28 kContextVariable = v8::HeapGraphEdge::kContextVariable, |
28 kElement = v8::HeapGraphEdge::kElement, | 29 kElement = v8::HeapGraphEdge::kElement, |
29 kProperty = v8::HeapGraphEdge::kProperty, | 30 kProperty = v8::HeapGraphEdge::kProperty, |
30 kInternal = v8::HeapGraphEdge::kInternal, | 31 kInternal = v8::HeapGraphEdge::kInternal, |
31 kHidden = v8::HeapGraphEdge::kHidden, | 32 kHidden = v8::HeapGraphEdge::kHidden, |
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
356 | 357 |
357 void MarkVisitedField(HeapObject* obj, int offset); | 358 void MarkVisitedField(HeapObject* obj, int offset); |
358 | 359 |
359 HeapEntry* AddEntry(HeapObject* object); | 360 HeapEntry* AddEntry(HeapObject* object); |
360 HeapEntry* AddEntry(HeapObject* object, | 361 HeapEntry* AddEntry(HeapObject* object, |
361 HeapEntry::Type type, | 362 HeapEntry::Type type, |
362 const char* name); | 363 const char* name); |
363 | 364 |
364 const char* GetSystemEntryName(HeapObject* object); | 365 const char* GetSystemEntryName(HeapObject* object); |
365 | 366 |
366 template<V8HeapExplorer::ExtractReferencesMethod extractor> | 367 template <V8HeapExplorer::ExtractReferencesMethod extractor> |
367 bool IterateAndExtractSinglePass(); | 368 bool IterateAndExtractSinglePass(HeapObjectsFiltering filtering); |
368 | 369 |
369 bool ExtractReferencesPass1(int entry, HeapObject* obj); | 370 bool ExtractReferencesPass1(int entry, HeapObject* obj); |
370 bool ExtractReferencesPass2(int entry, HeapObject* obj); | 371 bool ExtractReferencesPass2(int entry, HeapObject* obj); |
371 void ExtractJSGlobalProxyReferences(int entry, JSGlobalProxy* proxy); | 372 void ExtractJSGlobalProxyReferences(int entry, JSGlobalProxy* proxy); |
372 void ExtractJSObjectReferences(int entry, JSObject* js_obj); | 373 void ExtractJSObjectReferences(int entry, JSObject* js_obj); |
373 void ExtractStringReferences(int entry, String* obj); | 374 void ExtractStringReferences(int entry, String* obj); |
374 void ExtractSymbolReferences(int entry, Symbol* symbol); | 375 void ExtractSymbolReferences(int entry, Symbol* symbol); |
375 void ExtractJSCollectionReferences(int entry, JSCollection* collection); | 376 void ExtractJSCollectionReferences(int entry, JSCollection* collection); |
376 void ExtractJSWeakCollectionReferences(int entry, | 377 void ExtractJSWeakCollectionReferences(int entry, |
377 JSWeakCollection* collection); | 378 JSWeakCollection* collection); |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
618 friend class HeapSnapshotJSONSerializerIterator; | 619 friend class HeapSnapshotJSONSerializerIterator; |
619 | 620 |
620 DISALLOW_COPY_AND_ASSIGN(HeapSnapshotJSONSerializer); | 621 DISALLOW_COPY_AND_ASSIGN(HeapSnapshotJSONSerializer); |
621 }; | 622 }; |
622 | 623 |
623 | 624 |
624 } // namespace internal | 625 } // namespace internal |
625 } // namespace v8 | 626 } // namespace v8 |
626 | 627 |
627 #endif // V8_PROFILER_HEAP_SNAPSHOT_GENERATOR_H_ | 628 #endif // V8_PROFILER_HEAP_SNAPSHOT_GENERATOR_H_ |
OLD | NEW |