Index: src/hydrogen.cc |
diff --git a/src/hydrogen.cc b/src/hydrogen.cc |
index 8dbecac1191d49440fd755860a559cd71b75e2a5..b4be3fbb134832c6750937eedd50c59f873d0b9d 100644 |
--- a/src/hydrogen.cc |
+++ b/src/hydrogen.cc |
@@ -5275,6 +5275,8 @@ HInstruction* HOptimizedGraphBuilder::BuildStoreNamedField( |
// TODO(fschneider): Record the new map type of the object in the IR to |
// enable elimination of redundant checks after the transition store. |
instr->SetGVNFlag(kChangesMaps); |
+ } else { |
+ instr->set_can_omit_smi_tag_store(true); |
} |
return instr; |
} |
@@ -9475,7 +9477,7 @@ void HOptimizedGraphBuilder::BuildEmitInObjectProperties( |
Add<HStoreNamedField>(object, access, result); |
} else { |
Representation representation = details.representation(); |
- HInstruction* value_instruction = Add<HConstant>(value); |
+ HInstruction* value_instruction; |
if (representation.IsDouble()) { |
// Allocate a HeapNumber box and store the value into it. |
@@ -9490,8 +9492,12 @@ void HOptimizedGraphBuilder::BuildEmitInObjectProperties( |
AddStoreMapConstant(double_box, |
isolate()->factory()->heap_number_map()); |
Add<HStoreNamedField>(double_box, HObjectAccess::ForHeapNumberValue(), |
- value_instruction); |
+ Add<HConstant>(value)); |
value_instruction = double_box; |
+ } else if (representation.IsSmi() && value->IsUninitialized()) { |
+ value_instruction = graph()->GetConstant0(); |
+ } else { |
+ value_instruction = Add<HConstant>(value); |
} |
Add<HStoreNamedField>(object, access, value_instruction); |