CHECK_EQ(map()->unused_property_fields(),
(map()->inobject_properties() + properties()->length() -
map()->NextFreePropertyIndex()));
+ DescriptorArray* descriptors = map()->instance_descriptors();
+ for (int i = 0; i < map()->NumberOfOwnDescriptors(); i++) {
+ if (descriptors->GetDetails(i).type() == FIELD) {
+ Representation r = descriptors->GetDetails(i).representation();
+ int field = descriptors->GetFieldIndex(i);
+ Object* value = RawFastPropertyAt(field);
+ if (r.IsSmi()) ASSERT(value->IsSmi());
+ if (r.IsDouble()) ASSERT(value->IsHeapNumber());
+ if (r.IsHeapObject()) ASSERT(value->IsHeapObject());
+ }
+ }
}
CHECK_EQ((map()->has_fast_smi_or_object_elements() ||
(elements() == GetHeap()->empty_fixed_array())),
int index = map()->NextFreePropertyIndex();
// Allocate new instance descriptors with (name, index) added
- Representation representation = value->OptimalRepresentation();
+ Representation representation = IsJSContextExtensionObject()
+ ? Representation::Tagged() : value->OptimalRepresentation();
+
FieldDescriptor new_field(name, index, attributes, representation);
ASSERT(index < map()->inobject_properties() ||
return ReplaceSlowProperty(name, new_value, attributes);
}
- Representation representation = new_value->OptimalRepresentation();
+ Representation representation = IsJSContextExtensionObject()
+ ? Representation::Tagged() : new_value->OptimalRepresentation();
int index = map()->NextFreePropertyIndex();
FieldDescriptor new_field(name, index, attributes, representation);