Reviewers: Vyacheslav Egorov,

Description:
We can use the array trim trick in old paged space as well as
new space.

Please review this at http://codereview.chromium.org/3143032/show

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

Affected files:
  M     src/builtins.cc


Index: src/builtins.cc
===================================================================
--- src/builtins.cc     (revision 5280)
+++ src/builtins.cc     (working copy)
@@ -306,12 +306,10 @@

 static FixedArray* LeftTrimFixedArray(FixedArray* elms, int to_trim) {
   ASSERT(elms->map() != Heap::fixed_cow_array_map());
-  // For now this trick is only applied to fixed arrays in new space.
+ // For now this trick is only applied to fixed arrays in new and paged space.
   // In large object space the object's start must coincide with chunk
   // and thus the trick is just not applicable.
-  // In old space we do not use this trick to avoid dealing with
-  // region dirty marks.
-  ASSERT(Heap::new_space()->Contains(elms));
+  ASSERT(!Heap::lo_space()->Contains(elms));

   STATIC_ASSERT(FixedArray::kMapOffset == 0);
   STATIC_ASSERT(FixedArray::kLengthOffset == kPointerSize);
@@ -497,8 +495,8 @@
     first = Heap::undefined_value();
   }

-  if (Heap::new_space()->Contains(elms)) {
-    // As elms still in the same space they used to be (new space),
+  if (!Heap::lo_space()->Contains(elms)) {
+    // As elms still in the same space they used to be,
     // there is no need to update region dirty mark.
     array->set_elements(LeftTrimFixedArray(elms, 1), SKIP_WRITE_BARRIER);
   } else {


--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to