OLD | NEW |
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/builtins.h" | 5 #include "src/builtins.h" |
6 | 6 |
7 #include "src/api-arguments.h" | 7 #include "src/api-arguments.h" |
8 #include "src/api-natives.h" | 8 #include "src/api-natives.h" |
9 #include "src/api.h" | 9 #include "src/api.h" |
10 #include "src/base/once.h" | 10 #include "src/base/once.h" |
(...skipping 4536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4547 assembler->Return(assembler->NaNConstant()); | 4547 assembler->Return(assembler->NaNConstant()); |
4548 assembler->Bind(&if_positioninbounds); | 4548 assembler->Bind(&if_positioninbounds); |
4549 } | 4549 } |
4550 | 4550 |
4551 // Load the character at the {position} from the {receiver}. | 4551 // Load the character at the {position} from the {receiver}. |
4552 Node* value = assembler->StringCharCodeAt(receiver, position); | 4552 Node* value = assembler->StringCharCodeAt(receiver, position); |
4553 Node* result = assembler->SmiFromWord32(value); | 4553 Node* result = assembler->SmiFromWord32(value); |
4554 assembler->Return(result); | 4554 assembler->Return(result); |
4555 } | 4555 } |
4556 | 4556 |
4557 // ES6 section 21.1.3.22 String.prototype.toLowerCase ( ) | |
4558 BUILTIN(StringPrototypeToLowerCase) { | |
4559 HandleScope scope(isolate); | |
4560 TO_THIS_STRING(string, "String.prototype.toLowerCase"); | |
4561 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, string, | |
4562 String::ToLowerCase(string)); | |
4563 return *string; | |
4564 } | |
4565 | |
4566 // ES6 section 21.1.3.24 String.prototype.toUpperCase ( ) | |
4567 BUILTIN(StringPrototypeToUpperCase) { | |
4568 HandleScope scope(isolate); | |
4569 TO_THIS_STRING(string, "String.prototype.toUpperCase"); | |
4570 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, string, | |
4571 String::ToUpperCase(string)); | |
4572 return *string; | |
4573 } | |
4574 | |
4575 // ES6 section 21.1.3.25 String.prototype.trim () | 4557 // ES6 section 21.1.3.25 String.prototype.trim () |
4576 BUILTIN(StringPrototypeTrim) { | 4558 BUILTIN(StringPrototypeTrim) { |
4577 HandleScope scope(isolate); | 4559 HandleScope scope(isolate); |
4578 TO_THIS_STRING(string, "String.prototype.trim"); | 4560 TO_THIS_STRING(string, "String.prototype.trim"); |
4579 return *String::Trim(string, String::kTrim); | 4561 return *String::Trim(string, String::kTrim); |
4580 } | 4562 } |
4581 | 4563 |
4582 // Non-standard WebKit extension | 4564 // Non-standard WebKit extension |
4583 BUILTIN(StringPrototypeTrimLeft) { | 4565 BUILTIN(StringPrototypeTrimLeft) { |
4584 HandleScope scope(isolate); | 4566 HandleScope scope(isolate); |
(...skipping 1033 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5618 BUILTIN_LIST_T(DEFINE_BUILTIN_ACCESSOR_T) | 5600 BUILTIN_LIST_T(DEFINE_BUILTIN_ACCESSOR_T) |
5619 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H) | 5601 BUILTIN_LIST_H(DEFINE_BUILTIN_ACCESSOR_H) |
5620 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) | 5602 BUILTIN_LIST_DEBUG_A(DEFINE_BUILTIN_ACCESSOR_A) |
5621 #undef DEFINE_BUILTIN_ACCESSOR_C | 5603 #undef DEFINE_BUILTIN_ACCESSOR_C |
5622 #undef DEFINE_BUILTIN_ACCESSOR_A | 5604 #undef DEFINE_BUILTIN_ACCESSOR_A |
5623 #undef DEFINE_BUILTIN_ACCESSOR_T | 5605 #undef DEFINE_BUILTIN_ACCESSOR_T |
5624 #undef DEFINE_BUILTIN_ACCESSOR_H | 5606 #undef DEFINE_BUILTIN_ACCESSOR_H |
5625 | 5607 |
5626 } // namespace internal | 5608 } // namespace internal |
5627 } // namespace v8 | 5609 } // namespace v8 |
OLD | NEW |