Add an assert to the serializer.
authorerik.corry@gmail.com <erik.corry@gmail.com@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Thu, 19 Jan 2012 13:51:45 +0000 (13:51 +0000)
committererik.corry@gmail.com <erik.corry@gmail.com@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Thu, 19 Jan 2012 13:51:45 +0000 (13:51 +0000)
Review URL: https://chromiumcodereview.appspot.com/9159010

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10441 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/serialize.cc

index d0a1a63..e9be249 100644 (file)
@@ -1364,6 +1364,13 @@ void PartialSerializer::SerializeObject(
   CHECK(o->IsHeapObject());
   HeapObject* heap_object = HeapObject::cast(o);
 
+  if (heap_object->IsMap()) {
+    // The code-caches link to context-specific code objects, which
+    // the startup and context serializes cannot currently handle.
+    ASSERT(Map::cast(heap_object)->code_cache() ==
+           heap_object->GetHeap()->raw_unchecked_empty_fixed_array());
+  }
+
   int root_index;
   if ((root_index = RootIndex(heap_object)) != kInvalidRootIndex) {
     PutRoot(root_index, heap_object, how_to_code, where_to_point);