Reviewers: Hannes Payer,

Description:
Add CHECKs that the array buffers list is always sorted new to old

BUG=none
[email protected]
LOG=n

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

Base URL: https://chromium.googlesource.com/v8/v8.git@master

Affected files (+2, -3 lines):
  M src/heap/heap.cc
  M src/runtime/runtime-typedarray.cc


Index: src/heap/heap.cc
diff --git a/src/heap/heap.cc b/src/heap/heap.cc
index a50db96b8b9c71a876afda64276bea2b7e5a41a5..a2fd76e7e5102884b425da66c0be13573e900752 100644
--- a/src/heap/heap.cc
+++ b/src/heap/heap.cc
@@ -1722,7 +1722,6 @@ void Heap::ProcessArrayBuffers(WeakObjectRetainer* retainer,
       this, array_buffers_list(), retainer, stop_after_young);
   set_array_buffers_list(array_buffer_obj);

-#ifdef DEBUG
// Verify invariant that young array buffers come before old array buffers
   // in array buffers list if there was no promotion failure.
   Object* undefined = undefined_value();
@@ -1733,10 +1732,9 @@ void Heap::ProcessArrayBuffers(WeakObjectRetainer* retainer,
     if (!old_objects_recorded) {
       old_objects_recorded = !InNewSpace(next);
     }
- DCHECK((InNewSpace(next) && !old_objects_recorded) | | !InNewSpace(next)); + CHECK((InNewSpace(next) && !old_objects_recorded) | | !InNewSpace(next));
     next = JSArrayBuffer::cast(next)->weak_next();
   }
-#endif
 }


Index: src/runtime/runtime-typedarray.cc
diff --git a/src/runtime/runtime-typedarray.cc b/src/runtime/runtime-typedarray.cc index 59c417f5b7c92ef548e2370703f94109dc670a66..510ceb1ac9631e4ebb9fc97f2f958fb0d3fccf2d 100644
--- a/src/runtime/runtime-typedarray.cc
+++ b/src/runtime/runtime-typedarray.cc
@@ -52,6 +52,7 @@ void Runtime::SetupArrayBuffer(Isolate* isolate,
   array_buffer->set_byte_length(*byte_length);

   array_buffer->set_weak_next(isolate->heap()->array_buffers_list());
+  CHECK(isolate->heap()->InNewSpace(*array_buffer));
   isolate->heap()->set_array_buffers_list(*array_buffer);
   array_buffer->set_weak_first_view(isolate->heap()->undefined_value());
 }


--
--
v8-dev mailing list
[email protected]
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to