Index: src/hydrogen.cc |
diff --git a/src/hydrogen.cc b/src/hydrogen.cc |
index ec5bb9bc8f91af24598efcb31b0242492af5be5a..da20c025e1a7d746977f9f5bc58894a1f472b144 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() |