| 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 982 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 993 (ContainerType::kEntryValueIndex - ContainerType::kEntryKeyIndex) * | 993 (ContainerType::kEntryValueIndex - ContainerType::kEntryKeyIndex) * |
| 994 kPointerSize; | 994 kPointerSize; |
| 995 StoreFixedArrayElement(container, key_index, value, UPDATE_WRITE_BARRIER, | 995 StoreFixedArrayElement(container, key_index, value, UPDATE_WRITE_BARRIER, |
| 996 kKeyToValueOffset); | 996 kKeyToValueOffset); |
| 997 } | 997 } |
| 998 | 998 |
| 999 // Calculate a valid size for the a hash table. | 999 // Calculate a valid size for the a hash table. |
| 1000 Node* HashTableComputeCapacity(Node* at_least_space_for); | 1000 Node* HashTableComputeCapacity(Node* at_least_space_for); |
| 1001 | 1001 |
| 1002 template <class Dictionary> | 1002 template <class Dictionary> |
| 1003 Node* GetNumberOfElements(Node* dictionary); | 1003 Node* GetNumberOfElements(Node* dictionary) { |
| 1004 return LoadFixedArrayElement(dictionary, |
| 1005 Dictionary::kNumberOfElementsIndex); |
| 1006 } |
| 1004 | 1007 |
| 1005 template <class Dictionary> | 1008 template <class Dictionary> |
| 1006 void SetNumberOfElements(Node* dictionary, Node* num_elements_smi); | 1009 void SetNumberOfElements(Node* dictionary, Node* num_elements_smi) { |
| 1010 StoreFixedArrayElement(dictionary, Dictionary::kNumberOfElementsIndex, |
| 1011 num_elements_smi, SKIP_WRITE_BARRIER); |
| 1012 } |
| 1007 | 1013 |
| 1008 template <class Dictionary> | 1014 template <class Dictionary> |
| 1009 Node* GetNumberOfDeletedElements(Node* dictionary); | 1015 Node* GetNumberOfDeletedElements(Node* dictionary) { |
| 1016 return LoadFixedArrayElement(dictionary, |
| 1017 Dictionary::kNumberOfDeletedElementsIndex); |
| 1018 } |
| 1010 | 1019 |
| 1011 template <class Dictionary> | 1020 template <class Dictionary> |
| 1012 Node* GetCapacity(Node* dictionary); | 1021 void SetNumberOfDeletedElements(Node* dictionary, Node* num_deleted_smi) { |
| 1022 StoreFixedArrayElement(dictionary, |
| 1023 Dictionary::kNumberOfDeletedElementsIndex, |
| 1024 num_deleted_smi, SKIP_WRITE_BARRIER); |
| 1025 } |
| 1026 |
| 1027 template <class Dictionary> |
| 1028 Node* GetCapacity(Node* dictionary) { |
| 1029 return LoadFixedArrayElement(dictionary, Dictionary::kCapacityIndex); |
| 1030 } |
| 1013 | 1031 |
| 1014 template <class Dictionary> | 1032 template <class Dictionary> |
| 1015 Node* GetNextEnumerationIndex(Node* dictionary); | 1033 Node* GetNextEnumerationIndex(Node* dictionary); |
| 1016 | 1034 |
| 1017 template <class Dictionary> | 1035 template <class Dictionary> |
| 1018 void SetNextEnumerationIndex(Node* dictionary, Node* next_enum_index_smi); | 1036 void SetNextEnumerationIndex(Node* dictionary, Node* next_enum_index_smi); |
| 1019 | 1037 |
| 1020 // Looks up an entry in a NameDictionaryBase successor. If the entry is found | 1038 // Looks up an entry in a NameDictionaryBase successor. If the entry is found |
| 1021 // control goes to {if_found} and {var_name_index} contains an index of the | 1039 // control goes to {if_found} and {var_name_index} contains an index of the |
| 1022 // key field of the entry found. If the key is not found control goes to | 1040 // key field of the entry found. If the key is not found control goes to |
| (...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1338 protected: | 1356 protected: |
| 1339 void DescriptorLookup(Node* unique_name, Node* descriptors, Node* bitfield3, | 1357 void DescriptorLookup(Node* unique_name, Node* descriptors, Node* bitfield3, |
| 1340 Label* if_found, Variable* var_name_index, | 1358 Label* if_found, Variable* var_name_index, |
| 1341 Label* if_not_found); | 1359 Label* if_not_found); |
| 1342 void DescriptorLookupLinear(Node* unique_name, Node* descriptors, Node* nof, | 1360 void DescriptorLookupLinear(Node* unique_name, Node* descriptors, Node* nof, |
| 1343 Label* if_found, Variable* var_name_index, | 1361 Label* if_found, Variable* var_name_index, |
| 1344 Label* if_not_found); | 1362 Label* if_not_found); |
| 1345 void DescriptorLookupBinary(Node* unique_name, Node* descriptors, Node* nof, | 1363 void DescriptorLookupBinary(Node* unique_name, Node* descriptors, Node* nof, |
| 1346 Label* if_found, Variable* var_name_index, | 1364 Label* if_found, Variable* var_name_index, |
| 1347 Label* if_not_found); | 1365 Label* if_not_found); |
| 1366 // Implements DescriptorArray::ToKeyIndex. |
| 1367 // Returns an untagged IntPtr. |
| 1368 Node* DescriptorArrayToKeyIndex(Node* descriptor_number); |
| 1348 | 1369 |
| 1349 Node* CallGetterIfAccessor(Node* value, Node* details, Node* context, | 1370 Node* CallGetterIfAccessor(Node* value, Node* details, Node* context, |
| 1350 Node* receiver, Label* if_bailout); | 1371 Node* receiver, Label* if_bailout); |
| 1351 | 1372 |
| 1352 Node* TryToIntptr(Node* key, Label* miss); | 1373 Node* TryToIntptr(Node* key, Label* miss); |
| 1353 | 1374 |
| 1354 void BranchIfPrototypesHaveNoElements(Node* receiver_map, | 1375 void BranchIfPrototypesHaveNoElements(Node* receiver_map, |
| 1355 Label* definitely_no_elements, | 1376 Label* definitely_no_elements, |
| 1356 Label* possibly_elements); | 1377 Label* possibly_elements); |
| 1357 | 1378 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 1381 | 1402 |
| 1382 Node* AllocateSlicedString(Heap::RootListIndex map_root_index, Node* length, | 1403 Node* AllocateSlicedString(Heap::RootListIndex map_root_index, Node* length, |
| 1383 Node* parent, Node* offset); | 1404 Node* parent, Node* offset); |
| 1384 | 1405 |
| 1385 Node* AllocateConsString(Heap::RootListIndex map_root_index, Node* length, | 1406 Node* AllocateConsString(Heap::RootListIndex map_root_index, Node* length, |
| 1386 Node* first, Node* second, AllocationFlags flags); | 1407 Node* first, Node* second, AllocationFlags flags); |
| 1387 | 1408 |
| 1388 // Implements DescriptorArray::number_of_entries. | 1409 // Implements DescriptorArray::number_of_entries. |
| 1389 // Returns an untagged int32. | 1410 // Returns an untagged int32. |
| 1390 Node* DescriptorArrayNumberOfEntries(Node* descriptors); | 1411 Node* DescriptorArrayNumberOfEntries(Node* descriptors); |
| 1391 // Implements DescriptorArray::ToKeyIndex. | |
| 1392 // Returns an untagged IntPtr. | |
| 1393 Node* DescriptorArrayToKeyIndex(Node* descriptor_number); | |
| 1394 // Implements DescriptorArray::GetSortedKeyIndex. | 1412 // Implements DescriptorArray::GetSortedKeyIndex. |
| 1395 // Returns an untagged int32. | 1413 // Returns an untagged int32. |
| 1396 Node* DescriptorArrayGetSortedKeyIndex(Node* descriptors, | 1414 Node* DescriptorArrayGetSortedKeyIndex(Node* descriptors, |
| 1397 Node* descriptor_number); | 1415 Node* descriptor_number); |
| 1398 // Implements DescriptorArray::GetKey. | 1416 // Implements DescriptorArray::GetKey. |
| 1399 Node* DescriptorArrayGetKey(Node* descriptors, Node* descriptor_number); | 1417 Node* DescriptorArrayGetKey(Node* descriptors, Node* descriptor_number); |
| 1400 | 1418 |
| 1401 static const int kElementLoopUnrollThreshold = 8; | 1419 static const int kElementLoopUnrollThreshold = 8; |
| 1402 }; | 1420 }; |
| 1403 | 1421 |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1523 } | 1541 } |
| 1524 #else | 1542 #else |
| 1525 #define CSA_SLOW_ASSERT(csa, x) ((void)0) | 1543 #define CSA_SLOW_ASSERT(csa, x) ((void)0) |
| 1526 #endif | 1544 #endif |
| 1527 | 1545 |
| 1528 DEFINE_OPERATORS_FOR_FLAGS(CodeStubAssembler::AllocationFlags); | 1546 DEFINE_OPERATORS_FOR_FLAGS(CodeStubAssembler::AllocationFlags); |
| 1529 | 1547 |
| 1530 } // namespace internal | 1548 } // namespace internal |
| 1531 } // namespace v8 | 1549 } // namespace v8 |
| 1532 #endif // V8_CODE_STUB_ASSEMBLER_H_ | 1550 #endif // V8_CODE_STUB_ASSEMBLER_H_ |
| OLD | NEW |