Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(22)

Side by Side Diff: src/code-stub-assembler.h

Issue 2870013004: [builtins] String.prototype.slice as a CSA builtin. (Closed)
Patch Set: REBASE. Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/builtins/builtins-string-gen.cc ('k') | src/code-stub-assembler.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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_
OLDNEW
« no previous file with comments | « src/builtins/builtins-string-gen.cc ('k') | src/code-stub-assembler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698