Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9)

Side by Side Diff: src/heap/heap.cc

Issue 1148953005: Reland "Avoid excessive GCs in small heaps." (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698