When maximum space size flags are set, overwrite the resource constraints.
authorhpayer@chromium.org <hpayer@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Wed, 30 Apr 2014 18:13:24 +0000 (18:13 +0000)
committerhpayer@chromium.org <hpayer@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Wed, 30 Apr 2014 18:13:24 +0000 (18:13 +0000)
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

src/heap.cc

index ab12a64..1b8fe39 100644 (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;