summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkriti.s <kriti.s@samsung.com>2015-12-03 12:08:09 +0530
committerYoungcheol Kang <ychul.kang@samsung.com>2016-06-03 17:25:13 +0900
commit0d3da1909c2f4094b3de4880d82b2f3d5883c0d5 (patch)
tree3ffa710d59185c0d5c8e3c6f1986bfe102d32a5a
parent31a5d6937a6a0ad1864a5d8f9242066d0d558068 (diff)
downloadv8-0d3da1909c2f4094b3de4880d82b2f3d5883c0d5.tar.gz
v8-0d3da1909c2f4094b3de4880d82b2f3d5883c0d5.tar.bz2
v8-0d3da1909c2f4094b3de4880d82b2f3d5883c0d5.zip
[M40 Merge] [MEM OPT] Grow semispace by N pages
Runtime option: --js-flags="--custom-semi-space-growth=1 --grow-semi-space-by-n-pages=0" M40 patch: http://suprem.sec.samsung.net/gerrit/#/c/32705/ Below are the memory reading with and without patch for sunspider. Without patch(PSS)- 552781 WIth patch(PSS)- 535521 Change-Id: I36270bbaee2a32a7d99fef6d494b06ca1342b824 Signed-off-by: kriti.s <kriti.s@samsung.com>
-rw-r--r--src/flag-definitions.h3
-rw-r--r--src/heap/spaces.cc6
2 files changed, 9 insertions, 0 deletions
diff --git a/src/flag-definitions.h b/src/flag-definitions.h
index e4e99c388..654037c6e 100644
--- a/src/flag-definitions.h
+++ b/src/flag-definitions.h
@@ -605,6 +605,9 @@ 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(custom_semi_space_growth, 0, "Enable custom new space growth")
+DEFINE_INT(grow_semi_space_by_n_pages, 1,
+ "Number of pages by which to grow the new space")
DEFINE_INT(semi_space_growth_factor, 2, "factor by which to grow the new space")
DEFINE_BOOL(experimental_new_space_growth_heuristic, false,
"Grow the new space based on the percentage of survivors instead "
diff --git a/src/heap/spaces.cc b/src/heap/spaces.cc
index cd8a72951..f6feaec8b 100644
--- a/src/heap/spaces.cc
+++ b/src/heap/spaces.cc
@@ -1314,6 +1314,12 @@ void NewSpace::Grow() {
int new_capacity =
Min(MaximumCapacity(),
FLAG_semi_space_growth_factor * static_cast<int>(TotalCapacity()));
+ if (FLAG_custom_semi_space_growth)
+ new_capacity = static_cast<int>(TotalCapacity()) +
+ FLAG_grow_semi_space_by_n_pages * Page::kPageSize;
+ fprintf(stderr,
+ "[ V8 ] new_capacity size: %d\ntotal capacity size: %d\nMaximumCapacity size: %d\n",
+ new_capacity, static_cast<int>(TotalCapacity()), MaximumCapacity());
if (to_space_.GrowTo(new_capacity)) {
// Only grow from space if we managed to grow to-space.
if (!from_space_.GrowTo(new_capacity)) {