From 6e4bec8f88da34b4703ef75a5b64509a5ffeccb0 Mon Sep 17 00:00:00 2001 From: "jkummerow@chromium.org" Date: Mon, 2 Sep 2013 13:36:49 +0000 Subject: [PATCH] Bump MaxRegularSpaceAllocationSize to InitialSemiSpaceSize() * 4/5 to allow allocation of large packed arrays in paged spaces. BUG=v8:2790 R=mstarzinger@chromium.org Review URL: https://codereview.chromium.org/23604023 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@16475 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/heap.cc | 6 ++++++ src/heap.h | 2 +- src/objects.h | 7 +++---- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/heap.cc b/src/heap.cc index bd0a6f9d17..8487857923 100644 --- a/src/heap.cc +++ b/src/heap.cc @@ -6716,6 +6716,12 @@ bool Heap::ConfigureHeap(int max_semispace_size, RoundUp(max_old_generation_size_, Page::kPageSize)); + // We rely on being able to allocate new arrays in paged spaces. + ASSERT(MaxRegularSpaceAllocationSize() >= + (JSArray::kSize + + FixedArray::SizeFor(JSObject::kInitialMaxFastElementArray) + + AllocationMemento::kSize)); + configured_ = true; return true; } diff --git a/src/heap.h b/src/heap.h index 3bfd6183b8..4071ef6721 100644 --- a/src/heap.h +++ b/src/heap.h @@ -523,7 +523,7 @@ class Heap { int InitialSemiSpaceSize() { return initial_semispace_size_; } intptr_t MaxOldGenerationSize() { return max_old_generation_size_; } intptr_t MaxExecutableSize() { return max_executable_size_; } - int MaxRegularSpaceAllocationSize() { return InitialSemiSpaceSize() * 3/4; } + int MaxRegularSpaceAllocationSize() { return InitialSemiSpaceSize() * 4/5; } // Returns the capacity of the heap in bytes w/o growing. Heap grows when // more spaces are needed until it reaches the limit. diff --git a/src/objects.h b/src/objects.h index bf0d240266..18acba92ac 100644 --- a/src/objects.h +++ b/src/objects.h @@ -2680,10 +2680,9 @@ class JSObject: public JSReceiver { // don't want to be wasteful with long lived objects. static const int kMaxUncheckedOldFastElementsLength = 500; - // TODO(2790): HAllocate currently always allocates fast backing stores - // in new space, where on x64 we can only fit ~98K elements. Keep this - // limit lower than that until HAllocate is made smarter. - static const int kInitialMaxFastElementArray = 95000; + // Note that Heap::MaxRegularSpaceAllocationSize() puts a limit on + // permissible values (see the ASSERT in heap.cc). + static const int kInitialMaxFastElementArray = 100000; static const int kFastPropertiesSoftLimit = 12; static const int kMaxFastProperties = 64;