From 583198eb0f28b1164583e94723be581612d2fef3 Mon Sep 17 00:00:00 2001 From: "ager@chromium.org" Date: Mon, 15 Nov 2010 10:12:01 +0000 Subject: [PATCH] Landing for dsule@codeaurora.org. Allow build-time customization of the max semispace size. Building a version of V8 with snapshots and with a non-default max semi-space size is much easier when you can set the max semispace size in the build environment. Review URL: http://codereview.chromium.org/4937001 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5823 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/heap.cc | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/heap.cc b/src/heap.cc index 134f40e..02635ad 100644 --- a/src/heap.cc +++ b/src/heap.cc @@ -79,25 +79,34 @@ int Heap::amount_of_external_allocated_memory_at_last_global_gc_ = 0; // semispace_size_ should be a power of 2 and old_generation_size_ should be // a multiple of Page::kPageSize. #if defined(ANDROID) -int Heap::max_semispace_size_ = 2*MB; +static const int default_max_semispace_size_ = 2*MB; intptr_t Heap::max_old_generation_size_ = 192*MB; int Heap::initial_semispace_size_ = 128*KB; intptr_t Heap::code_range_size_ = 0; intptr_t Heap::max_executable_size_ = max_old_generation_size_; #elif defined(V8_TARGET_ARCH_X64) -int Heap::max_semispace_size_ = 16*MB; +static const int default_max_semispace_size_ = 16*MB; intptr_t Heap::max_old_generation_size_ = 1*GB; int Heap::initial_semispace_size_ = 1*MB; intptr_t Heap::code_range_size_ = 512*MB; intptr_t Heap::max_executable_size_ = 256*MB; #else -int Heap::max_semispace_size_ = 8*MB; +static const int default_max_semispace_size_ = 8*MB; intptr_t Heap::max_old_generation_size_ = 512*MB; int Heap::initial_semispace_size_ = 512*KB; intptr_t Heap::code_range_size_ = 0; intptr_t Heap::max_executable_size_ = 128*MB; #endif +// Allow build-time customization of the max semispace size. Building +// V8 with snapshots and a non-default max semispace size is much +// easier if you can define it as part of the build environment. +#if defined(V8_MAX_SEMISPACE_SIZE) +int Heap::max_semispace_size_ = V8_MAX_SEMISPACE_SIZE; +#else +int Heap::max_semispace_size_ = default_max_semispace_size_; +#endif + // The snapshot semispace size will be the default semispace size if // snapshotting is used and will be the requested semispace size as // set up by ConfigureHeap otherwise. -- 2.7.4