Reviewers: Hannes Payer,

Description:
Introduce a flag to change the new space growth factor

A useful value would be 4, so we get 1, 4, 16MB (instead of the default
value 2 which leads to 1, 2, 4, 8, 16)

BUG=none
[email protected]
LOG=n

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

Base URL: https://chromium.googlesource.com/v8/v8.git@master

Affected files (+7, -1 lines):
  M src/flag-definitions.h
  M src/heap/heap.cc
  M src/heap/spaces.cc


Index: src/flag-definitions.h
diff --git a/src/flag-definitions.h b/src/flag-definitions.h
index 0d7363e8f52828e32617ba7f382325771226df7e..2394f4400c1b7234788c07c6139db5bf79c710c8 100644
--- a/src/flag-definitions.h
+++ b/src/flag-definitions.h
@@ -529,6 +529,7 @@ DEFINE_INT(target_semi_space_size, 0,
 DEFINE_INT(max_semi_space_size, 0,
"max size of a semi-space (in MBytes), the new space consists of two"
            "semi-spaces")
+DEFINE_INT(semi_space_growth_factor, 2, "factor by which to grow the new space")
 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/heap.cc
diff --git a/src/heap/heap.cc b/src/heap/heap.cc
index 9785be0b91d59785a5b38a6da7ac38006ed8bfa2..1c0eccaf68cf28b1e26a98bc5ab16e91fbb160fe 100644
--- a/src/heap/heap.cc
+++ b/src/heap/heap.cc
@@ -5059,6 +5059,10 @@ bool Heap::ConfigureHeap(int max_semi_space_size, int max_old_space_size,

target_semispace_size_ = Max(initial_semispace_size_, target_semispace_size_);

+  if (FLAG_semi_space_growth_factor < 2) {
+    FLAG_semi_space_growth_factor = 2;
+  }
+
// 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_ =
Index: src/heap/spaces.cc
diff --git a/src/heap/spaces.cc b/src/heap/spaces.cc
index 51a0ef68e0fb72b18d671e20fddc57451f81b805..554b71706df22cb2255809cd2293b56a7ab31848 100644
--- a/src/heap/spaces.cc
+++ b/src/heap/spaces.cc
@@ -1313,7 +1313,8 @@ void NewSpace::Grow() {
   // Double the semispace size but only up to maximum capacity.
   DCHECK(TotalCapacity() < MaximumCapacity());
   int new_capacity =
-      Min(MaximumCapacity(), 2 * static_cast<int>(TotalCapacity()));
+      Min(MaximumCapacity(),
+ FLAG_semi_space_growth_factor * static_cast<int>(TotalCapacity()));
   if (to_space_.GrowTo(new_capacity)) {
     // Only grow from space if we managed to grow to-space.
     if (!from_space_.GrowTo(new_capacity)) {


--
--
v8-dev mailing list
[email protected]
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to