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 5294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5305 return amount_of_external_allocated_memory_ - | 5305 return amount_of_external_allocated_memory_ - |
5306 amount_of_external_allocated_memory_at_last_global_gc_; | 5306 amount_of_external_allocated_memory_at_last_global_gc_; |
5307 } | 5307 } |
5308 | 5308 |
5309 | 5309 |
5310 intptr_t Heap::CalculateOldGenerationAllocationLimit(double factor, | 5310 intptr_t Heap::CalculateOldGenerationAllocationLimit(double factor, |
5311 intptr_t old_gen_size) { | 5311 intptr_t old_gen_size) { |
5312 CHECK(factor > 1.0); | 5312 CHECK(factor > 1.0); |
5313 CHECK(old_gen_size > 0); | 5313 CHECK(old_gen_size > 0); |
5314 intptr_t limit = static_cast<intptr_t>(old_gen_size * factor); | 5314 intptr_t limit = static_cast<intptr_t>(old_gen_size * factor); |
5315 limit = Max(limit, kMinimumOldGenerationAllocationLimit); | 5315 limit = Max(limit, old_gen_size + kMinimumOldGenerationAllocationLimit); |
5316 limit += new_space_.Capacity(); | 5316 limit += new_space_.Capacity(); |
5317 intptr_t halfway_to_the_max = (old_gen_size + max_old_generation_size_) / 2; | 5317 intptr_t halfway_to_the_max = (old_gen_size + max_old_generation_size_) / 2; |
5318 return Min(limit, halfway_to_the_max); | 5318 return Min(limit, halfway_to_the_max); |
5319 } | 5319 } |
5320 | 5320 |
5321 | 5321 |
5322 void Heap::SetOldGenerationAllocationLimit(intptr_t old_gen_size, | 5322 void Heap::SetOldGenerationAllocationLimit(intptr_t old_gen_size, |
5323 int freed_global_handles) { | 5323 int freed_global_handles) { |
5324 const int kMaxHandles = 1000; | 5324 const int kMaxHandles = 1000; |
5325 const int kMinHandles = 100; | 5325 const int kMinHandles = 100; |
(...skipping 1261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6587 *object_type = "CODE_TYPE"; \ | 6587 *object_type = "CODE_TYPE"; \ |
6588 *object_sub_type = "CODE_AGE/" #name; \ | 6588 *object_sub_type = "CODE_AGE/" #name; \ |
6589 return true; | 6589 return true; |
6590 CODE_AGE_LIST_COMPLETE(COMPARE_AND_RETURN_NAME) | 6590 CODE_AGE_LIST_COMPLETE(COMPARE_AND_RETURN_NAME) |
6591 #undef COMPARE_AND_RETURN_NAME | 6591 #undef COMPARE_AND_RETURN_NAME |
6592 } | 6592 } |
6593 return false; | 6593 return false; |
6594 } | 6594 } |
6595 } | 6595 } |
6596 } // namespace v8::internal | 6596 } // namespace v8::internal |
OLD | NEW |