Reviewers: Michael Starzinger,

Description:
Add flag to set minimum semi-space size.

BUG=

Please review this at https://codereview.chromium.org/279513003/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files (+13, -0 lines):
  M src/flag-definitions.h
  M src/heap.cc


Index: src/flag-definitions.h
diff --git a/src/flag-definitions.h b/src/flag-definitions.h
index 30cbcd7bc60fbf6f2f08153fc46b093fb903b7a9..e197a87c1af677ee69291589fda5720a642c8e43 100644
--- a/src/flag-definitions.h
+++ b/src/flag-definitions.h
@@ -466,6 +466,9 @@ DEFINE_bool(always_inline_smi_code, false,
 DEFINE_int(max_new_space_size, 0,
"max size of the new space consisting of two semi-spaces which are half"
     "the size (in MBytes)")
+DEFINE_int(min_semispace_size, 0,
+    "min size of a semi-space (in MBytes), the new space consists of two"
+    "semi-spaces")
 DEFINE_int(max_old_space_size, 0, "max size of the old space (in Mbytes)")
DEFINE_int(max_executable_size, 0, "max size of executable memory (in Mbytes)")
 DEFINE_bool(gc_global, false, "always perform global GCs")
Index: src/heap.cc
diff --git a/src/heap.cc b/src/heap.cc
index 13771e613e5dc61cc6ef1163bcecf880e39c7be9..2c158fda825213c3cda515bbf21492358255ccda 100644
--- a/src/heap.cc
+++ b/src/heap.cc
@@ -5046,6 +5046,16 @@ bool Heap::ConfigureHeap(int max_semispace_size,
   // for containment.
   max_semispace_size_ = RoundUpToPowerOf2(max_semispace_size_);
   reserved_semispace_size_ = RoundUpToPowerOf2(reserved_semispace_size_);
+
+  if (FLAG_min_semispace_size > 0) {
+    int initial_semispace_size = FLAG_min_semispace_size * MB;
+    if (initial_semispace_size > max_semispace_size_) {
+      initial_semispace_size_ = max_semispace_size_;
+    } else {
+      initial_semispace_size_ = initial_semispace_size;
+    }
+  }
+
initial_semispace_size_ = Min(initial_semispace_size_, max_semispace_size_);

// The external allocation limit should be below 256 MB on all architectures


--
--
v8-dev mailing list
v8-dev@googlegroups.com
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to