Index: src/hydrogen.cc |
diff --git a/src/hydrogen.cc b/src/hydrogen.cc |
index 0651e71a081873c57e8399cd2681853415368804..a785b2a7b01fb571e2c6030ea80986d88815694d 100644 |
--- a/src/hydrogen.cc |
+++ b/src/hydrogen.cc |
@@ -5781,8 +5781,9 @@ HInstruction* HOptimizedGraphBuilder::BuildStoreNamedField( |
HInstruction* heap_number = Add<HAllocate>(heap_number_size, |
HType::HeapObject(), |
NOT_TENURED, |
- HEAP_NUMBER_TYPE); |
- AddStoreMapConstant(heap_number, isolate()->factory()->heap_number_map()); |
+ MUTABLE_HEAP_NUMBER_TYPE); |
+ AddStoreMapConstant( |
+ heap_number, isolate()->factory()->mutable_heap_number_map()); |
Add<HStoreNamedField>(heap_number, HObjectAccess::ForHeapNumberValue(), |
value); |
instr = New<HStoreNamedField>(checked_object->ActualValue(), |
@@ -10953,11 +10954,14 @@ void HOptimizedGraphBuilder::BuildEmitInObjectProperties( |
// 2) we can just use the mode of the parent object for pretenuring |
HInstruction* double_box = |
Add<HAllocate>(heap_number_constant, HType::HeapObject(), |
- pretenure_flag, HEAP_NUMBER_TYPE); |
+ pretenure_flag, MUTABLE_HEAP_NUMBER_TYPE); |
AddStoreMapConstant(double_box, |
- isolate()->factory()->heap_number_map()); |
- Add<HStoreNamedField>(double_box, HObjectAccess::ForHeapNumberValue(), |
- Add<HConstant>(value)); |
+ isolate()->factory()->mutable_heap_number_map()); |
+ // Unwrap the mutable heap number from the boilerplate. |
+ HValue* double_value = |
+ Add<HConstant>(Handle<HeapNumber>::cast(value)->value()); |
+ Add<HStoreNamedField>( |
+ double_box, HObjectAccess::ForHeapNumberValue(), double_value); |
value_instruction = double_box; |
} else if (representation.IsSmi()) { |
value_instruction = value->IsUninitialized() |