| 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 5344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5355 if (amount_of_external_allocated_memory_ <= | 5355 if (amount_of_external_allocated_memory_ <= |
| 5356 amount_of_external_allocated_memory_at_last_global_gc_) | 5356 amount_of_external_allocated_memory_at_last_global_gc_) |
| 5357 return 0; | 5357 return 0; |
| 5358 return amount_of_external_allocated_memory_ - | 5358 return amount_of_external_allocated_memory_ - |
| 5359 amount_of_external_allocated_memory_at_last_global_gc_; | 5359 amount_of_external_allocated_memory_at_last_global_gc_; |
| 5360 } | 5360 } |
| 5361 | 5361 |
| 5362 | 5362 |
| 5363 intptr_t Heap::OldGenerationAllocationLimit(intptr_t old_gen_size, | 5363 intptr_t Heap::OldGenerationAllocationLimit(intptr_t old_gen_size, |
| 5364 int freed_global_handles) { | 5364 int freed_global_handles) { |
| 5365 const int kMaxHandles = 1000; | 5365 const int kMaxHandles = 50; |
| 5366 const int kMinHandles = 100; | 5366 const int kMinHandles = 10; |
| 5367 double min_factor = 1.1; | 5367 double min_factor = 1.1; |
| 5368 double max_factor = 4; | 5368 double max_factor = 4; |
| 5369 // We set the old generation growing factor to 2 to grow the heap slower on | 5369 // We set the old generation growing factor to 2 to grow the heap slower on |
| 5370 // memory-constrained devices. | 5370 // memory-constrained devices. |
| 5371 if (max_old_generation_size_ <= kMaxOldSpaceSizeMediumMemoryDevice) { | 5371 if (max_old_generation_size_ <= kMaxOldSpaceSizeMediumMemoryDevice) { |
| 5372 max_factor = 2; | 5372 max_factor = 2; |
| 5373 } | 5373 } |
| 5374 // If there are many freed global handles, then the next full GC will | 5374 // If there are many freed global handles, then the next full GC will |
| 5375 // likely collect a lot of garbage. Choose the heap growing factor | 5375 // likely collect a lot of garbage. Choose the heap growing factor |
| 5376 // depending on freed global handles. | 5376 // depending on freed global handles. |
| (...skipping 1147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6524 static_cast<int>(object_sizes_last_time_[index])); | 6524 static_cast<int>(object_sizes_last_time_[index])); |
| 6525 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) | 6525 CODE_AGE_LIST_COMPLETE(ADJUST_LAST_TIME_OBJECT_COUNT) |
| 6526 #undef ADJUST_LAST_TIME_OBJECT_COUNT | 6526 #undef ADJUST_LAST_TIME_OBJECT_COUNT |
| 6527 | 6527 |
| 6528 MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); | 6528 MemCopy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); |
| 6529 MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); | 6529 MemCopy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); |
| 6530 ClearObjectStats(); | 6530 ClearObjectStats(); |
| 6531 } | 6531 } |
| 6532 } | 6532 } |
| 6533 } // namespace v8::internal | 6533 } // namespace v8::internal |
| OLD | NEW |