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 908 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
919 | 919 |
920 void Increment(Variable& variable, int value = 1, | 920 void Increment(Variable& variable, int value = 1, |
921 ParameterMode mode = INTPTR_PARAMETERS); | 921 ParameterMode mode = INTPTR_PARAMETERS); |
922 | 922 |
923 // Generates "if (false) goto label" code. Useful for marking a label as | 923 // Generates "if (false) goto label" code. Useful for marking a label as |
924 // "live" to avoid assertion failures during graph building. In the resulting | 924 // "live" to avoid assertion failures during graph building. In the resulting |
925 // code this check will be eliminated. | 925 // code this check will be eliminated. |
926 void Use(Label* label); | 926 void Use(Label* label); |
927 | 927 |
928 // Various building blocks for stubs doing property lookups. | 928 // Various building blocks for stubs doing property lookups. |
| 929 |
| 930 // |if_notinternalized| is optional; |if_bailout| will be used by default. |
929 void TryToName(Node* key, Label* if_keyisindex, Variable* var_index, | 931 void TryToName(Node* key, Label* if_keyisindex, Variable* var_index, |
930 Label* if_keyisunique, Variable* var_unique, | 932 Label* if_keyisunique, Variable* var_unique, Label* if_bailout, |
931 Label* if_bailout); | 933 Label* if_notinternalized = nullptr); |
| 934 |
| 935 // Performs a hash computation and string table lookup for the given string, |
| 936 // and jumps to: |
| 937 // - |if_index| if the string is an array index like "123"; |var_index| |
| 938 // will contain the intptr representation of that index. |
| 939 // - |if_internalized| if the string exists in the string table; the |
| 940 // internalized version will be in |var_internalized|. |
| 941 // - |if_not_internalized| if the string is not in the string table (but |
| 942 // does not add it). |
| 943 // - |if_bailout| for unsupported cases (e.g. uncachable array index). |
| 944 void TryInternalizeString(Node* string, Label* if_index, Variable* var_index, |
| 945 Label* if_internalized, Variable* var_internalized, |
| 946 Label* if_not_internalized, Label* if_bailout); |
932 | 947 |
933 // Calculates array index for given dictionary entry and entry field. | 948 // Calculates array index for given dictionary entry and entry field. |
934 // See Dictionary::EntryToIndex(). | 949 // See Dictionary::EntryToIndex(). |
935 template <typename Dictionary> | 950 template <typename Dictionary> |
936 Node* EntryToIndex(Node* entry, int field_index); | 951 Node* EntryToIndex(Node* entry, int field_index); |
937 template <typename Dictionary> | 952 template <typename Dictionary> |
938 Node* EntryToIndex(Node* entry) { | 953 Node* EntryToIndex(Node* entry) { |
939 return EntryToIndex<Dictionary>(entry, Dictionary::kEntryKeyIndex); | 954 return EntryToIndex<Dictionary>(entry, Dictionary::kEntryKeyIndex); |
940 } | 955 } |
941 | 956 |
(...skipping 562 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1504 } | 1519 } |
1505 #else | 1520 #else |
1506 #define CSA_SLOW_ASSERT(csa, x) ((void)0) | 1521 #define CSA_SLOW_ASSERT(csa, x) ((void)0) |
1507 #endif | 1522 #endif |
1508 | 1523 |
1509 DEFINE_OPERATORS_FOR_FLAGS(CodeStubAssembler::AllocationFlags); | 1524 DEFINE_OPERATORS_FOR_FLAGS(CodeStubAssembler::AllocationFlags); |
1510 | 1525 |
1511 } // namespace internal | 1526 } // namespace internal |
1512 } // namespace v8 | 1527 } // namespace v8 |
1513 #endif // V8_CODE_STUB_ASSEMBLER_H_ | 1528 #endif // V8_CODE_STUB_ASSEMBLER_H_ |
OLD | NEW |