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

Unified Diff: src/hydrogen.cc

Issue 23536065: Merged r16790 into trunk branch. (Closed) Base URL: https://v8.googlecode.com/svn/trunk
Patch Set: Created 7 years, 3 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 | src/version.cc » ('j') | 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 23c373fa0b461e7a911ec9ac90a9575ea7f36feb..15ef5ed0b65bbc54aa412505581c71bcd528dc3d 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -8186,8 +8186,9 @@ HInstruction* HOptimizedGraphBuilder::BuildFastLiteral(
int object_size = boilerplate_object->map()->instance_size();
int object_offset = object_size;
+ InstanceType instance_type = boilerplate_object->map()->instance_type();
bool create_allocation_site_info = mode == TRACK_ALLOCATION_SITE &&
- AllocationSite::CanTrack(boilerplate_object->map()->instance_type());
+ AllocationSite::CanTrack(instance_type);
// If using allocation sites, then the payload on the site should already
// be filled in as a valid (boilerplate) array.
@@ -8198,9 +8199,12 @@ HInstruction* HOptimizedGraphBuilder::BuildFastLiteral(
object_size += AllocationMemento::kSize;
}
+ ASSERT(instance_type == JS_ARRAY_TYPE || instance_type == JS_OBJECT_TYPE);
+ HType type = instance_type == JS_ARRAY_TYPE
+ ? HType::JSArray() : HType::JSObject();
HValue* object_size_constant = Add<HConstant>(object_size);
- HInstruction* object = Add<HAllocate>(object_size_constant, HType::JSObject(),
- isolate()->heap()->GetPretenureMode(), JS_OBJECT_TYPE);
+ HInstruction* object = Add<HAllocate>(object_size_constant, type,
+ isolate()->heap()->GetPretenureMode(), instance_type);
BuildEmitObjectHeader(boilerplate_object, object);
« no previous file with comments | « no previous file | src/version.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698