| Index: src/hydrogen.cc
|
| diff --git a/src/hydrogen.cc b/src/hydrogen.cc
|
| index a95f4a49633069888f862b237c145ebc0f91ea95..cdf69e7c72c672490e853d537951203e64353a4c 100644
|
| --- a/src/hydrogen.cc
|
| +++ b/src/hydrogen.cc
|
| @@ -9475,7 +9475,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 +9490,16 @@ 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_instruction = value->IsUninitialized()
|
| + ? graph()->GetConstant0()
|
| + : Add<HConstant>(value);
|
| + // Ensure that value is stored as smi.
|
| + access = access.WithRepresentation(representation);
|
| + } else {
|
| + value_instruction = Add<HConstant>(value);
|
| }
|
|
|
| Add<HStoreNamedField>(object, access, value_instruction);
|
|
|