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

Side by Side Diff: src/elements.cc

Issue 1361853005: [heap] Prepare code for smaller large object allocation limit than max allocatable memory. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 2 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 unified diff | Download patch
« no previous file with comments | « src/compiler/js-typed-lowering.cc ('k') | src/full-codegen/full-codegen.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 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/elements.h" 5 #include "src/elements.h"
6 6
7 #include "src/arguments.h" 7 #include "src/arguments.h"
8 #include "src/conversions.h" 8 #include "src/conversions.h"
9 #include "src/factory.h" 9 #include "src/factory.h"
10 #include "src/messages.h" 10 #include "src/messages.h"
(...skipping 2152 matching lines...) Expand 10 before | Expand all | Expand 10 after
2163 return array; 2163 return array;
2164 2164
2165 } else if (args->length() == 1 && args->at<Object>(0)->IsNumber()) { 2165 } else if (args->length() == 1 && args->at<Object>(0)->IsNumber()) {
2166 uint32_t length; 2166 uint32_t length;
2167 if (!args->at<Object>(0)->ToArrayLength(&length)) { 2167 if (!args->at<Object>(0)->ToArrayLength(&length)) {
2168 return ThrowArrayLengthRangeError(array->GetIsolate()); 2168 return ThrowArrayLengthRangeError(array->GetIsolate());
2169 } 2169 }
2170 2170
2171 // Optimize the case where there is one argument and the argument is a small 2171 // Optimize the case where there is one argument and the argument is a small
2172 // smi. 2172 // smi.
2173 if (length > 0 && length < JSObject::kInitialMaxFastElementArray) { 2173 if (length > 0 && length < JSArray::kInitialMaxFastElementArray) {
2174 ElementsKind elements_kind = array->GetElementsKind(); 2174 ElementsKind elements_kind = array->GetElementsKind();
2175 JSArray::Initialize(array, length, length); 2175 JSArray::Initialize(array, length, length);
2176 2176
2177 if (!IsFastHoleyElementsKind(elements_kind)) { 2177 if (!IsFastHoleyElementsKind(elements_kind)) {
2178 elements_kind = GetHoleyElementsKind(elements_kind); 2178 elements_kind = GetHoleyElementsKind(elements_kind);
2179 JSObject::TransitionElementsKind(array, elements_kind); 2179 JSObject::TransitionElementsKind(array, elements_kind);
2180 } 2180 }
2181 } else if (length == 0) { 2181 } else if (length == 0) {
2182 JSArray::Initialize(array, JSArray::kPreallocatedArrayElements); 2182 JSArray::Initialize(array, JSArray::kPreallocatedArrayElements);
2183 } else { 2183 } else {
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
2326 } 2326 }
2327 } 2327 }
2328 2328
2329 DCHECK(j == result_len); 2329 DCHECK(j == result_len);
2330 return result_array; 2330 return result_array;
2331 } 2331 }
2332 2332
2333 ElementsAccessor** ElementsAccessor::elements_accessors_ = NULL; 2333 ElementsAccessor** ElementsAccessor::elements_accessors_ = NULL;
2334 } // namespace internal 2334 } // namespace internal
2335 } // namespace v8 2335 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/js-typed-lowering.cc ('k') | src/full-codegen/full-codegen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698