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 723 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
734 // 2^32−1, inclusive. | 734 // 2^32−1, inclusive. |
735 // ES#sec-touint32 | 735 // ES#sec-touint32 |
736 compiler::Node* ToUint32(compiler::Node* context, compiler::Node* input); | 736 compiler::Node* ToUint32(compiler::Node* context, compiler::Node* input); |
737 | 737 |
738 // Convert any object to a String. | 738 // Convert any object to a String. |
739 Node* ToString(Node* context, Node* input); | 739 Node* ToString(Node* context, Node* input); |
740 | 740 |
741 // Convert any object to a Primitive. | 741 // Convert any object to a Primitive. |
742 Node* JSReceiverToPrimitive(Node* context, Node* input); | 742 Node* JSReceiverToPrimitive(Node* context, Node* input); |
743 | 743 |
| 744 // Convert a String to a flat String. |
| 745 Node* FlattenString(Node* string); |
| 746 |
744 enum ToIntegerTruncationMode { | 747 enum ToIntegerTruncationMode { |
745 kNoTruncation, | 748 kNoTruncation, |
746 kTruncateMinusZero, | 749 kTruncateMinusZero, |
747 }; | 750 }; |
748 | 751 |
749 // Convert any object to an Integer. | 752 // Convert any object to an Integer. |
750 Node* ToInteger(Node* context, Node* input, | 753 Node* ToInteger(Node* context, Node* input, |
751 ToIntegerTruncationMode mode = kNoTruncation); | 754 ToIntegerTruncationMode mode = kNoTruncation); |
752 | 755 |
753 // Returns a node that contains a decoded (unsigned!) value of a bit | 756 // Returns a node that contains a decoded (unsigned!) value of a bit |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
846 void Increment(Variable& variable, int value = 1, | 849 void Increment(Variable& variable, int value = 1, |
847 ParameterMode mode = INTPTR_PARAMETERS); | 850 ParameterMode mode = INTPTR_PARAMETERS); |
848 | 851 |
849 // Generates "if (false) goto label" code. Useful for marking a label as | 852 // Generates "if (false) goto label" code. Useful for marking a label as |
850 // "live" to avoid assertion failures during graph building. In the resulting | 853 // "live" to avoid assertion failures during graph building. In the resulting |
851 // code this check will be eliminated. | 854 // code this check will be eliminated. |
852 void Use(Label* label); | 855 void Use(Label* label); |
853 | 856 |
854 // Various building blocks for stubs doing property lookups. | 857 // Various building blocks for stubs doing property lookups. |
855 void TryToName(Node* key, Label* if_keyisindex, Variable* var_index, | 858 void TryToName(Node* key, Label* if_keyisindex, Variable* var_index, |
856 Label* if_keyisunique, Variable* var_unique, | 859 Label* if_keyisunique, Label* if_bailout); |
857 Label* if_bailout); | |
858 | 860 |
859 // Calculates array index for given dictionary entry and entry field. | 861 // Calculates array index for given dictionary entry and entry field. |
860 // See Dictionary::EntryToIndex(). | 862 // See Dictionary::EntryToIndex(). |
861 template <typename Dictionary> | 863 template <typename Dictionary> |
862 Node* EntryToIndex(Node* entry, int field_index); | 864 Node* EntryToIndex(Node* entry, int field_index); |
863 template <typename Dictionary> | 865 template <typename Dictionary> |
864 Node* EntryToIndex(Node* entry) { | 866 Node* EntryToIndex(Node* entry) { |
865 return EntryToIndex<Dictionary>(entry, Dictionary::kEntryKeyIndex); | 867 return EntryToIndex<Dictionary>(entry, Dictionary::kEntryKeyIndex); |
866 } | 868 } |
867 // Calculate a valid size for the a hash table. | 869 // Calculate a valid size for the a hash table. |
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1274 } | 1276 } |
1275 #else | 1277 #else |
1276 #define CSA_SLOW_ASSERT(csa, x) ((void)0) | 1278 #define CSA_SLOW_ASSERT(csa, x) ((void)0) |
1277 #endif | 1279 #endif |
1278 | 1280 |
1279 DEFINE_OPERATORS_FOR_FLAGS(CodeStubAssembler::AllocationFlags); | 1281 DEFINE_OPERATORS_FOR_FLAGS(CodeStubAssembler::AllocationFlags); |
1280 | 1282 |
1281 } // namespace internal | 1283 } // namespace internal |
1282 } // namespace v8 | 1284 } // namespace v8 |
1283 #endif // V8_CODE_STUB_ASSEMBLER_H_ | 1285 #endif // V8_CODE_STUB_ASSEMBLER_H_ |
OLD | NEW |