| 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 735 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 746 Node* StringToNumber(Node* context, Node* input); | 746 Node* StringToNumber(Node* context, Node* input); |
| 747 Node* NumberToString(Node* context, Node* input); | 747 Node* NumberToString(Node* context, Node* input); |
| 748 // Convert an object to a name. | 748 // Convert an object to a name. |
| 749 Node* ToName(Node* context, Node* input); | 749 Node* ToName(Node* context, Node* input); |
| 750 // Convert a Non-Number object to a Number. | 750 // Convert a Non-Number object to a Number. |
| 751 Node* NonNumberToNumber(Node* context, Node* input); | 751 Node* NonNumberToNumber(Node* context, Node* input); |
| 752 // Convert any object to a Number. | 752 // Convert any object to a Number. |
| 753 Node* ToNumber(Node* context, Node* input); | 753 Node* ToNumber(Node* context, Node* input); |
| 754 | 754 |
| 755 // Converts |input| to one of 2^32 integer values in the range 0 through | 755 // Converts |input| to one of 2^32 integer values in the range 0 through |
| 756 // 2^32−1, inclusive. | 756 // 2^32-1, inclusive. |
| 757 // ES#sec-touint32 | 757 // ES#sec-touint32 |
| 758 compiler::Node* ToUint32(compiler::Node* context, compiler::Node* input); | 758 compiler::Node* ToUint32(compiler::Node* context, compiler::Node* input); |
| 759 | 759 |
| 760 // Convert any object to a String. | 760 // Convert any object to a String. |
| 761 Node* ToString(Node* context, Node* input); | 761 Node* ToString(Node* context, Node* input); |
| 762 | 762 |
| 763 // Convert any object to a Primitive. | 763 // Convert any object to a Primitive. |
| 764 Node* JSReceiverToPrimitive(Node* context, Node* input); | 764 Node* JSReceiverToPrimitive(Node* context, Node* input); |
| 765 | 765 |
| 766 enum ToIntegerTruncationMode { | 766 enum ToIntegerTruncationMode { |
| (...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1193 Node* deferred_promise, | 1193 Node* deferred_promise, |
| 1194 Node* deferred_on_resolve, | 1194 Node* deferred_on_resolve, |
| 1195 Node* deferred_on_reject, Node* context); | 1195 Node* deferred_on_reject, Node* context); |
| 1196 | 1196 |
| 1197 // Support for printf-style debugging | 1197 // Support for printf-style debugging |
| 1198 void Print(const char* s); | 1198 void Print(const char* s); |
| 1199 void Print(const char* prefix, Node* tagged_value); | 1199 void Print(const char* prefix, Node* tagged_value); |
| 1200 inline void Print(Node* tagged_value) { return Print(nullptr, tagged_value); } | 1200 inline void Print(Node* tagged_value) { return Print(nullptr, tagged_value); } |
| 1201 | 1201 |
| 1202 protected: | 1202 protected: |
| 1203 void DescriptorLookup(Node* unique_name, Node* descriptors, Node* bitfield3, |
| 1204 Label* if_found, Variable* var_name_index, |
| 1205 Label* if_not_found); |
| 1203 void DescriptorLookupLinear(Node* unique_name, Node* descriptors, Node* nof, | 1206 void DescriptorLookupLinear(Node* unique_name, Node* descriptors, Node* nof, |
| 1204 Label* if_found, Variable* var_name_index, | 1207 Label* if_found, Variable* var_name_index, |
| 1205 Label* if_not_found); | 1208 Label* if_not_found); |
| 1209 void DescriptorLookupBinary(Node* unique_name, Node* descriptors, Node* nof, |
| 1210 Label* if_found, Variable* var_name_index, |
| 1211 Label* if_not_found); |
| 1206 | 1212 |
| 1207 Node* CallGetterIfAccessor(Node* value, Node* details, Node* context, | 1213 Node* CallGetterIfAccessor(Node* value, Node* details, Node* context, |
| 1208 Node* receiver, Label* if_bailout); | 1214 Node* receiver, Label* if_bailout); |
| 1209 | 1215 |
| 1210 Node* TryToIntptr(Node* key, Label* miss); | 1216 Node* TryToIntptr(Node* key, Label* miss); |
| 1211 | 1217 |
| 1212 void BranchIfPrototypesHaveNoElements(Node* receiver_map, | 1218 void BranchIfPrototypesHaveNoElements(Node* receiver_map, |
| 1213 Label* definitely_no_elements, | 1219 Label* definitely_no_elements, |
| 1214 Label* possibly_elements); | 1220 Label* possibly_elements); |
| 1215 | 1221 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 1234 // otherwise. Returns either the loaded value or |value|. | 1240 // otherwise. Returns either the loaded value or |value|. |
| 1235 Node* EmitKeyedSloppyArguments(Node* receiver, Node* key, Node* value, | 1241 Node* EmitKeyedSloppyArguments(Node* receiver, Node* key, Node* value, |
| 1236 Label* bailout); | 1242 Label* bailout); |
| 1237 | 1243 |
| 1238 Node* AllocateSlicedString(Heap::RootListIndex map_root_index, Node* length, | 1244 Node* AllocateSlicedString(Heap::RootListIndex map_root_index, Node* length, |
| 1239 Node* parent, Node* offset); | 1245 Node* parent, Node* offset); |
| 1240 | 1246 |
| 1241 Node* AllocateConsString(Heap::RootListIndex map_root_index, Node* length, | 1247 Node* AllocateConsString(Heap::RootListIndex map_root_index, Node* length, |
| 1242 Node* first, Node* second, AllocationFlags flags); | 1248 Node* first, Node* second, AllocationFlags flags); |
| 1243 | 1249 |
| 1250 // Implements DescriptorArray::number_of_entries. |
| 1251 // Returns an untagged int32. |
| 1252 Node* DescriptorArrayNumberOfEntries(Node* descriptors); |
| 1253 // Implements DescriptorArray::ToKeyIndex. |
| 1254 // Returns an untagged IntPtr. |
| 1255 Node* DescriptorArrayToKeyIndex(Node* descriptor_number); |
| 1256 // Implements DescriptorArray::GetSortedKeyIndex. |
| 1257 // Returns an untagged int32. |
| 1258 Node* DescriptorArrayGetSortedKeyIndex(Node* descriptors, |
| 1259 Node* descriptor_number); |
| 1260 // Implements DescriptorArray::GetKey. |
| 1261 Node* DescriptorArrayGetKey(Node* descriptors, Node* descriptor_number); |
| 1262 |
| 1244 static const int kElementLoopUnrollThreshold = 8; | 1263 static const int kElementLoopUnrollThreshold = 8; |
| 1245 }; | 1264 }; |
| 1246 | 1265 |
| 1247 class CodeStubArguments { | 1266 class CodeStubArguments { |
| 1248 public: | 1267 public: |
| 1249 typedef compiler::Node Node; | 1268 typedef compiler::Node Node; |
| 1250 | 1269 |
| 1251 // |argc| is an uint32 value which specifies the number of arguments passed | 1270 // |argc| is an uint32 value which specifies the number of arguments passed |
| 1252 // to the builtin excluding the receiver. | 1271 // to the builtin excluding the receiver. |
| 1253 CodeStubArguments(CodeStubAssembler* assembler, Node* argc) | 1272 CodeStubArguments(CodeStubAssembler* assembler, Node* argc) |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1326 } | 1345 } |
| 1327 #else | 1346 #else |
| 1328 #define CSA_SLOW_ASSERT(csa, x) ((void)0) | 1347 #define CSA_SLOW_ASSERT(csa, x) ((void)0) |
| 1329 #endif | 1348 #endif |
| 1330 | 1349 |
| 1331 DEFINE_OPERATORS_FOR_FLAGS(CodeStubAssembler::AllocationFlags); | 1350 DEFINE_OPERATORS_FOR_FLAGS(CodeStubAssembler::AllocationFlags); |
| 1332 | 1351 |
| 1333 } // namespace internal | 1352 } // namespace internal |
| 1334 } // namespace v8 | 1353 } // namespace v8 |
| 1335 #endif // V8_CODE_STUB_ASSEMBLER_H_ | 1354 #endif // V8_CODE_STUB_ASSEMBLER_H_ |
| OLD | NEW |