| Index: src/ic.cc
|
| diff --git a/src/ic.cc b/src/ic.cc
|
| index fef90e43f68a331bc63c44f44cb702e470f2b6d2..e10b0fdc6139f5a5117c290228013e5f62f37b39 100644
|
| --- a/src/ic.cc
|
| +++ b/src/ic.cc
|
| @@ -1231,9 +1231,12 @@ static bool LookupForWrite(Handle<JSObject> receiver,
|
| ASSERT(!receiver->map()->is_deprecated());
|
| if (!lookup->CanHoldValue(value)) {
|
| Handle<Map> target(lookup->GetTransitionTarget());
|
| + Representation field_representation = value->OptimalRepresentation();
|
| + Handle<HeapType> field_type = value->OptimalType(
|
| + lookup->isolate(), field_representation);
|
| Map::GeneralizeRepresentation(
|
| target, target->LastAdded(),
|
| - value->OptimalRepresentation(), FORCE_FIELD);
|
| + field_representation, field_type, FORCE_FIELD);
|
| // Lookup the transition again since the transition tree may have changed
|
| // entirely by the migration above.
|
| receiver->map()->LookupTransition(*holder, *name, lookup);
|
|
|