Index: src/ic.cc |
diff --git a/src/ic.cc b/src/ic.cc |
index a5936c6cdcb208ab709db0b9170b223315930c4e..1f1dc1f06f9ee2c29dbb04492859cd09d22d0cec 100644 |
--- a/src/ic.cc |
+++ b/src/ic.cc |
@@ -1218,9 +1218,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); |