| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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/v8.h" | 5 #include "src/v8.h" |
| 6 | 6 |
| 7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
| 8 #include "src/api.h" | 8 #include "src/api.h" |
| 9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
| 10 #include "src/base/once.h" | 10 #include "src/base/once.h" |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 intptr_t Heap::Capacity() { | 170 intptr_t Heap::Capacity() { |
| 171 if (!HasBeenSetUp()) return 0; | 171 if (!HasBeenSetUp()) return 0; |
| 172 | 172 |
| 173 return new_space_.Capacity() + old_pointer_space_->Capacity() + | 173 return new_space_.Capacity() + old_pointer_space_->Capacity() + |
| 174 old_data_space_->Capacity() + code_space_->Capacity() + | 174 old_data_space_->Capacity() + code_space_->Capacity() + |
| 175 map_space_->Capacity() + cell_space_->Capacity() + | 175 map_space_->Capacity() + cell_space_->Capacity() + |
| 176 property_cell_space_->Capacity(); | 176 property_cell_space_->Capacity(); |
| 177 } | 177 } |
| 178 | 178 |
| 179 | 179 |
| 180 intptr_t Heap::CommittedOldGenerationMemory() { |
| 181 if (!HasBeenSetUp()) return 0; |
| 182 |
| 183 return old_pointer_space_->CommittedMemory() + |
| 184 old_data_space_->CommittedMemory() + code_space_->CommittedMemory() + |
| 185 map_space_->CommittedMemory() + cell_space_->CommittedMemory() + |
| 186 property_cell_space_->CommittedMemory() + lo_space_->Size(); |
| 187 } |
| 188 |
| 189 |
| 180 intptr_t Heap::CommittedMemory() { | 190 intptr_t Heap::CommittedMemory() { |
| 181 if (!HasBeenSetUp()) return 0; | 191 if (!HasBeenSetUp()) return 0; |
| 182 | 192 |
| 183 return new_space_.CommittedMemory() + old_pointer_space_->CommittedMemory() + | 193 return new_space_.CommittedMemory() + CommittedOldGenerationMemory(); |
| 184 old_data_space_->CommittedMemory() + code_space_->CommittedMemory() + | |
| 185 map_space_->CommittedMemory() + cell_space_->CommittedMemory() + | |
| 186 property_cell_space_->CommittedMemory() + lo_space_->Size(); | |
| 187 } | 194 } |
| 188 | 195 |
| 189 | 196 |
| 190 size_t Heap::CommittedPhysicalMemory() { | 197 size_t Heap::CommittedPhysicalMemory() { |
| 191 if (!HasBeenSetUp()) return 0; | 198 if (!HasBeenSetUp()) return 0; |
| 192 | 199 |
| 193 return new_space_.CommittedPhysicalMemory() + | 200 return new_space_.CommittedPhysicalMemory() + |
| 194 old_pointer_space_->CommittedPhysicalMemory() + | 201 old_pointer_space_->CommittedPhysicalMemory() + |
| 195 old_data_space_->CommittedPhysicalMemory() + | 202 old_data_space_->CommittedPhysicalMemory() + |
| 196 code_space_->CommittedPhysicalMemory() + | 203 code_space_->CommittedPhysicalMemory() + |
| (...skipping 6327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6524 static_cast<int>(object_sizes_last_time_[index])); | 6531 static_cast<int>(object_sizes_last_time_[index])); |
| 6525 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) | 6532 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) |
| 6526 #undef ADJUST_LAST_TIME_OBJECT_COUNT | 6533 #undef ADJUST_LAST_TIME_OBJECT_COUNT |
| 6527 | 6534 |
| 6528 MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); | 6535 MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); |
| 6529 MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); | 6536 MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); |
| 6530 ClearObjectStats(); | 6537 ClearObjectStats(); |
| 6531 } | 6538 } |
| 6532 } | 6539 } |
| 6533 } // namespace v8::internal | 6540 } // namespace v8::internal |
| OLD | NEW |