From de21c8a245915e3313eab009ba17fa749e78f4ce Mon Sep 17 00:00:00 2001 From: "hpayer@chromium.org" Date: Fri, 9 May 2014 08:38:27 +0000 Subject: [PATCH] Simplify ConfigureHeap and change --max_new_space_size to --max_semi_space_size. BUG= R=mstarzinger@chromium.org Review URL: https://codereview.chromium.org/271843005 git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@21204 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- include/v8.h | 6 +- src/api.cc | 20 +++--- src/flag-definitions.h | 6 +- src/heap.cc | 79 +++++++++++------------- src/heap.h | 56 ++++++++++------- src/spaces.h | 2 +- src/v8.cc | 2 +- test/cctest/test-api.cc | 5 +- test/cctest/test-heap.cc | 20 +++--- test/cctest/test-mark-compact.cc | 4 +- test/cctest/test-strings.cc | 5 +- test/mjsunit/binary-op-newspace.js | 2 +- test/mjsunit/compiler/math-floor-global.js | 2 +- test/mjsunit/compiler/math-floor-local.js | 2 +- test/mjsunit/define-property-gc.js | 2 +- test/mjsunit/math-abs.js | 2 +- test/mjsunit/math-floor-part1.js | 2 +- test/mjsunit/math-floor-part2.js | 2 +- test/mjsunit/math-floor-part3.js | 2 +- test/mjsunit/math-floor-part4.js | 2 +- test/mjsunit/regress/regress-1708.js | 2 +- test/mjsunit/regress/regress-99167.js | 2 +- test/mjsunit/regress/regress-create-exception.js | 2 +- 23 files changed, 116 insertions(+), 113 deletions(-) diff --git a/include/v8.h b/include/v8.h index d39dca9..af8f991 100644 --- a/include/v8.h +++ b/include/v8.h @@ -3865,8 +3865,8 @@ class V8_EXPORT ResourceConstraints { uint64_t virtual_memory_limit, uint32_t number_of_processors); - int max_new_space_size() const { return max_new_space_size_; } - void set_max_new_space_size(int value) { max_new_space_size_ = value; } + int max_semi_space_size() const { return max_semi_space_size_; } + void set_max_semi_space_size(int value) { max_semi_space_size_ = value; } int max_old_space_size() const { return max_old_space_size_; } void set_max_old_space_size(int value) { max_old_space_size_ = value; } int max_executable_size() const { return max_executable_size_; } @@ -3885,7 +3885,7 @@ class V8_EXPORT ResourceConstraints { } private: - int max_new_space_size_; + int max_semi_space_size_; int max_old_space_size_; int max_executable_size_; uint32_t* stack_limit_; diff --git a/src/api.cc b/src/api.cc index 8a99c27..ea59845 100644 --- a/src/api.cc +++ b/src/api.cc @@ -419,7 +419,7 @@ Extension::Extension(const char* name, ResourceConstraints::ResourceConstraints() - : max_new_space_size_(0), + : max_semi_space_size_(0), max_old_space_size_(0), max_executable_size_(0), stack_limit_(NULL), @@ -442,19 +442,19 @@ void ResourceConstraints::ConfigureDefaults(uint64_t physical_memory, #endif if (physical_memory <= low_limit) { - set_max_new_space_size(i::Heap::kMaxNewSpaceSizeLowMemoryDevice); + set_max_semi_space_size(i::Heap::kMaxSemiSpaceSizeLowMemoryDevice); set_max_old_space_size(i::Heap::kMaxOldSpaceSizeLowMemoryDevice); set_max_executable_size(i::Heap::kMaxExecutableSizeLowMemoryDevice); } else if (physical_memory <= medium_limit) { - set_max_new_space_size(i::Heap::kMaxNewSpaceSizeMediumMemoryDevice); + set_max_semi_space_size(i::Heap::kMaxSemiSpaceSizeMediumMemoryDevice); set_max_old_space_size(i::Heap::kMaxOldSpaceSizeMediumMemoryDevice); set_max_executable_size(i::Heap::kMaxExecutableSizeMediumMemoryDevice); } else if (physical_memory <= high_limit) { - set_max_new_space_size(i::Heap::kMaxNewSpaceSizeHighMemoryDevice); + set_max_semi_space_size(i::Heap::kMaxSemiSpaceSizeHighMemoryDevice); set_max_old_space_size(i::Heap::kMaxOldSpaceSizeHighMemoryDevice); set_max_executable_size(i::Heap::kMaxExecutableSizeHighMemoryDevice); } else { - set_max_new_space_size(i::Heap::kMaxNewSpaceSizeHugeMemoryDevice); + set_max_semi_space_size(i::Heap::kMaxSemiSpaceSizeHugeMemoryDevice); set_max_old_space_size(i::Heap::kMaxOldSpaceSizeHugeMemoryDevice); set_max_executable_size(i::Heap::kMaxExecutableSizeHugeMemoryDevice); } @@ -465,7 +465,7 @@ void ResourceConstraints::ConfigureDefaults(uint64_t physical_memory, // Reserve no more than 1/8 of the memory for the code range, but at most // 512 MB. set_code_range_size( - i::Min(512 * i::MB, static_cast(virtual_memory_limit >> 3))); + i::Min(512, static_cast((virtual_memory_limit >> 3) / i::MB))); } } @@ -473,15 +473,15 @@ void ResourceConstraints::ConfigureDefaults(uint64_t physical_memory, bool SetResourceConstraints(Isolate* v8_isolate, ResourceConstraints* constraints) { i::Isolate* isolate = reinterpret_cast(v8_isolate); - int new_space_size = constraints->max_new_space_size(); + int semi_space_size = constraints->max_semi_space_size(); int old_space_size = constraints->max_old_space_size(); int max_executable_size = constraints->max_executable_size(); int code_range_size = constraints->code_range_size(); - if (new_space_size != 0 || old_space_size != 0 || max_executable_size != 0 || - code_range_size != 0) { + if (semi_space_size != 0 || old_space_size != 0 || + max_executable_size != 0 || code_range_size != 0) { // After initialization it's too late to change Heap constraints. ASSERT(!isolate->IsInitialized()); - bool result = isolate->heap()->ConfigureHeap(new_space_size / 2, + bool result = isolate->heap()->ConfigureHeap(semi_space_size, old_space_size, max_executable_size, code_range_size); diff --git a/src/flag-definitions.h b/src/flag-definitions.h index 30cbcd7..87d4242 100644 --- a/src/flag-definitions.h +++ b/src/flag-definitions.h @@ -463,9 +463,9 @@ DEFINE_bool(always_inline_smi_code, false, "always inline smi code in non-opt code") // heap.cc -DEFINE_int(max_new_space_size, 0, - "max size of the new space consisting of two semi-spaces which are half" - "the size (in MBytes)") +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(max_old_space_size, 0, "max size of the old space (in Mbytes)") DEFINE_int(max_executable_size, 0, "max size of executable memory (in Mbytes)") DEFINE_bool(gc_global, false, "always perform global GCs") diff --git a/src/heap.cc b/src/heap.cc index 13771e6..18103c3 100644 --- a/src/heap.cc +++ b/src/heap.cc @@ -49,7 +49,7 @@ Heap::Heap() // semispace_size_ should be a power of 2 and old_generation_size_ should be // a multiple of Page::kPageSize. reserved_semispace_size_(8 * (kPointerSize / 4) * MB), - max_semispace_size_(8 * (kPointerSize / 4) * MB), + max_semi_space_size_(8 * (kPointerSize / 4) * MB), initial_semispace_size_(Page::kPageSize), max_old_generation_size_(700ul * (kPointerSize / 4) * MB), max_executable_size_(256ul * (kPointerSize / 4) * MB), @@ -137,7 +137,7 @@ Heap::Heap() // 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) - max_semispace_size_ = reserved_semispace_size_ = V8_MAX_SEMISPACE_SIZE; + max_semi_space_size_ = reserved_semispace_size_ = V8_MAX_SEMISPACE_SIZE; #endif // Ensure old_generation_size_ is a multiple of kPageSize. @@ -3090,7 +3090,7 @@ int Heap::FullSizeNumberStringCacheLength() { // Compute the size of the number string cache based on the max newspace size. // The number string cache has a minimum size based on twice the initial cache // size to ensure that it is bigger after being made 'full size'. - int number_string_cache_size = max_semispace_size_ / 512; + int number_string_cache_size = max_semi_space_size_ / 512; number_string_cache_size = Max(kInitialNumberStringCacheSize * 2, Min(0x4000, number_string_cache_size)); // There is a string and a number per entry so the length is twice the number @@ -4979,37 +4979,37 @@ void Heap::IterateStrongRoots(ObjectVisitor* v, VisitMode mode) { // TODO(1236194): Since the heap size is configurable on the command line // and through the API, we should gracefully handle the case that the heap // size is not big enough to fit all the initial objects. -bool Heap::ConfigureHeap(int max_semispace_size, - intptr_t max_old_space_size, - intptr_t max_executable_size, - intptr_t code_range_size) { +bool Heap::ConfigureHeap(int max_semi_space_size, + int max_old_space_size, + int max_executable_size, + int code_range_size) { if (HasBeenSetUp()) return false; + // Overwrite default configuration. + if (max_semi_space_size > 0) { + max_semi_space_size_ = max_semi_space_size * MB; + } + if (max_old_space_size > 0) { + max_old_generation_size_ = max_old_space_size * MB; + } + if (max_executable_size > 0) { + max_executable_size_ = max_executable_size * MB; + } + // 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 / 2) * kLumpOfMemory; + if (FLAG_max_semi_space_size > 0) { + max_semi_space_size_ = FLAG_max_semi_space_size * MB; } if (FLAG_max_old_space_size > 0) { - max_old_space_size = FLAG_max_old_space_size * kLumpOfMemory; + max_old_generation_size_ = FLAG_max_old_space_size * MB; } if (FLAG_max_executable_size > 0) { - max_executable_size = FLAG_max_executable_size * kLumpOfMemory; + max_executable_size_ = FLAG_max_executable_size * MB; } if (FLAG_stress_compaction) { // This will cause more frequent GCs when stressing. - max_semispace_size_ = Page::kPageSize; - } - - if (max_semispace_size > 0) { - if (max_semispace_size < Page::kPageSize) { - max_semispace_size = Page::kPageSize; - if (FLAG_trace_gc) { - PrintPID("Max semispace size cannot be less than %dkbytes\n", - Page::kPageSize >> 10); - } - } - max_semispace_size_ = max_semispace_size; + max_semi_space_size_ = Page::kPageSize; } if (Snapshot::IsEnabled()) { @@ -5018,8 +5018,8 @@ bool Heap::ConfigureHeap(int max_semispace_size, // write-barrier code that relies on the size and alignment of new // space. We therefore cannot use a larger max semispace size // than the default reserved semispace size. - if (max_semispace_size_ > reserved_semispace_size_) { - max_semispace_size_ = reserved_semispace_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", reserved_semispace_size_ >> 10); @@ -5028,12 +5028,7 @@ bool Heap::ConfigureHeap(int max_semispace_size, } else { // If we are not using snapshots we reserve space for the actual // max semispace size. - reserved_semispace_size_ = max_semispace_size_; - } - - if (max_old_space_size > 0) max_old_generation_size_ = max_old_space_size; - if (max_executable_size > 0) { - max_executable_size_ = RoundUp(max_executable_size, Page::kPageSize); + reserved_semispace_size_ = max_semi_space_size_; } // The max executable size must be less than or equal to the max old @@ -5044,22 +5039,21 @@ bool Heap::ConfigureHeap(int max_semispace_size, // The new space size must be a power of two to support single-bit testing // for containment. - max_semispace_size_ = RoundUpToPowerOf2(max_semispace_size_); + max_semi_space_size_ = RoundUpToPowerOf2(max_semi_space_size_); reserved_semispace_size_ = RoundUpToPowerOf2(reserved_semispace_size_); - initial_semispace_size_ = Min(initial_semispace_size_, max_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 // to avoid unnecessary low memory notifications, as that is the threshold // for some embedders. - external_allocation_limit_ = 12 * max_semispace_size_; + external_allocation_limit_ = 12 * max_semi_space_size_; ASSERT(external_allocation_limit_ <= 256 * MB); // The old generation is paged and needs at least one page for each space. int paged_space_count = LAST_PAGED_SPACE - FIRST_PAGED_SPACE + 1; - max_old_generation_size_ = Max(static_cast(paged_space_count * - Page::kPageSize), - RoundUp(max_old_generation_size_, - Page::kPageSize)); + max_old_generation_size_ = + Max(static_cast(paged_space_count * Page::kPageSize), + max_old_generation_size_); // We rely on being able to allocate new arrays in paged spaces. ASSERT(Page::kMaxRegularHeapObjectSize >= @@ -5067,7 +5061,7 @@ bool Heap::ConfigureHeap(int max_semispace_size, FixedArray::SizeFor(JSObject::kInitialMaxFastElementArray) + AllocationMemento::kSize)); - code_range_size_ = code_range_size; + code_range_size_ = code_range_size * MB; // We set the old generation growing factor to 2 to grow the heap slower on // memory-constrained devices. @@ -5081,10 +5075,7 @@ bool Heap::ConfigureHeap(int max_semispace_size, bool Heap::ConfigureHeapDefault() { - return ConfigureHeap(static_cast(FLAG_max_new_space_size / 2) * KB, - static_cast(FLAG_max_old_space_size) * MB, - static_cast(FLAG_max_executable_size) * MB, - static_cast(0)); + return ConfigureHeap(0, 0, 0, 0); } @@ -5207,7 +5198,7 @@ bool Heap::SetUp() { return false; // Set up new space. - if (!new_space_.SetUp(reserved_semispace_size_, max_semispace_size_)) { + if (!new_space_.SetUp(reserved_semispace_size_, max_semi_space_size_)) { return false; } diff --git a/src/heap.h b/src/heap.h index 9c100fc..38e7a9f 100644 --- a/src/heap.h +++ b/src/heap.h @@ -546,12 +546,12 @@ enum ArrayStorageAllocationMode { class Heap { public: - // Configure heap size before setup. Return false if the heap has been + // Configure heap size in MB before setup. Return false if the heap has been // set up already. - bool ConfigureHeap(int max_semispace_size, - intptr_t max_old_space_size, - intptr_t max_executable_size, - intptr_t code_range_size); + bool ConfigureHeap(int max_semi_space_size, + int max_old_space_size, + int max_executable_size, + int code_range_size); bool ConfigureHeapDefault(); // Prepares the heap, setting up memory areas that are needed in the isolate @@ -581,7 +581,7 @@ class Heap { intptr_t MaxReserved() { return 4 * reserved_semispace_size_ + max_old_generation_size_; } - int MaxSemiSpaceSize() { return max_semispace_size_; } + int MaxSemiSpaceSize() { return max_semi_space_size_; } int ReservedSemiSpaceSize() { return reserved_semispace_size_; } int InitialSemiSpaceSize() { return initial_semispace_size_; } intptr_t MaxOldGenerationSize() { return max_old_generation_size_; } @@ -1072,25 +1072,39 @@ class Heap { static const intptr_t kMinimumOldGenerationAllocationLimit = 8 * (Page::kPageSize > MB ? Page::kPageSize : MB); - static const int kLumpOfMemory = (i::kPointerSize / 4) * i::MB; + static const int kPointerMultiplier = i::kPointerSize / 4; - // The new space size has to be a power of 2. - static const int kMaxNewSpaceSizeLowMemoryDevice = 2 * kLumpOfMemory; - static const int kMaxNewSpaceSizeMediumMemoryDevice = 8 * kLumpOfMemory; - static const int kMaxNewSpaceSizeHighMemoryDevice = 16 * kLumpOfMemory; - static const int kMaxNewSpaceSizeHugeMemoryDevice = 16 * kLumpOfMemory; + // The new space size has to be a power of 2. Sizes are in MB. + static const int kMaxSemiSpaceSizeLowMemoryDevice = + 1 * kPointerMultiplier; + static const int kMaxSemiSpaceSizeMediumMemoryDevice = + 4 * kPointerMultiplier; + static const int kMaxSemiSpaceSizeHighMemoryDevice = + 8 * kPointerMultiplier; + static const int kMaxSemiSpaceSizeHugeMemoryDevice = + 8 * kPointerMultiplier; // The old space size has to be a multiple of Page::kPageSize. - static const int kMaxOldSpaceSizeLowMemoryDevice = 128 * kLumpOfMemory; - static const int kMaxOldSpaceSizeMediumMemoryDevice = 256 * kLumpOfMemory; - static const int kMaxOldSpaceSizeHighMemoryDevice = 512 * kLumpOfMemory; - static const int kMaxOldSpaceSizeHugeMemoryDevice = 700 * kLumpOfMemory; + // Sizes are in MB. + static const int kMaxOldSpaceSizeLowMemoryDevice = + 128 * kPointerMultiplier; + static const int kMaxOldSpaceSizeMediumMemoryDevice = + 256 * kPointerMultiplier; + static const int kMaxOldSpaceSizeHighMemoryDevice = + 512 * kPointerMultiplier; + static const int kMaxOldSpaceSizeHugeMemoryDevice = + 700 * kPointerMultiplier; // The executable size has to be a multiple of Page::kPageSize. - static const int kMaxExecutableSizeLowMemoryDevice = 128 * kLumpOfMemory; - static const int kMaxExecutableSizeMediumMemoryDevice = 256 * kLumpOfMemory; - static const int kMaxExecutableSizeHighMemoryDevice = 512 * kLumpOfMemory; - static const int kMaxExecutableSizeHugeMemoryDevice = 700 * kLumpOfMemory; + // Sizes are in MB. + static const int kMaxExecutableSizeLowMemoryDevice = + 128 * kPointerMultiplier; + static const int kMaxExecutableSizeMediumMemoryDevice = + 256 * kPointerMultiplier; + static const int kMaxExecutableSizeHighMemoryDevice = + 512 * kPointerMultiplier; + static const int kMaxExecutableSizeHugeMemoryDevice = + 700 * kPointerMultiplier; intptr_t OldGenerationAllocationLimit(intptr_t old_gen_size) { intptr_t limit = FLAG_stress_compaction @@ -1489,7 +1503,7 @@ class Heap { intptr_t code_range_size_; int reserved_semispace_size_; - int max_semispace_size_; + int max_semi_space_size_; int initial_semispace_size_; intptr_t max_old_generation_size_; intptr_t max_executable_size_; diff --git a/src/spaces.h b/src/spaces.h index 735f1fb..336feb0 100644 --- a/src/spaces.h +++ b/src/spaces.h @@ -2417,7 +2417,7 @@ class NewSpace : public Space { inline_allocation_limit_step_(0) {} // Sets up the new space using the given chunk. - bool SetUp(int reserved_semispace_size_, int max_semispace_size); + bool SetUp(int reserved_semispace_size_, int max_semi_space_size); // Tears down the space. Heap memory was not allocated by the space, so it // is not deallocated here. diff --git a/src/v8.cc b/src/v8.cc index f8156ec..50d9184 100644 --- a/src/v8.cc +++ b/src/v8.cc @@ -99,7 +99,7 @@ void V8::InitializeOncePerProcessImpl() { if (FLAG_stress_compaction) { FLAG_force_marking_deque_overflows = true; FLAG_gc_global = true; - FLAG_max_new_space_size = 2 * Page::kPageSize; + FLAG_max_semi_space_size = 1; } #ifdef V8_USE_DEFAULT_PLATFORM diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc index d8fa648..8d1faeb 100644 --- a/test/cctest/test-api.cc +++ b/test/cctest/test-api.cc @@ -19534,10 +19534,9 @@ class InitDefaultIsolateThread : public v8::internal::Thread { isolate->Enter(); switch (testCase_) { case SetResourceConstraints: { - static const int K = 1024; v8::ResourceConstraints constraints; - constraints.set_max_new_space_size(2 * K * K); - constraints.set_max_old_space_size(4 * K * K); + constraints.set_max_semi_space_size(1); + constraints.set_max_old_space_size(4); v8::SetResourceConstraints(CcTest::isolate(), &constraints); break; } diff --git a/test/cctest/test-heap.cc b/test/cctest/test-heap.cc index 913d80a..ee9343a 100644 --- a/test/cctest/test-heap.cc +++ b/test/cctest/test-heap.cc @@ -2208,7 +2208,7 @@ TEST(OptimizedAllocationAlwaysInNewSpace) { TEST(OptimizedPretenuringAllocationFolding) { i::FLAG_allow_natives_syntax = true; - i::FLAG_max_new_space_size = 2; + i::FLAG_max_semi_space_size = 1; i::FLAG_allocation_site_pretenuring = false; CcTest::InitializeVM(); if (!CcTest::i_isolate()->use_crankshaft() || i::FLAG_always_opt) return; @@ -2251,7 +2251,7 @@ TEST(OptimizedPretenuringAllocationFolding) { TEST(OptimizedPretenuringAllocationFoldingBlocks) { i::FLAG_allow_natives_syntax = true; - i::FLAG_max_new_space_size = 2; + i::FLAG_max_semi_space_size = 1; i::FLAG_allocation_site_pretenuring = false; CcTest::InitializeVM(); if (!CcTest::i_isolate()->use_crankshaft() || i::FLAG_always_opt) return; @@ -2294,7 +2294,7 @@ TEST(OptimizedPretenuringAllocationFoldingBlocks) { TEST(OptimizedPretenuringObjectArrayLiterals) { i::FLAG_allow_natives_syntax = true; - i::FLAG_max_new_space_size = 2; + i::FLAG_max_semi_space_size = 1; CcTest::InitializeVM(); if (!CcTest::i_isolate()->use_crankshaft() || i::FLAG_always_opt) return; if (i::FLAG_gc_global || i::FLAG_stress_compaction) return; @@ -2323,7 +2323,7 @@ TEST(OptimizedPretenuringObjectArrayLiterals) { TEST(OptimizedPretenuringMixedInObjectProperties) { i::FLAG_allow_natives_syntax = true; - i::FLAG_max_new_space_size = 2; + i::FLAG_max_semi_space_size = 1; CcTest::InitializeVM(); if (!CcTest::i_isolate()->use_crankshaft() || i::FLAG_always_opt) return; if (i::FLAG_gc_global || i::FLAG_stress_compaction) return; @@ -2358,7 +2358,7 @@ TEST(OptimizedPretenuringMixedInObjectProperties) { TEST(OptimizedPretenuringDoubleArrayProperties) { i::FLAG_allow_natives_syntax = true; - i::FLAG_max_new_space_size = 2; + i::FLAG_max_semi_space_size = 1; CcTest::InitializeVM(); if (!CcTest::i_isolate()->use_crankshaft() || i::FLAG_always_opt) return; if (i::FLAG_gc_global || i::FLAG_stress_compaction) return; @@ -2387,7 +2387,7 @@ TEST(OptimizedPretenuringDoubleArrayProperties) { TEST(OptimizedPretenuringdoubleArrayLiterals) { i::FLAG_allow_natives_syntax = true; - i::FLAG_max_new_space_size = 2; + i::FLAG_max_semi_space_size = 1; CcTest::InitializeVM(); if (!CcTest::i_isolate()->use_crankshaft() || i::FLAG_always_opt) return; if (i::FLAG_gc_global || i::FLAG_stress_compaction) return; @@ -2416,7 +2416,7 @@ TEST(OptimizedPretenuringdoubleArrayLiterals) { TEST(OptimizedPretenuringNestedMixedArrayLiterals) { i::FLAG_allow_natives_syntax = true; - i::FLAG_max_new_space_size = 2; + i::FLAG_max_semi_space_size = 1; CcTest::InitializeVM(); if (!CcTest::i_isolate()->use_crankshaft() || i::FLAG_always_opt) return; if (i::FLAG_gc_global || i::FLAG_stress_compaction) return; @@ -2454,7 +2454,7 @@ TEST(OptimizedPretenuringNestedMixedArrayLiterals) { TEST(OptimizedPretenuringNestedObjectLiterals) { i::FLAG_allow_natives_syntax = true; - i::FLAG_max_new_space_size = 2; + i::FLAG_max_semi_space_size = 1; CcTest::InitializeVM(); if (!CcTest::i_isolate()->use_crankshaft() || i::FLAG_always_opt) return; if (i::FLAG_gc_global || i::FLAG_stress_compaction) return; @@ -2492,7 +2492,7 @@ TEST(OptimizedPretenuringNestedObjectLiterals) { TEST(OptimizedPretenuringNestedDoubleLiterals) { i::FLAG_allow_natives_syntax = true; - i::FLAG_max_new_space_size = 2; + i::FLAG_max_semi_space_size = 1; CcTest::InitializeVM(); if (!CcTest::i_isolate()->use_crankshaft() || i::FLAG_always_opt) return; if (i::FLAG_gc_global || i::FLAG_stress_compaction) return; @@ -2538,7 +2538,7 @@ TEST(OptimizedPretenuringConstructorCalls) { return; } i::FLAG_allow_natives_syntax = true; - i::FLAG_max_new_space_size = 2; + i::FLAG_max_semi_space_size = 1; CcTest::InitializeVM(); if (!CcTest::i_isolate()->use_crankshaft() || i::FLAG_always_opt) return; if (i::FLAG_gc_global || i::FLAG_stress_compaction) return; diff --git a/test/cctest/test-mark-compact.cc b/test/cctest/test-mark-compact.cc index 5f13bd2..c7f5bc6 100644 --- a/test/cctest/test-mark-compact.cc +++ b/test/cctest/test-mark-compact.cc @@ -77,7 +77,7 @@ TEST(MarkingDeque) { TEST(Promotion) { CcTest::InitializeVM(); TestHeap* heap = CcTest::test_heap(); - heap->ConfigureHeap(2*256*KB, 1*MB, 1*MB, 0); + heap->ConfigureHeap(1, 1, 1, 0); v8::HandleScope sc(CcTest::isolate()); @@ -102,7 +102,7 @@ TEST(Promotion) { TEST(NoPromotion) { CcTest::InitializeVM(); TestHeap* heap = CcTest::test_heap(); - heap->ConfigureHeap(2*256*KB, 1*MB, 1*MB, 0); + heap->ConfigureHeap(1, 1, 1, 0); v8::HandleScope sc(CcTest::isolate()); diff --git a/test/cctest/test-strings.cc b/test/cctest/test-strings.cc index 706836c..cdc4913 100644 --- a/test/cctest/test-strings.cc +++ b/test/cctest/test-strings.cc @@ -1201,10 +1201,9 @@ TEST(SliceFromSlice) { TEST(AsciiArrayJoin) { // Set heap limits. - static const int K = 1024; v8::ResourceConstraints constraints; - constraints.set_max_new_space_size(2 * K * K); - constraints.set_max_old_space_size(4 * K * K); + constraints.set_max_semi_space_size(1); + constraints.set_max_old_space_size(4); v8::SetResourceConstraints(CcTest::isolate(), &constraints); // String s is made of 2^17 = 131072 'c' characters and a is an array diff --git a/test/mjsunit/binary-op-newspace.js b/test/mjsunit/binary-op-newspace.js index dac7d24..52903f0 100644 --- a/test/mjsunit/binary-op-newspace.js +++ b/test/mjsunit/binary-op-newspace.js @@ -25,7 +25,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// Flags: --max-new-space-size=2 --noopt +// Flags: --max-semi-space-size=1 --noopt // Check that a mod where the stub code hits a failure in heap number // allocation still works. diff --git a/test/mjsunit/compiler/math-floor-global.js b/test/mjsunit/compiler/math-floor-global.js index 4a3bcb7..9ee649c 100644 --- a/test/mjsunit/compiler/math-floor-global.js +++ b/test/mjsunit/compiler/math-floor-global.js @@ -25,7 +25,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// Flags: --max-new-space-size=2 --allow-natives-syntax +// Flags: --max-semi-space-size=1 --allow-natives-syntax // Test inlining of Math.floor when assigned to a global. var flo = Math.floor; diff --git a/test/mjsunit/compiler/math-floor-local.js b/test/mjsunit/compiler/math-floor-local.js index 8424ac9..5ebe90b 100644 --- a/test/mjsunit/compiler/math-floor-local.js +++ b/test/mjsunit/compiler/math-floor-local.js @@ -25,7 +25,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// Flags: --max-new-space-size=2 --allow-natives-syntax +// Flags: --max-semi-space-size=1 --allow-natives-syntax // Test inlining of Math.floor when assigned to a local. var test_id = 0; diff --git a/test/mjsunit/define-property-gc.js b/test/mjsunit/define-property-gc.js index 573a7ed..b130b16 100644 --- a/test/mjsunit/define-property-gc.js +++ b/test/mjsunit/define-property-gc.js @@ -26,7 +26,7 @@ // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // Tests the handling of GC issues in the defineProperty method. -// Flags: --max-new-space-size=2 +// Flags: --max-semi-space-size=1 function Regular() { this[0] = 0; diff --git a/test/mjsunit/math-abs.js b/test/mjsunit/math-abs.js index 09b9c88..b90ae09 100644 --- a/test/mjsunit/math-abs.js +++ b/test/mjsunit/math-abs.js @@ -25,7 +25,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// Flags: --max-new-space-size=2 --allow-natives-syntax +// Flags: --max-semi-space-size=1 --allow-natives-syntax function zero() { var x = 0.5; diff --git a/test/mjsunit/math-floor-part1.js b/test/mjsunit/math-floor-part1.js index bae47dc..65ae3c6 100644 --- a/test/mjsunit/math-floor-part1.js +++ b/test/mjsunit/math-floor-part1.js @@ -25,7 +25,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// Flags: --max-new-space-size=2 --allow-natives-syntax +// Flags: --max-semi-space-size=1 --allow-natives-syntax var test_id = 0; diff --git a/test/mjsunit/math-floor-part2.js b/test/mjsunit/math-floor-part2.js index ad60fba..6004570 100644 --- a/test/mjsunit/math-floor-part2.js +++ b/test/mjsunit/math-floor-part2.js @@ -25,7 +25,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// Flags: --max-new-space-size=2 --allow-natives-syntax +// Flags: --max-semi-space-size=1 --allow-natives-syntax var test_id = 0; diff --git a/test/mjsunit/math-floor-part3.js b/test/mjsunit/math-floor-part3.js index a6d1c5e..9225c38 100644 --- a/test/mjsunit/math-floor-part3.js +++ b/test/mjsunit/math-floor-part3.js @@ -25,7 +25,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// Flags: --max-new-space-size=2 --allow-natives-syntax +// Flags: --max-semi-space-size=1 --allow-natives-syntax var test_id = 0; diff --git a/test/mjsunit/math-floor-part4.js b/test/mjsunit/math-floor-part4.js index 58212b4..ade36a9 100644 --- a/test/mjsunit/math-floor-part4.js +++ b/test/mjsunit/math-floor-part4.js @@ -25,7 +25,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// Flags: --max-new-space-size=2 --allow-natives-syntax +// Flags: --max-semi-space-size=1 --allow-natives-syntax var test_id = 0; diff --git a/test/mjsunit/regress/regress-1708.js b/test/mjsunit/regress/regress-1708.js index 48ee79c..ed2ddb1 100644 --- a/test/mjsunit/regress/regress-1708.js +++ b/test/mjsunit/regress/regress-1708.js @@ -32,7 +32,7 @@ // sure that concurrent sweeping, which relies on similar assumptions // as lazy sweeping works correctly. -// Flags: --expose-gc --noincremental-marking --max-new-space-size=2 +// Flags: --expose-gc --noincremental-marking --max-semi-space-size=1 (function() { var head = new Array(1); diff --git a/test/mjsunit/regress/regress-99167.js b/test/mjsunit/regress/regress-99167.js index 777acf4..eac49d1 100644 --- a/test/mjsunit/regress/regress-99167.js +++ b/test/mjsunit/regress/regress-99167.js @@ -25,7 +25,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// Flags: --expose-gc --max-new-space-size=2 +// Flags: --expose-gc --max-semi-space-size=1 eval("function Node() { this.a = 1; this.a = 3; }"); new Node; diff --git a/test/mjsunit/regress/regress-create-exception.js b/test/mjsunit/regress/regress-create-exception.js index e055304..440449c 100644 --- a/test/mjsunit/regress/regress-create-exception.js +++ b/test/mjsunit/regress/regress-create-exception.js @@ -25,7 +25,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// Flags: --max-new-space-size=2 +// Flags: --max-semi-space-size=1 "use strict"; // Check for GC bug constructing exceptions. -- 2.7.4