Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(154)

Unified Diff: src/hydrogen.cc

Issue 17881004: Remove superfluous HInnerAllocatedObject in BuildEmitDeepCopy (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 &&
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698