Reviewers: Michael Starzinger, danno,

Description:
Added check to debug object migration crashes.

BUG=

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

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

Affected files:
  M src/mark-compact.cc


Index: src/mark-compact.cc
diff --git a/src/mark-compact.cc b/src/mark-compact.cc
index 815cae5b5e397a6b874e23996db9db804cfe2b37..e646ba7ce07d33b5cea9546c2021e59bfddc1886 100644
--- a/src/mark-compact.cc
+++ b/src/mark-compact.cc
@@ -2734,11 +2734,15 @@ void MarkCompactCollector::MigrateObject(Address dst,

       if (heap_->InNewSpace(value)) {
         heap_->store_buffer()->Mark(dst_slot);
-      } else if (value->IsHeapObject() && IsOnEvacuationCandidate(value)) {
-        SlotsBuffer::AddTo(&slots_buffer_allocator_,
-                           &migration_slots_buffer_,
-                           reinterpret_cast<Object**>(dst_slot),
-                           SlotsBuffer::IGNORE_OVERFLOW);
+      } else if (value->IsHeapObject()) {
+        CHECK(heap_->TargetSpace(HeapObject::FromAddress(src)) ==
+              heap_->old_pointer_space());
+        if (IsOnEvacuationCandidate(value)) {
+          SlotsBuffer::AddTo(&slots_buffer_allocator_,
+                             &migration_slots_buffer_,
+                             reinterpret_cast<Object**>(dst_slot),
+                             SlotsBuffer::IGNORE_OVERFLOW);
+        }
       }

       src_slot += kPointerSize;


--
--
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/groups/opt_out.


Reply via email to