Use InitialPropertiesLength to reinitialize rather than local calculation.
authorverwaest@chromium.org <verwaest@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Mon, 28 Apr 2014 08:38:51 +0000 (08:38 +0000)
committerverwaest@chromium.org <verwaest@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Mon, 28 Apr 2014 08:38:51 +0000 (08:38 +0000)
R=bmeurer@chromium.org

Review URL: https://codereview.chromium.org/256973003

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

src/factory.cc

index 32ff424..47a2d81 100644 (file)
@@ -1737,7 +1737,7 @@ void Factory::ReinitializeJSReceiver(Handle<JSReceiver> object,
   map->set_prototype(object->map()->prototype());
 
   // Allocate the backing storage for the properties.
-  int prop_size = map->unused_property_fields() - map->inobject_properties();
+  int prop_size = map->InitialPropertiesLength();
   Handle<FixedArray> properties = NewFixedArray(prop_size, TENURED);
 
   Heap* heap = isolate()->heap();
@@ -1788,7 +1788,7 @@ void Factory::ReinitializeJSGlobalProxy(Handle<JSGlobalProxy> object,
   ASSERT(map->instance_type() == object->map()->instance_type());
 
   // Allocate the backing storage for the properties.
-  int prop_size = map->unused_property_fields() - map->inobject_properties();
+  int prop_size = map->InitialPropertiesLength();
   Handle<FixedArray> properties = NewFixedArray(prop_size, TENURED);
 
   // In order to keep heap in consistent state there must be no allocations