Index: src/crankshaft/hydrogen.cc |
diff --git a/src/crankshaft/hydrogen.cc b/src/crankshaft/hydrogen.cc |
index d43c03285047fe51adbbec36dcab6c0714d630e3..7182b6586c9f4a17af0bffc7b13373a80a4a4065 100644 |
--- a/src/crankshaft/hydrogen.cc |
+++ b/src/crankshaft/hydrogen.cc |
@@ -6522,19 +6522,11 @@ |
access = access.WithRepresentation(Representation::Smi()); |
break; |
case PropertyCellConstantType::kStableMap: { |
- // First check that the previous value of the {cell} still has the |
- // map that we are about to check the new {value} for. If not, then |
- // the stable map assumption was invalidated and we cannot continue |
- // with the optimized code. |
- Handle<HeapObject> cell_value(HeapObject::cast(cell->value())); |
- Handle<Map> cell_value_map(cell_value->map()); |
- HCheckMaps* cell_value_check = Add<HCheckMaps>( |
- Add<HConstant>(cell_value, Representation::HeapObject()), |
- cell_value_map); |
- cell_value_check->ClearDependsOnFlag(kElementsKind); |
- // Now check that the new {value} is a HeapObject with the same map. |
+ // The map may no longer be stable, deopt if it's ever different from |
+ // what is currently there, which will allow for restablization. |
+ Handle<Map> map(HeapObject::cast(cell->value())->map()); |
Add<HCheckHeapObject>(value); |
- value = Add<HCheckMaps>(value, cell_value_map); |
+ value = Add<HCheckMaps>(value, map); |
access = access.WithRepresentation(Representation::HeapObject()); |
break; |
} |