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