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

Side by Side Diff: src/elements.cc

Issue 2539093002: [runtime] Port simple String.prototype.indexOf cases to TF Builtin (Closed)
Patch Set: merging with master Created 4 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
« no previous file with comments | « src/compiler/raw-machine-assembler.cc ('k') | src/external-reference-table.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/isolate-inl.h" 10 #include "src/isolate-inl.h"
(...skipping 3681 matching lines...) Expand 10 before | Expand all | Expand 10 after
3692 } 3692 }
3693 3693
3694 3694
3695 MaybeHandle<Object> ArrayConstructInitializeElements(Handle<JSArray> array, 3695 MaybeHandle<Object> ArrayConstructInitializeElements(Handle<JSArray> array,
3696 Arguments* args) { 3696 Arguments* args) {
3697 if (args->length() == 0) { 3697 if (args->length() == 0) {
3698 // Optimize the case where there are no parameters passed. 3698 // Optimize the case where there are no parameters passed.
3699 JSArray::Initialize(array, JSArray::kPreallocatedArrayElements); 3699 JSArray::Initialize(array, JSArray::kPreallocatedArrayElements);
3700 return array; 3700 return array;
3701 3701
3702 } else if (args->length() == 1 && args->at<Object>(0)->IsNumber()) { 3702 } else if (args->length() == 1 && args->at(0)->IsNumber()) {
3703 uint32_t length; 3703 uint32_t length;
3704 if (!args->at<Object>(0)->ToArrayLength(&length)) { 3704 if (!args->at(0)->ToArrayLength(&length)) {
3705 return ThrowArrayLengthRangeError(array->GetIsolate()); 3705 return ThrowArrayLengthRangeError(array->GetIsolate());
3706 } 3706 }
3707 3707
3708 // Optimize the case where there is one argument and the argument is a small 3708 // Optimize the case where there is one argument and the argument is a small
3709 // smi. 3709 // smi.
3710 if (length > 0 && length < JSArray::kInitialMaxFastElementArray) { 3710 if (length > 0 && length < JSArray::kInitialMaxFastElementArray) {
3711 ElementsKind elements_kind = array->GetElementsKind(); 3711 ElementsKind elements_kind = array->GetElementsKind();
3712 JSArray::Initialize(array, length, length); 3712 JSArray::Initialize(array, length, length);
3713 3713
3714 if (!IsFastHoleyElementsKind(elements_kind)) { 3714 if (!IsFastHoleyElementsKind(elements_kind)) {
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
3853 insertion_index += len; 3853 insertion_index += len;
3854 } 3854 }
3855 3855
3856 DCHECK_EQ(insertion_index, result_len); 3856 DCHECK_EQ(insertion_index, result_len);
3857 return result_array; 3857 return result_array;
3858 } 3858 }
3859 3859
3860 ElementsAccessor** ElementsAccessor::elements_accessors_ = NULL; 3860 ElementsAccessor** ElementsAccessor::elements_accessors_ = NULL;
3861 } // namespace internal 3861 } // namespace internal
3862 } // namespace v8 3862 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/raw-machine-assembler.cc ('k') | src/external-reference-table.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698