OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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_OBJECT_STATS_H_ | 5 #ifndef V8_HEAP_OBJECT_STATS_H_ |
6 #define V8_HEAP_OBJECT_STATS_H_ | 6 #define V8_HEAP_OBJECT_STATS_H_ |
7 | 7 |
8 #include "src/heap/heap.h" | 8 #include "src/heap/heap.h" |
9 #include "src/objects.h" | 9 #include "src/objects.h" |
10 | 10 |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 private: | 73 private: |
74 Heap* heap_; | 74 Heap* heap_; |
75 | 75 |
76 // Object counts and used memory by InstanceType | 76 // Object counts and used memory by InstanceType |
77 size_t object_counts_[OBJECT_STATS_COUNT]; | 77 size_t object_counts_[OBJECT_STATS_COUNT]; |
78 size_t object_counts_last_time_[OBJECT_STATS_COUNT]; | 78 size_t object_counts_last_time_[OBJECT_STATS_COUNT]; |
79 size_t object_sizes_[OBJECT_STATS_COUNT]; | 79 size_t object_sizes_[OBJECT_STATS_COUNT]; |
80 size_t object_sizes_last_time_[OBJECT_STATS_COUNT]; | 80 size_t object_sizes_last_time_[OBJECT_STATS_COUNT]; |
81 }; | 81 }; |
82 | 82 |
| 83 |
| 84 class ObjectStatsVisitor : public StaticMarkingVisitor<ObjectStatsVisitor> { |
| 85 public: |
| 86 static void Initialize(VisitorDispatchTable<Callback>* original); |
| 87 |
| 88 static void VisitBase(VisitorId id, Map* map, HeapObject* obj); |
| 89 |
| 90 static void CountFixedArray(FixedArrayBase* fixed_array, |
| 91 FixedArraySubInstanceType fast_type, |
| 92 FixedArraySubInstanceType dictionary_type); |
| 93 |
| 94 template <VisitorId id> |
| 95 static inline void Visit(Map* map, HeapObject* obj); |
| 96 }; |
| 97 |
83 } // namespace internal | 98 } // namespace internal |
84 } // namespace v8 | 99 } // namespace v8 |
85 | 100 |
86 #endif // V8_HEAP_OBJECT_STATS_H_ | 101 #endif // V8_HEAP_OBJECT_STATS_H_ |
OLD | NEW |