Reviewers: Michael Starzinger,

Message:
As discussed. PTAL.

Description:
Bump MaxRegularSpaceAllocationSize to InitialSemiSpaceSize() * 4/5

to allow allocation of large packed arrays in paged spaces.

BUG=v8:2790

Please review this at https://codereview.chromium.org/23604023/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files:
  M src/heap.h
  M src/heap.cc
  M src/objects.h


Index: src/heap.cc
diff --git a/src/heap.cc b/src/heap.cc
index d4425ea6a1bc8961e5344acdc8991094f8e66743..8674b00b656227ed6ec5acfeb3af7e92a0533c65 100644
--- a/src/heap.cc
+++ b/src/heap.cc
@@ -190,6 +190,13 @@ Heap::Heap()
   RememberUnmappedPage(NULL, false);

   ClearObjectStats(true);
+
+  // We rely on being able to allocate new arrays in paged spaces.
+  ASSERT(MaxRegularSpaceAllocationSize() >=
+         (JSArray::kSize +
+          FixedArray::kHeaderSize +
+          JSObject::kInitialMaxFastElementArray * kPointerSize +
+          AllocationMemento::kSize));
 }


Index: src/heap.h
diff --git a/src/heap.h b/src/heap.h
index 14b395f9345008e5f37ffd3345b59fb73f23ee51..8bacefc2fc34ed7483b63abfd2cde60e74687281 100644
--- a/src/heap.h
+++ b/src/heap.h
@@ -524,7 +524,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.
Index: src/objects.h
diff --git a/src/objects.h b/src/objects.h
index 657d2452a97e7aab925f66df65f54c612504c21b..4455b5f723d5f3c6c0d1dff5e8bcb0a462e7aeac 100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -2686,10 +2686,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;


--
--
v8-dev mailing list
v8-dev@googlegroups.com
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to