Index: src/deoptimizer.cc |
diff --git a/src/deoptimizer.cc b/src/deoptimizer.cc |
index 2fc04fa6e051bce5609f453f23944ed7439326b1..84e80b9d9a0c86fa8c859f7bb068fbce68f4d121 100644 |
--- a/src/deoptimizer.cc |
+++ b/src/deoptimizer.cc |
@@ -1614,7 +1614,10 @@ Handle<Object> Deoptimizer::MaterializeNextHeapObject() { |
} |
} else { |
// Dispatch on the instance type of the object to be materialized. |
- Handle<Map> map = Handle<Map>::cast(MaterializeNextValue()); |
+ // We also need to make sure that the representation of all fields |
+ // in the given object are general enough to hold a tagged value. |
+ Handle<Map> map = Map::GeneralizeAllFieldRepresentations( |
+ Handle<Map>::cast(MaterializeNextValue()), Representation::Tagged()); |
switch (map->instance_type()) { |
case HEAP_NUMBER_TYPE: { |
Handle<HeapNumber> object = isolate_->factory()->NewHeapNumber(0.0); |