Index: src/hydrogen.cc |
diff --git a/src/hydrogen.cc b/src/hydrogen.cc |
index 176dd9fa77a04f8c401cef6fd8da191bd736cefa..b619cbdf04300b4909c1f4fa8befd7412eaa40a9 100644 |
--- a/src/hydrogen.cc |
+++ b/src/hydrogen.cc |
@@ -5263,9 +5263,9 @@ HInstruction* HOptimizedGraphBuilder::BuildStoreNamedField( |
} |
} else { |
// This is a normal store. |
- instr = New<HStoreNamedField>(checked_object->ActualValue(), |
- field_access, |
- value); |
+ instr = New<HStoreNamedField>( |
+ checked_object->ActualValue(), field_access, value, |
+ transition_to_field ? INITIALIZING_STORE : STORE_TO_INITIALIZED_ENTRY); |
} |
if (transition_to_field) { |
@@ -9476,7 +9476,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. |
@@ -9491,8 +9491,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); |