| 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 1264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1275 | 1275 |
| 1276 HeapObjectIterator data_it(heap->old_data_space()); | 1276 HeapObjectIterator data_it(heap->old_data_space()); |
| 1277 for (HeapObject* object = data_it.Next(); object != NULL; | 1277 for (HeapObject* object = data_it.Next(); object != NULL; |
| 1278 object = data_it.Next()) | 1278 object = data_it.Next()) |
| 1279 object->Iterate(&v); | 1279 object->Iterate(&v); |
| 1280 } | 1280 } |
| 1281 #endif // VERIFY_HEAP | 1281 #endif // VERIFY_HEAP |
| 1282 | 1282 |
| 1283 | 1283 |
| 1284 void Heap::CheckNewSpaceExpansionCriteria() { | 1284 void Heap::CheckNewSpaceExpansionCriteria() { |
| 1285 if (new_space_.Capacity() < new_space_.MaximumCapacity() && | 1285 if (new_space_.TotalCapacity() < new_space_.MaximumCapacity() && |
| 1286 survived_since_last_expansion_ > new_space_.Capacity()) { | 1286 survived_since_last_expansion_ > new_space_.TotalCapacity()) { |
| 1287 // Grow the size of new space if there is room to grow, enough data | 1287 // Grow the size of new space if there is room to grow, enough data |
| 1288 // has survived scavenge since the last expansion and we are not in | 1288 // has survived scavenge since the last expansion and we are not in |
| 1289 // high promotion mode. | 1289 // high promotion mode. |
| 1290 new_space_.Grow(); | 1290 new_space_.Grow(); |
| 1291 survived_since_last_expansion_ = 0; | 1291 survived_since_last_expansion_ = 0; |
| 1292 } | 1292 } |
| 1293 } | 1293 } |
| 1294 | 1294 |
| 1295 | 1295 |
| 1296 static bool IsUnscavengedHeapObject(Heap* heap, Object** p) { | 1296 static bool IsUnscavengedHeapObject(Heap* heap, Object** p) { |
| (...skipping 4841 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6138 static_cast<int>(object_sizes_last_time_[index])); | 6138 static_cast<int>(object_sizes_last_time_[index])); |
| 6139 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) | 6139 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) |
| 6140 #undef ADJUST_LAST_TIME_OBJECT_COUNT | 6140 #undef ADJUST_LAST_TIME_OBJECT_COUNT |
| 6141 | 6141 |
| 6142 MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); | 6142 MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); |
| 6143 MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); | 6143 MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); |
| 6144 ClearObjectStats(); | 6144 ClearObjectStats(); |
| 6145 } | 6145 } |
| 6146 } | 6146 } |
| 6147 } // namespace v8::internal | 6147 } // namespace v8::internal |
| OLD | NEW |