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

Side by Side Diff: src/elements.cc

Issue 2539093002: [runtime] Port simple String.prototype.indexOf cases to TF Builtin (Closed)
Patch Set: call runtime for large strings 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
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 3684 matching lines...) Expand 10 before | Expand all | Expand 10 after
3695 } 3695 }
3696 3696
3697 3697
3698 MaybeHandle<Object> ArrayConstructInitializeElements(Handle<JSArray> array, 3698 MaybeHandle<Object> ArrayConstructInitializeElements(Handle<JSArray> array,
3699 Arguments* args) { 3699 Arguments* args) {
3700 if (args->length() == 0) { 3700 if (args->length() == 0) {
3701 // Optimize the case where there are no parameters passed. 3701 // Optimize the case where there are no parameters passed.
3702 JSArray::Initialize(array, JSArray::kPreallocatedArrayElements); 3702 JSArray::Initialize(array, JSArray::kPreallocatedArrayElements);
3703 return array; 3703 return array;
3704 3704
3705 } else if (args->length() == 1 && args->at<Object>(0)->IsNumber()) { 3705 } else if (args->length() == 1 && args->at(0)->IsNumber()) {
3706 uint32_t length; 3706 uint32_t length;
3707 if (!args->at<Object>(0)->ToArrayLength(&length)) { 3707 if (!args->at(0)->ToArrayLength(&length)) {
3708 return ThrowArrayLengthRangeError(array->GetIsolate()); 3708 return ThrowArrayLengthRangeError(array->GetIsolate());
3709 } 3709 }
3710 3710
3711 // Optimize the case where there is one argument and the argument is a small 3711 // Optimize the case where there is one argument and the argument is a small
3712 // smi. 3712 // smi.
3713 if (length > 0 && length < JSArray::kInitialMaxFastElementArray) { 3713 if (length > 0 && length < JSArray::kInitialMaxFastElementArray) {
3714 ElementsKind elements_kind = array->GetElementsKind(); 3714 ElementsKind elements_kind = array->GetElementsKind();
3715 JSArray::Initialize(array, length, length); 3715 JSArray::Initialize(array, length, length);
3716 3716
3717 if (!IsFastHoleyElementsKind(elements_kind)) { 3717 if (!IsFastHoleyElementsKind(elements_kind)) {
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
3856 insertion_index += len; 3856 insertion_index += len;
3857 } 3857 }
3858 3858
3859 DCHECK_EQ(insertion_index, result_len); 3859 DCHECK_EQ(insertion_index, result_len);
3860 return result_array; 3860 return result_array;
3861 } 3861 }
3862 3862
3863 ElementsAccessor** ElementsAccessor::elements_accessors_ = NULL; 3863 ElementsAccessor** ElementsAccessor::elements_accessors_ = NULL;
3864 } // namespace internal 3864 } // namespace internal
3865 } // namespace v8 3865 } // namespace v8
OLDNEW
« src/code-stub-assembler.h ('K') | « src/code-stub-assembler.cc ('k') | src/ic/ic.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698