Index: src/hydrogen.cc |
diff --git a/src/hydrogen.cc b/src/hydrogen.cc |
index feff6f9bdf9d5bc7ea315df02814f9af78ee7f68..a97e08307615c50b73b794fbcb582349f5ec541d 100644 |
--- a/src/hydrogen.cc |
+++ b/src/hydrogen.cc |
@@ -10934,9 +10934,11 @@ void HOptimizedGraphBuilder::BuildEmitDeepCopy( |
boilerplate_object->map()->instance_descriptors()); |
int limit = boilerplate_object->map()->NumberOfOwnDescriptors(); |
+ int copied_fields = 0; |
for (int i = 0; i < limit; i++) { |
PropertyDetails details = descriptors->GetDetails(i); |
if (details.type() != FIELD) continue; |
+ copied_fields++; |
int index = descriptors->GetFieldIndex(i); |
int property_offset = boilerplate_object->GetInObjectPropertyOffset(index); |
Handle<Name> name(descriptors->GetKey(i)); |
@@ -10975,6 +10977,16 @@ void HOptimizedGraphBuilder::BuildEmitDeepCopy( |
} |
} |
+ int inobject_properties = boilerplate_object->map()->inobject_properties(); |
+ HInstruction* value_instruction = AddInstruction(new(zone) HConstant( |
+ factory->one_pointer_filler_map(), Representation::Tagged())); |
+ for (int i = copied_fields; i < inobject_properties; i++) { |
+ AddInstruction(new(zone) HStoreNamedField( |
+ object_properties, factory->unknown_field_string(), value_instruction, |
+ true, Representation::Tagged(), |
+ boilerplate_object->GetInObjectPropertyOffset(i))); |
+ } |
+ |
// Build Allocation Site Info if desired |
if (create_allocation_site_info) { |
BuildCreateAllocationSiteInfo(target, JSArray::kSize, original_boilerplate); |