- if (!o->structure()->hasNonEnumerableProperties() && !o->structure()->hasAnonymousSlots() &&
- !o->structure()->hasGetterSetterProperties() && !o->structure()->isUncacheableDictionary() &&
- !o->structure()->typeInfo().overridesGetPropertyNames())
- numCacheableSlots = o->structure()->propertyStorageSize();
-
- JSPropertyNameIterator* jsPropertyNameIterator = new (exec) JSPropertyNameIterator(exec, propertyNames.data(), numCacheableSlots);
+ if (!o->structure()->hasNonEnumerableProperties() && !o->structure()->hasGetterSetterProperties()
+ && !o->structure()->isUncacheableDictionary() && !o->structure()->typeInfo().overridesGetPropertyNames())
+ numCacheableSlots = propertyNames.numCacheableSlots();
+
+ JSPropertyNameIterator* jsPropertyNameIterator = new (NotNull, allocateCell<JSPropertyNameIterator>(vm.heap)) JSPropertyNameIterator(exec, propertyNames.data(), numCacheableSlots);
+ jsPropertyNameIterator->finishCreation(vm, propertyNames.data(), o);