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 #include "src/compiler/zone-pool.h" | 5 #include "src/compiler/zone-pool.h" |
6 | 6 |
7 namespace v8 { | 7 namespace v8 { |
8 namespace internal { | 8 namespace internal { |
9 namespace compiler { | 9 namespace compiler { |
10 | 10 |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 size_t current_total = GetCurrentAllocatedBytes(); | 57 size_t current_total = GetCurrentAllocatedBytes(); |
58 // Update max. | 58 // Update max. |
59 max_allocated_bytes_ = std::max(max_allocated_bytes_, current_total); | 59 max_allocated_bytes_ = std::max(max_allocated_bytes_, current_total); |
60 // Drop zone from initial value map. | 60 // Drop zone from initial value map. |
61 InitialValues::iterator it = initial_values_.find(zone); | 61 InitialValues::iterator it = initial_values_.find(zone); |
62 if (it != initial_values_.end()) { | 62 if (it != initial_values_.end()) { |
63 initial_values_.erase(it); | 63 initial_values_.erase(it); |
64 } | 64 } |
65 } | 65 } |
66 | 66 |
67 ZonePool::ZonePool(base::AccountingAllocator* allocator) | 67 ZonePool::ZonePool(AccountingAllocator* allocator) |
68 : max_allocated_bytes_(0), total_deleted_bytes_(0), allocator_(allocator) {} | 68 : max_allocated_bytes_(0), total_deleted_bytes_(0), allocator_(allocator) {} |
69 | 69 |
70 ZonePool::~ZonePool() { | 70 ZonePool::~ZonePool() { |
71 DCHECK(used_.empty()); | 71 DCHECK(used_.empty()); |
72 DCHECK(stats_.empty()); | 72 DCHECK(stats_.empty()); |
73 for (Zone* zone : unused_) { | 73 for (Zone* zone : unused_) { |
74 delete zone; | 74 delete zone; |
75 } | 75 } |
76 } | 76 } |
77 | 77 |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 } else { | 129 } else { |
130 zone->DeleteAll(); | 130 zone->DeleteAll(); |
131 DCHECK_EQ(0u, zone->allocation_size()); | 131 DCHECK_EQ(0u, zone->allocation_size()); |
132 unused_.push_back(zone); | 132 unused_.push_back(zone); |
133 } | 133 } |
134 } | 134 } |
135 | 135 |
136 } // namespace compiler | 136 } // namespace compiler |
137 } // namespace internal | 137 } // namespace internal |
138 } // namespace v8 | 138 } // namespace v8 |
OLD | NEW |