diff --git a/src/hydrogen.cc b/src/hydrogen.cc index 0aa96e899c..762ac0ea06 100644 --- a/src/hydrogen.cc +++ b/src/hydrogen.cc @@ -9910,12 +9910,13 @@ HInstruction* HOptimizedGraphBuilder::BuildFastLiteral( HValue* object_elements_size = Add(elements_size); if (boilerplate_object->HasFastDoubleElements()) { // Allocation folding will not be able to fold |object| and - // |object_elements| together in some cases, so initialize - // elements with the undefined to make GC happy. - HConstant* empty_fixed_array = Add( - isolate()->factory()->empty_fixed_array()); - Add(object, HObjectAccess::ForElementsPointer(), - empty_fixed_array, INITIALIZING_STORE); + // |object_elements| together if they are pre-tenured. + if (pretenure_flag == TENURED) { + HConstant* empty_fixed_array = Add( + isolate()->factory()->empty_fixed_array()); + Add(object, HObjectAccess::ForElementsPointer(), + empty_fixed_array, INITIALIZING_STORE); + } object_elements = Add(object_elements_size, HType::JSObject(), pretenure_flag, FIXED_DOUBLE_ARRAY_TYPE, site_context->current()); } else {