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-regexp.h" | 5 #include "src/builtins/builtins-regexp.h" |
6 #include "src/builtins/builtins-utils.h" | 6 #include "src/builtins/builtins-utils.h" |
7 #include "src/builtins/builtins.h" | 7 #include "src/builtins/builtins.h" |
8 #include "src/code-factory.h" | 8 #include "src/code-factory.h" |
9 #include "src/code-stub-assembler.h" | 9 #include "src/code-stub-assembler.h" |
10 #include "src/regexp/regexp-utils.h" | 10 #include "src/regexp/regexp-utils.h" |
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
410 TF_BUILTIN(StringGreaterThanOrEqual, StringBuiltinsAssembler) { | 410 TF_BUILTIN(StringGreaterThanOrEqual, StringBuiltinsAssembler) { |
411 GenerateStringRelationalComparison( | 411 GenerateStringRelationalComparison( |
412 RelationalComparisonMode::kGreaterThanOrEqual); | 412 RelationalComparisonMode::kGreaterThanOrEqual); |
413 } | 413 } |
414 | 414 |
415 TF_BUILTIN(StringCharAt, CodeStubAssembler) { | 415 TF_BUILTIN(StringCharAt, CodeStubAssembler) { |
416 Node* receiver = Parameter(0); | 416 Node* receiver = Parameter(0); |
417 Node* position = Parameter(1); | 417 Node* position = Parameter(1); |
418 | 418 |
419 // Load the character code at the {position} from the {receiver}. | 419 // Load the character code at the {position} from the {receiver}. |
420 Node* code = StringCharCodeAt(receiver, position, | 420 Node* code = StringCharCodeAt(receiver, position, INTPTR_PARAMETERS); |
421 CodeStubAssembler::INTPTR_PARAMETERS); | |
422 | 421 |
423 // And return the single character string with only that {code} | 422 // And return the single character string with only that {code} |
424 Node* result = StringFromCharCode(code); | 423 Node* result = StringFromCharCode(code); |
425 Return(result); | 424 Return(result); |
426 } | 425 } |
427 | 426 |
428 TF_BUILTIN(StringCharCodeAt, CodeStubAssembler) { | 427 TF_BUILTIN(StringCharCodeAt, CodeStubAssembler) { |
429 Node* receiver = Parameter(0); | 428 Node* receiver = Parameter(0); |
430 Node* position = Parameter(1); | 429 Node* position = Parameter(1); |
431 | 430 |
432 // Load the character code at the {position} from the {receiver}. | 431 // Load the character code at the {position} from the {receiver}. |
433 Node* code = StringCharCodeAt(receiver, position, | 432 Node* code = StringCharCodeAt(receiver, position, INTPTR_PARAMETERS); |
434 CodeStubAssembler::INTPTR_PARAMETERS); | |
435 | 433 |
436 // And return it as TaggedSigned value. | 434 // And return it as TaggedSigned value. |
437 // TODO(turbofan): Allow builtins to return values untagged. | 435 // TODO(turbofan): Allow builtins to return values untagged. |
438 Node* result = SmiFromWord32(code); | 436 Node* result = SmiFromWord32(code); |
439 Return(result); | 437 Return(result); |
440 } | 438 } |
441 | 439 |
442 // ----------------------------------------------------------------------------- | 440 // ----------------------------------------------------------------------------- |
443 // ES6 section 21.1 String Objects | 441 // ES6 section 21.1 String Objects |
444 | 442 |
(...skipping 1428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1873 CallRuntime(Runtime::kThrowIncompatibleMethodReceiver, context, | 1871 CallRuntime(Runtime::kThrowIncompatibleMethodReceiver, context, |
1874 HeapConstant(factory()->NewStringFromAsciiChecked( | 1872 HeapConstant(factory()->NewStringFromAsciiChecked( |
1875 "String Iterator.prototype.next", TENURED)), | 1873 "String Iterator.prototype.next", TENURED)), |
1876 iterator); | 1874 iterator); |
1877 Return(result); // Never reached. | 1875 Return(result); // Never reached. |
1878 } | 1876 } |
1879 } | 1877 } |
1880 | 1878 |
1881 } // namespace internal | 1879 } // namespace internal |
1882 } // namespace v8 | 1880 } // namespace v8 |
OLD | NEW |