Revision: 7941
Author:   [email protected]
Date:     Wed May 18 08:28:43 2011
Log:      Assert that independent handles do not participate in grouping.

Review URL: http://codereview.chromium.org/7044007
http://code.google.com/p/v8/source/detail?r=7941

Modified:
 /branches/bleeding_edge/src/global-handles.cc

=======================================
--- /branches/bleeding_edge/src/global-handles.cc       Tue May 17 05:18:19 2011
+++ /branches/bleeding_edge/src/global-handles.cc       Wed May 18 08:28:43 2011
@@ -619,6 +619,11 @@
 void GlobalHandles::AddObjectGroup(Object*** handles,
                                    size_t length,
                                    v8::RetainedObjectInfo* info) {
+#ifdef DEBUG
+  for (size_t i = 0; i < length; ++i) {
+    ASSERT(!Node::FromLocation(handles[i])->independent_);
+  }
+#endif
   if (length == 0) {
     if (info != NULL) info->Dispose();
     return;
@@ -630,6 +635,12 @@
 void GlobalHandles::AddImplicitReferences(HeapObject** parent,
                                           Object*** children,
                                           size_t length) {
+#ifdef DEBUG
+  ASSERT(!Node::FromLocation(BitCast<Object**>(parent))->independent_);
+  for (size_t i = 0; i < length; ++i) {
+    ASSERT(!Node::FromLocation(children[i])->independent_);
+  }
+#endif
   if (length == 0) return;
implicit_ref_groups_.Add(ImplicitRefGroup::New(parent, children, length));
 }

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

Reply via email to