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

Side by Side Diff: src/heap.cc

Issue 11413142: Fix array concat for holey arrays and concat of double to object arrays. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments Created 8 years 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/factory.cc ('k') | src/objects.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 4214 matching lines...) Expand 10 before | Expand all | Expand 10 after
4225 } 4225 }
4226 4226
4227 4227
4228 MaybeObject* Heap::AllocateJSArrayAndStorage( 4228 MaybeObject* Heap::AllocateJSArrayAndStorage(
4229 ElementsKind elements_kind, 4229 ElementsKind elements_kind,
4230 int length, 4230 int length,
4231 int capacity, 4231 int capacity,
4232 ArrayStorageAllocationMode mode, 4232 ArrayStorageAllocationMode mode,
4233 PretenureFlag pretenure) { 4233 PretenureFlag pretenure) {
4234 ASSERT(capacity >= length); 4234 ASSERT(capacity >= length);
4235 if (length != 0 && mode == INITIALIZE_ARRAY_ELEMENTS_WITH_HOLE) {
4236 elements_kind = GetHoleyElementsKind(elements_kind);
4237 }
4238 MaybeObject* maybe_array = AllocateJSArray(elements_kind, pretenure); 4235 MaybeObject* maybe_array = AllocateJSArray(elements_kind, pretenure);
4239 JSArray* array; 4236 JSArray* array;
4240 if (!maybe_array->To(&array)) return maybe_array; 4237 if (!maybe_array->To(&array)) return maybe_array;
4241 4238
4242 if (capacity == 0) { 4239 if (capacity == 0) {
4243 array->set_length(Smi::FromInt(0)); 4240 array->set_length(Smi::FromInt(0));
4244 array->set_elements(empty_fixed_array()); 4241 array->set_elements(empty_fixed_array());
4245 return array; 4242 return array;
4246 } 4243 }
4247 4244
(...skipping 3257 matching lines...) Expand 10 before | Expand all | Expand 10 after
7505 static_cast<int>(object_sizes_last_time_[index])); 7502 static_cast<int>(object_sizes_last_time_[index]));
7506 FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(ADJUST_LAST_TIME_OBJECT_COUNT) 7503 FIXED_ARRAY_SUB_INSTANCE_TYPE_LIST(ADJUST_LAST_TIME_OBJECT_COUNT)
7507 #undef ADJUST_LAST_TIME_OBJECT_COUNT 7504 #undef ADJUST_LAST_TIME_OBJECT_COUNT
7508 7505
7509 memcpy(object_counts_last_time_, object_counts_, sizeof(object_counts_)); 7506 memcpy(object_counts_last_time_, object_counts_, sizeof(object_counts_));
7510 memcpy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_)); 7507 memcpy(object_sizes_last_time_, object_sizes_, sizeof(object_sizes_));
7511 ClearObjectStats(); 7508 ClearObjectStats();
7512 } 7509 }
7513 7510
7514 } } // namespace v8::internal 7511 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/factory.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698