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

Unified Diff: src/heap/heap.cc

Issue 652543007: Add support for a target new space size (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: updates Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/heap/heap.h ('k') | src/heap/spaces.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/heap.cc
diff --git a/src/heap/heap.cc b/src/heap/heap.cc
index 2c7fc58a1a5d3d03d35f8aa0c8131c28bf888684..6e566c0b5ba0210c77f0dac87ea8af7aed70f000 100644
--- a/src/heap/heap.cc
+++ b/src/heap/heap.cc
@@ -61,6 +61,7 @@ Heap::Heap()
reserved_semispace_size_(8 * (kPointerSize / 4) * MB),
max_semi_space_size_(8 * (kPointerSize / 4) * MB),
initial_semispace_size_(Page::kPageSize),
+ target_semispace_size_(Page::kPageSize),
max_old_generation_size_(700ul * (kPointerSize / 4) * MB),
max_executable_size_(256ul * (kPointerSize / 4) * MB),
// Variables set based on semispace_size_ and old_generation_size_ in
@@ -4944,9 +4945,9 @@ bool Heap::ConfigureHeap(int max_semi_space_size, int max_old_space_size,
initial_semispace_size_ = max_semi_space_size_;
if (FLAG_trace_gc) {
PrintPID(
- "Min semi-space size cannot be more than the maximum"
+ "Min semi-space size cannot be more than the maximum "
"semi-space size of %d MB\n",
- max_semi_space_size_);
+ max_semi_space_size_ / MB);
}
} else {
initial_semispace_size_ = initial_semispace_size;
@@ -4955,6 +4956,31 @@ bool Heap::ConfigureHeap(int max_semi_space_size, int max_old_space_size,
initial_semispace_size_ = Min(initial_semispace_size_, max_semi_space_size_);
+ if (FLAG_target_semi_space_size > 0) {
+ int target_semispace_size = FLAG_target_semi_space_size * MB;
+ if (target_semispace_size < initial_semispace_size_) {
+ target_semispace_size_ = initial_semispace_size_;
+ if (FLAG_trace_gc) {
+ PrintPID(
+ "Target semi-space size cannot be less than the minimum "
+ "semi-space size of %d MB\n",
+ initial_semispace_size_ / MB);
+ }
+ } else if (target_semispace_size > max_semi_space_size_) {
+ target_semispace_size_ = max_semi_space_size_;
+ if (FLAG_trace_gc) {
+ PrintPID(
+ "Target semi-space size cannot be less than the maximum "
+ "semi-space size of %d MB\n",
+ max_semi_space_size_ / MB);
+ }
+ } else {
+ target_semispace_size_ = target_semispace_size;
+ }
+ }
+
+ target_semispace_size_ = Max(initial_semispace_size_, target_semispace_size_);
+
// The old generation is paged and needs at least one page for each space.
int paged_space_count = LAST_PAGED_SPACE - FIRST_PAGED_SPACE + 1;
max_old_generation_size_ =
« no previous file with comments | « src/heap/heap.h ('k') | src/heap/spaces.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698