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

Unified Diff: src/runtime.cc

Issue 17308: Allocate as many object-literal properties as possible inobject.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 years, 11 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 | « src/objects.cc ('k') | test/mjsunit/large-object-literal.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/runtime.cc
===================================================================
--- src/runtime.cc (revision 1049)
+++ src/runtime.cc (working copy)
@@ -102,9 +102,9 @@
Handle<Context> context,
Handle<FixedArray> constant_properties,
bool* is_result_from_cache) {
+ int number_of_properties = constant_properties->length() / 2;
if (FLAG_canonicalize_object_literal_maps) {
// First find prefix of consecutive symbol keys.
- int number_of_properties = constant_properties->length()/2;
int number_of_symbol_keys = 0;
while ((number_of_symbol_keys < number_of_properties) &&
(constant_properties->get(number_of_symbol_keys*2)->IsSymbol())) {
@@ -125,7 +125,9 @@
}
}
*is_result_from_cache = false;
- return Handle<Map>(context->object_function()->initial_map());
+ return Factory::CopyMap(
+ Handle<Map>(context->object_function()->initial_map()),
+ number_of_properties);
}
« no previous file with comments | « src/objects.cc ('k') | test/mjsunit/large-object-literal.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698