OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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_COMPILER_ZONE_STATS_H_ | 5 #ifndef V8_COMPILER_ZONE_STATS_H_ |
6 #define V8_COMPILER_ZONE_STATS_H_ | 6 #define V8_COMPILER_ZONE_STATS_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <vector> | 10 #include <vector> |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 InitialValues initial_values_; | 59 InitialValues initial_values_; |
60 size_t total_allocated_bytes_at_start_; | 60 size_t total_allocated_bytes_at_start_; |
61 size_t max_allocated_bytes_; | 61 size_t max_allocated_bytes_; |
62 | 62 |
63 DISALLOW_COPY_AND_ASSIGN(StatsScope); | 63 DISALLOW_COPY_AND_ASSIGN(StatsScope); |
64 }; | 64 }; |
65 | 65 |
66 explicit ZoneStats(AccountingAllocator* allocator); | 66 explicit ZoneStats(AccountingAllocator* allocator); |
67 ~ZoneStats(); | 67 ~ZoneStats(); |
68 | 68 |
69 size_t GetMaxAllocatedBytes(); | 69 size_t GetMaxAllocatedBytes() const; |
70 size_t GetTotalAllocatedBytes(); | 70 size_t GetTotalAllocatedBytes() const; |
71 size_t GetCurrentAllocatedBytes(); | 71 size_t GetCurrentAllocatedBytes() const; |
72 | 72 |
73 private: | 73 private: |
74 Zone* NewEmptyZone(const char* zone_name); | 74 Zone* NewEmptyZone(const char* zone_name); |
75 void ReturnZone(Zone* zone); | 75 void ReturnZone(Zone* zone); |
76 | 76 |
77 static const size_t kMaxUnusedSize = 3; | 77 static const size_t kMaxUnusedSize = 3; |
78 typedef std::vector<Zone*> Zones; | 78 typedef std::vector<Zone*> Zones; |
79 typedef std::vector<StatsScope*> Stats; | 79 typedef std::vector<StatsScope*> Stats; |
80 | 80 |
81 Zones zones_; | 81 Zones zones_; |
82 Stats stats_; | 82 Stats stats_; |
83 size_t max_allocated_bytes_; | 83 size_t max_allocated_bytes_; |
84 size_t total_deleted_bytes_; | 84 size_t total_deleted_bytes_; |
85 AccountingAllocator* allocator_; | 85 AccountingAllocator* allocator_; |
86 | 86 |
87 DISALLOW_COPY_AND_ASSIGN(ZoneStats); | 87 DISALLOW_COPY_AND_ASSIGN(ZoneStats); |
88 }; | 88 }; |
89 | 89 |
90 } // namespace compiler | 90 } // namespace compiler |
91 } // namespace internal | 91 } // namespace internal |
92 } // namespace v8 | 92 } // namespace v8 |
93 | 93 |
94 #endif // V8_COMPILER_ZONE_STATS_H_ | 94 #endif // V8_COMPILER_ZONE_STATS_H_ |
OLD | NEW |