Make sure to initialize all fields in the special maps
authorkasperl@chromium.org <kasperl@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Wed, 27 Jan 2010 20:14:46 +0000 (20:14 +0000)
committerkasperl@chromium.org <kasperl@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Wed, 27 Jan 2010 20:14:46 +0000 (20:14 +0000)
created during bootstrapping. Without this change we
risk having weird flags set on the map for the null
value (among others), which can lead to crashes.
Review URL: http://codereview.chromium.org/552195

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

src/heap.cc

index 6be1dafe7260b7834c12f14701863a7086c69312..ecf3cddabe382d38dccf22ff0093da91314a4042 100644 (file)
@@ -1185,7 +1185,10 @@ Object* Heap::AllocatePartialMap(InstanceType instance_type,
   reinterpret_cast<Map*>(result)->set_instance_type(instance_type);
   reinterpret_cast<Map*>(result)->set_instance_size(instance_size);
   reinterpret_cast<Map*>(result)->set_inobject_properties(0);
+  reinterpret_cast<Map*>(result)->set_pre_allocated_property_fields(0);
   reinterpret_cast<Map*>(result)->set_unused_property_fields(0);
+  reinterpret_cast<Map*>(result)->set_bit_field(0);
+  reinterpret_cast<Map*>(result)->set_bit_field2(0);
   return result;
 }