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 694 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
705 // 2^32−1, inclusive. | 705 // 2^32−1, inclusive. |
706 // ES#sec-touint32 | 706 // ES#sec-touint32 |
707 compiler::Node* ToUint32(compiler::Node* context, compiler::Node* input); | 707 compiler::Node* ToUint32(compiler::Node* context, compiler::Node* input); |
708 | 708 |
709 // Convert any object to a String. | 709 // Convert any object to a String. |
710 Node* ToString(Node* context, Node* input); | 710 Node* ToString(Node* context, Node* input); |
711 | 711 |
712 // Convert any object to a Primitive. | 712 // Convert any object to a Primitive. |
713 Node* JSReceiverToPrimitive(Node* context, Node* input); | 713 Node* JSReceiverToPrimitive(Node* context, Node* input); |
714 | 714 |
| 715 // Convert a String to a flat String. |
| 716 Node* FlattenString(Node* string); |
| 717 |
715 enum ToIntegerTruncationMode { | 718 enum ToIntegerTruncationMode { |
716 kNoTruncation, | 719 kNoTruncation, |
717 kTruncateMinusZero, | 720 kTruncateMinusZero, |
718 }; | 721 }; |
719 | 722 |
720 // Convert any object to an Integer. | 723 // Convert any object to an Integer. |
721 Node* ToInteger(Node* context, Node* input, | 724 Node* ToInteger(Node* context, Node* input, |
722 ToIntegerTruncationMode mode = kNoTruncation); | 725 ToIntegerTruncationMode mode = kNoTruncation); |
723 | 726 |
724 // Returns a node that contains a decoded (unsigned!) value of a bit | 727 // Returns a node that contains a decoded (unsigned!) value of a bit |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
808 void Increment(Variable& variable, int value = 1, | 811 void Increment(Variable& variable, int value = 1, |
809 ParameterMode mode = INTPTR_PARAMETERS); | 812 ParameterMode mode = INTPTR_PARAMETERS); |
810 | 813 |
811 // Generates "if (false) goto label" code. Useful for marking a label as | 814 // Generates "if (false) goto label" code. Useful for marking a label as |
812 // "live" to avoid assertion failures during graph building. In the resulting | 815 // "live" to avoid assertion failures during graph building. In the resulting |
813 // code this check will be eliminated. | 816 // code this check will be eliminated. |
814 void Use(Label* label); | 817 void Use(Label* label); |
815 | 818 |
816 // Various building blocks for stubs doing property lookups. | 819 // Various building blocks for stubs doing property lookups. |
817 void TryToName(Node* key, Label* if_keyisindex, Variable* var_index, | 820 void TryToName(Node* key, Label* if_keyisindex, Variable* var_index, |
818 Label* if_keyisunique, Variable* var_unique, | 821 Label* if_keyisunique, Label* if_bailout); |
819 Label* if_bailout); | |
820 | 822 |
821 // Calculates array index for given dictionary entry and entry field. | 823 // Calculates array index for given dictionary entry and entry field. |
822 // See Dictionary::EntryToIndex(). | 824 // See Dictionary::EntryToIndex(). |
823 template <typename Dictionary> | 825 template <typename Dictionary> |
824 Node* EntryToIndex(Node* entry, int field_index); | 826 Node* EntryToIndex(Node* entry, int field_index); |
825 template <typename Dictionary> | 827 template <typename Dictionary> |
826 Node* EntryToIndex(Node* entry) { | 828 Node* EntryToIndex(Node* entry) { |
827 return EntryToIndex<Dictionary>(entry, Dictionary::kEntryKeyIndex); | 829 return EntryToIndex<Dictionary>(entry, Dictionary::kEntryKeyIndex); |
828 } | 830 } |
829 // Calculate a valid size for the a hash table. | 831 // Calculate a valid size for the a hash table. |
(...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1250 } | 1252 } |
1251 #else | 1253 #else |
1252 #define CSA_SLOW_ASSERT(csa, x) ((void)0) | 1254 #define CSA_SLOW_ASSERT(csa, x) ((void)0) |
1253 #endif | 1255 #endif |
1254 | 1256 |
1255 DEFINE_OPERATORS_FOR_FLAGS(CodeStubAssembler::AllocationFlags); | 1257 DEFINE_OPERATORS_FOR_FLAGS(CodeStubAssembler::AllocationFlags); |
1256 | 1258 |
1257 } // namespace internal | 1259 } // namespace internal |
1258 } // namespace v8 | 1260 } // namespace v8 |
1259 #endif // V8_CODE_STUB_ASSEMBLER_H_ | 1261 #endif // V8_CODE_STUB_ASSEMBLER_H_ |
OLD | NEW |