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

Unified Diff: src/heap/heap.cc

Issue 1221433022: PPC: perf enhancement: Use larger heap page size on PPC. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 5 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/base/build_config.h ('k') | test/cctest/test-api.cc » ('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 4660a67dd2847e668ca305a780bc8e80a2482488..ab4e79048680b0d0b5b01095f1ff421b0dfea3c3 100644
--- a/src/heap/heap.cc
+++ b/src/heap/heap.cc
@@ -169,7 +169,7 @@ Heap::Heap()
#endif
// Ensure old_generation_size_ is a multiple of kPageSize.
- DCHECK(MB >= Page::kPageSize);
+ DCHECK((max_old_generation_size_ & (Page::kPageSize - 1)) == 0);
memset(roots_, 0, sizeof(roots_[0]) * kRootListLength);
set_native_contexts_list(NULL);
@@ -5354,6 +5354,13 @@ bool Heap::ConfigureHeap(int max_semi_space_size, int max_old_space_size,
max_executable_size_ = static_cast<intptr_t>(FLAG_max_executable_size) * MB;
}
+ if (Page::kPageSize > MB) {
+ max_semi_space_size_ = ROUND_UP(max_semi_space_size_, Page::kPageSize);
+ max_old_generation_size_ =
+ ROUND_UP(max_old_generation_size_, Page::kPageSize);
+ max_executable_size_ = ROUND_UP(max_executable_size_, Page::kPageSize);
+ }
+
if (FLAG_stress_compaction) {
// This will cause more frequent GCs when stressing.
max_semi_space_size_ = Page::kPageSize;
@@ -5379,12 +5386,6 @@ bool Heap::ConfigureHeap(int max_semi_space_size, int max_old_space_size,
reserved_semispace_size_ = max_semi_space_size_;
}
- // The max executable size must be less than or equal to the max old
- // generation size.
- if (max_executable_size_ > max_old_generation_size_) {
- max_executable_size_ = max_old_generation_size_;
- }
-
// The new space size must be a power of two to support single-bit testing
// for containment.
max_semi_space_size_ =
@@ -5403,7 +5404,8 @@ bool Heap::ConfigureHeap(int max_semi_space_size, int max_old_space_size,
max_semi_space_size_ / MB);
}
} else {
- initial_semispace_size_ = initial_semispace_size;
+ initial_semispace_size_ =
+ ROUND_UP(initial_semispace_size, Page::kPageSize);
}
}
@@ -5428,7 +5430,7 @@ bool Heap::ConfigureHeap(int max_semi_space_size, int max_old_space_size,
max_semi_space_size_ / MB);
}
} else {
- target_semispace_size_ = target_semispace_size;
+ target_semispace_size_ = ROUND_UP(target_semispace_size, Page::kPageSize);
}
}
@@ -5444,6 +5446,12 @@ bool Heap::ConfigureHeap(int max_semi_space_size, int max_old_space_size,
Max(static_cast<intptr_t>(paged_space_count * Page::kPageSize),
max_old_generation_size_);
+ // The max executable size must be less than or equal to the max old
+ // generation size.
+ if (max_executable_size_ > max_old_generation_size_) {
+ max_executable_size_ = max_old_generation_size_;
+ }
+
if (FLAG_initial_old_space_size > 0) {
initial_old_generation_size_ = FLAG_initial_old_space_size * MB;
} else {
« no previous file with comments | « src/base/build_config.h ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698