Index: src/hydrogen.cc |
diff --git a/src/hydrogen.cc b/src/hydrogen.cc |
index 8e0858dca7ea91be64f320d0f83392c592cbf8d9..41e241050a3e05d551604816fe5c9f0cbb963a45 100644 |
--- a/src/hydrogen.cc |
+++ b/src/hydrogen.cc |
@@ -5446,7 +5446,6 @@ HInstruction* HOptimizedGraphBuilder::BuildLoadNamedField( |
checked_object = Add<HLoadNamedField>( |
checked_object, static_cast<HValue*>(NULL), |
access.WithRepresentation(Representation::Tagged())); |
- checked_object->set_type(HType::HeapNumber()); |
// Load the double value from it. |
access = HObjectAccess::ForHeapNumberValue(); |
} |
@@ -5485,8 +5484,11 @@ HInstruction* HOptimizedGraphBuilder::BuildStoreNamedField( |
PretenureFlag pretenure_flag = !FLAG_allocation_site_pretenuring ? |
isolate()->heap()->GetPretenureMode() : NOT_TENURED; |
+ // Mark mutable heap numbers as Tagged rather than HeapNumber, since |
+ // unlike immutable heap numbers, the identity of mutable heap numbers |
+ // matters. |
HInstruction* heap_number = Add<HAllocate>(heap_number_size, |
- HType::HeapNumber(), |
+ HType::Tagged(), |
pretenure_flag, |
HEAP_NUMBER_TYPE); |
AddStoreMapConstant(heap_number, isolate()->factory()->heap_number_map()); |
@@ -5499,7 +5501,6 @@ HInstruction* HOptimizedGraphBuilder::BuildStoreNamedField( |
// Already holds a HeapNumber; load the box and write its value field. |
HInstruction* heap_number = Add<HLoadNamedField>( |
checked_object, static_cast<HValue*>(NULL), heap_number_access); |
- heap_number->set_type(HType::HeapNumber()); |
instr = New<HStoreNamedField>(heap_number, |
HObjectAccess::ForHeapNumberValue(), |
value, STORE_TO_INITIALIZED_ENTRY); |