Chromium Code Reviews| Index: src/hydrogen.cc |
| diff --git a/src/hydrogen.cc b/src/hydrogen.cc |
| index b03bf699389be7864587415c6143280159f27979..d82d6b84329adae37fc5802c667111ecd9fa9abb 100644 |
| --- a/src/hydrogen.cc |
| +++ b/src/hydrogen.cc |
| @@ -10022,10 +10022,22 @@ void HOptimizedGraphBuilder::BuildEmitDeepCopy( |
| } |
| // Copy in-object properties. |
| - HValue* object_properties = |
| - AddInstruction(new(zone) HInnerAllocatedObject(target, object_offset)); |
| - BuildEmitInObjectProperties(boilerplate_object, original_boilerplate_object, |
| - object_properties, target, offset, data_target, data_offset); |
| + Handle<DescriptorArray> descriptors( |
| + boilerplate_object->map()->instance_descriptors()); |
| + int descriptor_count = boilerplate_object->map()->NumberOfOwnDescriptors(); |
| + bool has_field = false; |
| + for (int i = 0; i < descriptor_count; i++) { |
| + PropertyDetails details = descriptors->GetDetails(i); |
| + if (details.type() != FIELD) continue; |
| + has_field = true; |
| + } |
|
Toon Verwaest
2013/06/27 04:32:22
Isn't there a utility function to test for this co
danno
2013/06/27 13:55:51
OK, I now use map()->NumberOfFields(). I'll leave
|
| + |
| + if (has_field) { |
| + HValue* object_properties = |
| + AddInstruction(new(zone) HInnerAllocatedObject(target, object_offset)); |
| + BuildEmitInObjectProperties(boilerplate_object, original_boilerplate_object, |
| + object_properties, target, offset, data_target, data_offset); |
| + } |
| // Create allocation site info. |
| if (mode == TRACK_ALLOCATION_SITE && |