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 #ifndef V8_CODE_STUB_ASSEMBLER_H_ | 5 #ifndef V8_CODE_STUB_ASSEMBLER_H_ |
6 #define V8_CODE_STUB_ASSEMBLER_H_ | 6 #define V8_CODE_STUB_ASSEMBLER_H_ |
7 | 7 |
8 #include <functional> | 8 #include <functional> |
9 | 9 |
10 #include "src/compiler/code-assembler.h" | 10 #include "src/compiler/code-assembler.h" |
(...skipping 787 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
798 Node* IsHoleyFastElementsKind(Node* elements_kind); | 798 Node* IsHoleyFastElementsKind(Node* elements_kind); |
799 Node* IsElementsKindGreaterThan(Node* target_kind, | 799 Node* IsElementsKindGreaterThan(Node* target_kind, |
800 ElementsKind reference_kind); | 800 ElementsKind reference_kind); |
801 | 801 |
802 // String helpers. | 802 // String helpers. |
803 // Load a character from a String (might flatten a ConsString). | 803 // Load a character from a String (might flatten a ConsString). |
804 Node* StringCharCodeAt(Node* string, Node* index, | 804 Node* StringCharCodeAt(Node* string, Node* index, |
805 ParameterMode parameter_mode = SMI_PARAMETERS); | 805 ParameterMode parameter_mode = SMI_PARAMETERS); |
806 // Return the single character string with only {code}. | 806 // Return the single character string with only {code}. |
807 Node* StringFromCharCode(Node* code); | 807 Node* StringFromCharCode(Node* code); |
| 808 |
| 809 enum class SubStringFlags { NONE, FROM_TO_ARE_BOUNDED }; |
| 810 |
808 // Return a new string object which holds a substring containing the range | 811 // Return a new string object which holds a substring containing the range |
809 // [from,to[ of string. |from| and |to| are expected to be tagged. | 812 // [from,to[ of string. |from| and |to| are expected to be tagged. |
810 Node* SubString(Node* context, Node* string, Node* from, Node* to); | 813 // If flags has the value FROM_TO_ARE_BOUNDED then from and to are in |
| 814 // the range [0, string-length) |
| 815 Node* SubString(Node* context, Node* string, Node* from, Node* to, |
| 816 SubStringFlags flags = SubStringFlags::NONE); |
811 | 817 |
812 // Return a new string object produced by concatenating |first| with |second|. | 818 // Return a new string object produced by concatenating |first| with |second|. |
813 Node* StringAdd(Node* context, Node* first, Node* second, | 819 Node* StringAdd(Node* context, Node* first, Node* second, |
814 AllocationFlags flags = kNone); | 820 AllocationFlags flags = kNone); |
815 | 821 |
816 // Unpack the external string, returning a pointer that (offset-wise) looks | 822 // Unpack the external string, returning a pointer that (offset-wise) looks |
817 // like a sequential string. | 823 // like a sequential string. |
818 // Note that this pointer is not tagged and does not point to a real | 824 // Note that this pointer is not tagged and does not point to a real |
819 // sequential string instance, and may only be used to access the string | 825 // sequential string instance, and may only be used to access the string |
820 // data. The pointer is GC-safe as long as a reference to the container | 826 // data. The pointer is GC-safe as long as a reference to the container |
(...skipping 799 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1620 } | 1626 } |
1621 #else | 1627 #else |
1622 #define CSA_SLOW_ASSERT(csa, x) ((void)0) | 1628 #define CSA_SLOW_ASSERT(csa, x) ((void)0) |
1623 #endif | 1629 #endif |
1624 | 1630 |
1625 DEFINE_OPERATORS_FOR_FLAGS(CodeStubAssembler::AllocationFlags); | 1631 DEFINE_OPERATORS_FOR_FLAGS(CodeStubAssembler::AllocationFlags); |
1626 | 1632 |
1627 } // namespace internal | 1633 } // namespace internal |
1628 } // namespace v8 | 1634 } // namespace v8 |
1629 #endif // V8_CODE_STUB_ASSEMBLER_H_ | 1635 #endif // V8_CODE_STUB_ASSEMBLER_H_ |
OLD | NEW |