| OLD | NEW |
| 1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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/builtins/builtins-utils.h" | 5 #include "src/builtins/builtins-utils.h" |
| 6 #include "src/builtins/builtins.h" | 6 #include "src/builtins/builtins.h" |
| 7 #include "src/code-factory.h" | 7 #include "src/code-factory.h" |
| 8 #include "src/code-stub-assembler.h" | 8 #include "src/code-stub-assembler.h" |
| 9 #include "src/regexp/regexp-utils.h" | 9 #include "src/regexp/regexp-utils.h" |
| 10 | 10 |
| (...skipping 846 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 857 } | 857 } |
| 858 | 858 |
| 859 // ES6 String.prototype.indexOf(searchString [, position]) | 859 // ES6 String.prototype.indexOf(searchString [, position]) |
| 860 // #sec-string.prototype.indexof | 860 // #sec-string.prototype.indexof |
| 861 // Unchecked helper for builtins lowering. | 861 // Unchecked helper for builtins lowering. |
| 862 TF_BUILTIN(StringIndexOf, StringBuiltinsAssembler) { | 862 TF_BUILTIN(StringIndexOf, StringBuiltinsAssembler) { |
| 863 Node* receiver = Parameter(0); | 863 Node* receiver = Parameter(0); |
| 864 Node* search_string = Parameter(1); | 864 Node* search_string = Parameter(1); |
| 865 Node* position = Parameter(2); | 865 Node* position = Parameter(2); |
| 866 | 866 |
| 867 Label call_runtime(this); | |
| 868 | |
| 869 Node* instance_type = LoadInstanceType(receiver); | 867 Node* instance_type = LoadInstanceType(receiver); |
| 870 Node* search_string_instance_type = LoadInstanceType(search_string); | 868 Node* search_string_instance_type = LoadInstanceType(search_string); |
| 871 | 869 |
| 872 StringIndexOf(receiver, instance_type, search_string, | 870 StringIndexOf(receiver, instance_type, search_string, |
| 873 search_string_instance_type, position, | 871 search_string_instance_type, position, |
| 874 [this](Node* result) { this->Return(result); }); | 872 [this](Node* result) { this->Return(result); }); |
| 875 } | 873 } |
| 876 | 874 |
| 877 // ES6 String.prototype.indexOf(searchString [, position]) | 875 // ES6 String.prototype.indexOf(searchString [, position]) |
| 878 // #sec-string.prototype.indexof | 876 // #sec-string.prototype.indexof |
| (...skipping 618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1497 CallRuntime(Runtime::kThrowIncompatibleMethodReceiver, context, | 1495 CallRuntime(Runtime::kThrowIncompatibleMethodReceiver, context, |
| 1498 HeapConstant(factory()->NewStringFromAsciiChecked( | 1496 HeapConstant(factory()->NewStringFromAsciiChecked( |
| 1499 "String Iterator.prototype.next", TENURED)), | 1497 "String Iterator.prototype.next", TENURED)), |
| 1500 iterator); | 1498 iterator); |
| 1501 Return(result); // Never reached. | 1499 Return(result); // Never reached. |
| 1502 } | 1500 } |
| 1503 } | 1501 } |
| 1504 | 1502 |
| 1505 } // namespace internal | 1503 } // namespace internal |
| 1506 } // namespace v8 | 1504 } // namespace v8 |
| OLD | NEW |