Index: src/objects.cc |
diff --git a/src/objects.cc b/src/objects.cc |
index 1e586e8f0b26336ec68e4c664788d954490355c2..6513482b718398a8fdb6967de89df78d3d1e52f4 100644 |
--- a/src/objects.cc |
+++ b/src/objects.cc |
@@ -1801,7 +1801,9 @@ MaybeObject* JSObject::AddFastProperty(Name* name, |
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() || |
@@ -2105,7 +2107,8 @@ MaybeObject* JSObject::ConvertDescriptorToField(Name* name, |
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); |