| OLD | NEW |
| 1 // Copyright 2009-2010 the V8 project authors. All rights reserved. | 1 // Copyright 2009-2010 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_HEAP_PROFILER_H_ | 5 #ifndef V8_HEAP_PROFILER_H_ |
| 6 #define V8_HEAP_PROFILER_H_ | 6 #define V8_HEAP_PROFILER_H_ |
| 7 | 7 |
| 8 #include "src/base/smart-pointers.h" | 8 #include "src/base/smart-pointers.h" |
| 9 #include "src/heap-snapshot-generator-inl.h" | |
| 10 #include "src/isolate.h" | 9 #include "src/isolate.h" |
| 11 | 10 |
| 12 namespace v8 { | 11 namespace v8 { |
| 13 namespace internal { | 12 namespace internal { |
| 14 | 13 |
| 14 // Forward declarations. |
| 15 class AllocationTracker; |
| 16 class HeapObjectsMap; |
| 15 class HeapSnapshot; | 17 class HeapSnapshot; |
| 18 class StringsStorage; |
| 16 | 19 |
| 17 class HeapProfiler { | 20 class HeapProfiler { |
| 18 public: | 21 public: |
| 19 explicit HeapProfiler(Heap* heap); | 22 explicit HeapProfiler(Heap* heap); |
| 20 ~HeapProfiler(); | 23 ~HeapProfiler(); |
| 21 | 24 |
| 22 size_t GetMemorySizeUsedByProfiler(); | 25 size_t GetMemorySizeUsedByProfiler(); |
| 23 | 26 |
| 24 HeapSnapshot* TakeSnapshot( | 27 HeapSnapshot* TakeSnapshot( |
| 25 v8::ActivityControl* control, | 28 v8::ActivityControl* control, |
| (...skipping 30 matching lines...) Expand all Loading... |
| 56 | 59 |
| 57 bool is_tracking_object_moves() const { return is_tracking_object_moves_; } | 60 bool is_tracking_object_moves() const { return is_tracking_object_moves_; } |
| 58 bool is_tracking_allocations() const { | 61 bool is_tracking_allocations() const { |
| 59 return !allocation_tracker_.is_empty(); | 62 return !allocation_tracker_.is_empty(); |
| 60 } | 63 } |
| 61 | 64 |
| 62 Handle<HeapObject> FindHeapObjectById(SnapshotObjectId id); | 65 Handle<HeapObject> FindHeapObjectById(SnapshotObjectId id); |
| 63 void ClearHeapObjectMap(); | 66 void ClearHeapObjectMap(); |
| 64 | 67 |
| 65 private: | 68 private: |
| 66 Heap* heap() const { return ids_->heap(); } | 69 Heap* heap() const; |
| 67 | 70 |
| 68 // Mapping from HeapObject addresses to objects' uids. | 71 // Mapping from HeapObject addresses to objects' uids. |
| 69 base::SmartPointer<HeapObjectsMap> ids_; | 72 base::SmartPointer<HeapObjectsMap> ids_; |
| 70 List<HeapSnapshot*> snapshots_; | 73 List<HeapSnapshot*> snapshots_; |
| 71 base::SmartPointer<StringsStorage> names_; | 74 base::SmartPointer<StringsStorage> names_; |
| 72 List<v8::HeapProfiler::WrapperInfoCallback> wrapper_callbacks_; | 75 List<v8::HeapProfiler::WrapperInfoCallback> wrapper_callbacks_; |
| 73 base::SmartPointer<AllocationTracker> allocation_tracker_; | 76 base::SmartPointer<AllocationTracker> allocation_tracker_; |
| 74 bool is_tracking_object_moves_; | 77 bool is_tracking_object_moves_; |
| 75 }; | 78 }; |
| 76 | 79 |
| 77 } } // namespace v8::internal | 80 } } // namespace v8::internal |
| 78 | 81 |
| 79 #endif // V8_HEAP_PROFILER_H_ | 82 #endif // V8_HEAP_PROFILER_H_ |
| OLD | NEW |