When maximum space size flags are set, overwrite the resource constraints.

BUG=
R=rmcilroy@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@21102 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
hpayer@chromium.org 2014-04-30 18:13:24 +00:00
parent d8ad2dd590
commit 25e7980994

View File

@ -4986,6 +4986,17 @@ bool Heap::ConfigureHeap(int max_semispace_size,
intptr_t code_range_size) {
if (HasBeenSetUp()) return false;
// If max space size flags are specified overwrite the configuration.
if (FLAG_max_new_space_size > 0) {
max_semispace_size = FLAG_max_new_space_size * kLumpOfMemory;
}
if (FLAG_max_old_space_size > 0) {
max_old_gen_size = FLAG_max_old_space_size * kLumpOfMemory;
}
if (FLAG_max_executable_size > 0) {
max_executable_size = FLAG_max_executable_size * kLumpOfMemory;
}
if (FLAG_stress_compaction) {
// This will cause more frequent GCs when stressing.
max_semispace_size_ = Page::kPageSize;