Index: src/deoptimizer.cc |
diff --git a/src/deoptimizer.cc b/src/deoptimizer.cc |
index 08fb148c0db1df66d455fe34656c740e428a2bde..4c98b8473569ec20c6f255de1d587f0afaeee12a 100644 |
--- a/src/deoptimizer.cc |
+++ b/src/deoptimizer.cc |
@@ -1813,9 +1813,11 @@ Handle<Object> Deoptimizer::MaterializeNextHeapObject() { |
Handle<Map> map = Map::GeneralizeAllFieldRepresentations( |
Handle<Map>::cast(MaterializeNextValue())); |
switch (map->instance_type()) { |
+ case MUTABLE_HEAP_NUMBER_TYPE: |
case HEAP_NUMBER_TYPE: { |
// Reuse the HeapNumber value directly as it is already properly |
- // tagged and skip materializing the HeapNumber explicitly. |
+ // tagged and skip materializing the HeapNumber explicitly. Turn mutable |
+ // heap numbers immutable. |
Handle<Object> object = MaterializeNextValue(); |
if (object_index < prev_materialized_count_) { |
materialized_objects_->Add(Handle<Object>( |
@@ -1877,6 +1879,9 @@ Handle<Object> Deoptimizer::MaterializeNextHeapObject() { |
Handle<Object> Deoptimizer::MaterializeNextValue() { |
int value_index = materialization_value_index_++; |
Handle<Object> value = materialized_values_->at(value_index); |
+ if (value->IsMutableHeapNumber()) { |
+ HeapNumber::cast(*value)->set_map(isolate_->heap()->heap_number_map()); |
+ } |
if (*value == isolate_->heap()->arguments_marker()) { |
value = MaterializeNextHeapObject(); |
} |
@@ -3383,6 +3388,7 @@ Handle<Object> SlotRefValueBuilder::GetNext(Isolate* isolate, int lvl) { |
// TODO(jarin) this should be unified with the code in |
// Deoptimizer::MaterializeNextHeapObject() |
switch (map->instance_type()) { |
+ case MUTABLE_HEAP_NUMBER_TYPE: |
case HEAP_NUMBER_TYPE: { |
// Reuse the HeapNumber value directly as it is already properly |
// tagged and skip materializing the HeapNumber explicitly. |