Commit e82b4cdc authored by hpayer@chromium.org's avatar hpayer@chromium.org

Add flag to set minimum semi-space size.

BUG=
R=mstarzinger@chromium.org

Review URL: https://codereview.chromium.org/279513003

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@21220 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 2c3ba958
......@@ -463,6 +463,9 @@ DEFINE_bool(always_inline_smi_code, false,
"always inline smi code in non-opt code")
// heap.cc
DEFINE_int(min_semi_space_size, 0,
"min size of a semi-space (in MBytes), the new space consists of two"
"semi-spaces")
DEFINE_int(max_semi_space_size, 0,
"max size of a semi-space (in MBytes), the new space consists of two"
"semi-spaces")
......
......@@ -5018,7 +5018,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);
}
}
......@@ -5038,6 +5038,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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment