Reviewers: Erik Corry,

Message:
I bet this will make some tests time out, because it roughly doubles
scavenge time with ENABLE_SLOW_ASSERTS.  I'll sort that out and add it
to the change list before submitting.

Description:
Before a scavenge collection in debug builds with ENABLE_SLOW_ASSERTS,
we verify that there are no pointers to new space from the code space.
Add the old data space to this verification.


Please review this at http://codereview.chromium.org/113095

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

Affected files:
   M     src/heap.cc


Index: src/heap.cc
===================================================================
--- src/heap.cc (revision 1890)
+++ src/heap.cc (working copy)
@@ -559,18 +559,25 @@
  void Heap::Scavenge() {
  #ifdef DEBUG
    if (FLAG_enable_slow_asserts) {
+    // Verify that there are no pointers to new space in spaces where we
+    // do not expect them.
      VerifyNonPointerSpacePointersVisitor v;
-    HeapObjectIterator it(code_space_);
-    while (it.has_next()) {
-      HeapObject* object = it.next();
+    HeapObjectIterator code_it(code_space_);
+    while (code_it.has_next()) {
+      HeapObject* object = code_it.next();
        if (object->IsCode()) {
          Code::cast(object)->ConvertICTargetsFromAddressToObject();
-      }
-      object->Iterate(&v);
-      if (object->IsCode()) {
+        object->Iterate(&v);
          Code::cast(object)->ConvertICTargetsFromObjectToAddress();
+      } else {
+        // If we find non-code objects in code space (e.g., free list
+        // nodes) we want to verify them as well.
+        object->Iterate(&v);
        }
      }
+
+    HeapObjectIterator data_it(old_data_space_);
+    while (data_it.has_next()) data_it.next()->Iterate(&v);
    }
  #endif




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

Reply via email to