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_POOL_H_ | 5 #ifndef V8_COMPILER_ZONE_POOL_H_ |
6 #define V8_COMPILER_ZONE_POOL_H_ | 6 #define V8_COMPILER_ZONE_POOL_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <vector> | 10 #include <vector> |
(...skipping 26 matching lines...) Expand all Loading... |
37 DISALLOW_COPY_AND_ASSIGN(Scope); | 37 DISALLOW_COPY_AND_ASSIGN(Scope); |
38 }; | 38 }; |
39 | 39 |
40 class StatsScope FINAL { | 40 class StatsScope FINAL { |
41 public: | 41 public: |
42 explicit StatsScope(ZonePool* zone_pool); | 42 explicit StatsScope(ZonePool* zone_pool); |
43 ~StatsScope(); | 43 ~StatsScope(); |
44 | 44 |
45 size_t GetMaxAllocatedBytes(); | 45 size_t GetMaxAllocatedBytes(); |
46 size_t GetCurrentAllocatedBytes(); | 46 size_t GetCurrentAllocatedBytes(); |
| 47 size_t GetTotalAllocatedBytes(); |
47 | 48 |
48 private: | 49 private: |
49 friend class ZonePool; | 50 friend class ZonePool; |
50 void ZoneReturned(Zone* zone); | 51 void ZoneReturned(Zone* zone); |
51 | 52 |
52 typedef std::map<Zone*, size_t> InitialValues; | 53 typedef std::map<Zone*, size_t> InitialValues; |
53 | 54 |
54 ZonePool* const zone_pool_; | 55 ZonePool* const zone_pool_; |
55 InitialValues initial_values_; | 56 InitialValues initial_values_; |
| 57 size_t total_allocated_bytes_at_start_; |
56 size_t max_allocated_bytes_; | 58 size_t max_allocated_bytes_; |
57 | 59 |
58 DISALLOW_COPY_AND_ASSIGN(StatsScope); | 60 DISALLOW_COPY_AND_ASSIGN(StatsScope); |
59 }; | 61 }; |
60 | 62 |
61 explicit ZonePool(Isolate* isolate); | 63 explicit ZonePool(Isolate* isolate); |
62 ~ZonePool(); | 64 ~ZonePool(); |
63 | 65 |
64 size_t GetMaxAllocatedBytes(); | 66 size_t GetMaxAllocatedBytes(); |
65 size_t GetTotalAllocatedBytes(); | 67 size_t GetTotalAllocatedBytes(); |
(...skipping 16 matching lines...) Expand all Loading... |
82 size_t total_deleted_bytes_; | 84 size_t total_deleted_bytes_; |
83 | 85 |
84 DISALLOW_COPY_AND_ASSIGN(ZonePool); | 86 DISALLOW_COPY_AND_ASSIGN(ZonePool); |
85 }; | 87 }; |
86 | 88 |
87 } // namespace compiler | 89 } // namespace compiler |
88 } // namespace internal | 90 } // namespace internal |
89 } // namespace v8 | 91 } // namespace v8 |
90 | 92 |
91 #endif | 93 #endif |
OLD | NEW |