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

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

Issue 2874423003: [csa] Add ToLength and ToString variants with inlined fast checks (Closed)
Patch Set: ToString 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 835 matching lines...) Expand 10 before | Expand all | Expand 10 after
846 // Convert any object to a Number. 846 // Convert any object to a Number.
847 Node* ToNumber(Node* context, Node* input); 847 Node* ToNumber(Node* context, Node* input);
848 848
849 // Converts |input| to one of 2^32 integer values in the range 0 through 849 // Converts |input| to one of 2^32 integer values in the range 0 through
850 // 2^32-1, inclusive. 850 // 2^32-1, inclusive.
851 // ES#sec-touint32 851 // ES#sec-touint32
852 compiler::Node* ToUint32(compiler::Node* context, compiler::Node* input); 852 compiler::Node* ToUint32(compiler::Node* context, compiler::Node* input);
853 853
854 // Convert any object to a String. 854 // Convert any object to a String.
855 Node* ToString(Node* context, Node* input); 855 Node* ToString(Node* context, Node* input);
856 Node* ToString_Inline(Node* const context, Node* const input);
856 857
857 // Convert any object to a Primitive. 858 // Convert any object to a Primitive.
858 Node* JSReceiverToPrimitive(Node* context, Node* input); 859 Node* JSReceiverToPrimitive(Node* context, Node* input);
859 860
860 enum ToIntegerTruncationMode { 861 enum ToIntegerTruncationMode {
861 kNoTruncation, 862 kNoTruncation,
862 kTruncateMinusZero, 863 kTruncateMinusZero,
863 }; 864 };
864 865
865 // ES6 7.1.17 ToIndex, but jumps to range_error if the result is not a Smi. 866 // ES6 7.1.17 ToIndex, but jumps to range_error if the result is not a Smi.
866 Node* ToSmiIndex(Node* const input, Node* const context, Label* range_error); 867 Node* ToSmiIndex(Node* const input, Node* const context, Label* range_error);
867 868
868 // ES6 7.1.15 ToLength, but jumps to range_error if the result is not a Smi. 869 // ES6 7.1.15 ToLength, but jumps to range_error if the result is not a Smi.
869 Node* ToSmiLength(Node* input, Node* const context, Label* range_error); 870 Node* ToSmiLength(Node* input, Node* const context, Label* range_error);
870 871
872 // ES6 7.1.15 ToLength, but with inlined fast path.
873 Node* ToLength_Inline(Node* const context, Node* const input);
874
871 // Convert any object to an Integer. 875 // Convert any object to an Integer.
872 Node* ToInteger(Node* context, Node* input, 876 Node* ToInteger(Node* context, Node* input,
873 ToIntegerTruncationMode mode = kNoTruncation); 877 ToIntegerTruncationMode mode = kNoTruncation);
874 878
875 // Returns a node that contains a decoded (unsigned!) value of a bit 879 // Returns a node that contains a decoded (unsigned!) value of a bit
876 // field |T| in |word32|. Returns result as an uint32 node. 880 // field |T| in |word32|. Returns result as an uint32 node.
877 template <typename T> 881 template <typename T>
878 Node* DecodeWord32(Node* word32) { 882 Node* DecodeWord32(Node* word32) {
879 return DecodeWord32(word32, T::kShift, T::kMask); 883 return DecodeWord32(word32, T::kShift, T::kMask);
880 } 884 }
(...skipping 739 matching lines...) Expand 10 before | Expand all | Expand 10 after
1620 } 1624 }
1621 #else 1625 #else
1622 #define CSA_SLOW_ASSERT(csa, x) ((void)0) 1626 #define CSA_SLOW_ASSERT(csa, x) ((void)0)
1623 #endif 1627 #endif
1624 1628
1625 DEFINE_OPERATORS_FOR_FLAGS(CodeStubAssembler::AllocationFlags); 1629 DEFINE_OPERATORS_FOR_FLAGS(CodeStubAssembler::AllocationFlags);
1626 1630
1627 } // namespace internal 1631 } // namespace internal
1628 } // namespace v8 1632 } // namespace v8
1629 #endif // V8_CODE_STUB_ASSEMBLER_H_ 1633 #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