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

Unified Diff: src/heap.cc

Issue 279513003: Add flag to set minimum semi-space size. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/flag-definitions.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap.cc
diff --git a/src/heap.cc b/src/heap.cc
index 18103c38facadd18e084efd0945276a2489316b5..99d40fef537b403fdb0455780c61ead448e9249c 100644
--- a/src/heap.cc
+++ b/src/heap.cc
@@ -5021,7 +5021,7 @@ bool Heap::ConfigureHeap(int max_semi_space_size,
if (max_semi_space_size_ > reserved_semispace_size_) {
max_semi_space_size_ = reserved_semispace_size_;
if (FLAG_trace_gc) {
- PrintPID("Max semispace size cannot be more than %dkbytes\n",
+ PrintPID("Max semi-space size cannot be more than %d kbytes\n",
reserved_semispace_size_ >> 10);
}
}
@@ -5041,6 +5041,20 @@ bool Heap::ConfigureHeap(int max_semi_space_size,
// for containment.
max_semi_space_size_ = RoundUpToPowerOf2(max_semi_space_size_);
reserved_semispace_size_ = RoundUpToPowerOf2(reserved_semispace_size_);
+
+ if (FLAG_min_semi_space_size > 0) {
+ int initial_semispace_size = FLAG_min_semi_space_size * MB;
+ if (initial_semispace_size > max_semi_space_size_) {
+ initial_semispace_size_ = max_semi_space_size_;
+ if (FLAG_trace_gc) {
+ PrintPID("Min semi-space size cannot be more than the maximum"
+ "semi-space size of %d MB\n", max_semi_space_size_);
+ }
+ } else {
+ initial_semispace_size_ = initial_semispace_size;
+ }
+ }
+
initial_semispace_size_ = Min(initial_semispace_size_, max_semi_space_size_);
// The external allocation limit should be below 256 MB on all architectures
« no previous file with comments | « src/flag-definitions.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698