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 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
352 // Store the Map of an HeapObject. | 352 // Store the Map of an HeapObject. |
353 compiler::Node* StoreMapNoWriteBarrier(compiler::Node* object, | 353 compiler::Node* StoreMapNoWriteBarrier(compiler::Node* object, |
354 compiler::Node* map); | 354 compiler::Node* map); |
355 compiler::Node* StoreObjectFieldRoot(compiler::Node* object, int offset, | 355 compiler::Node* StoreObjectFieldRoot(compiler::Node* object, int offset, |
356 Heap::RootListIndex root); | 356 Heap::RootListIndex root); |
357 // Store an array element to a FixedArray. | 357 // Store an array element to a FixedArray. |
358 compiler::Node* StoreFixedArrayElement( | 358 compiler::Node* StoreFixedArrayElement( |
359 compiler::Node* object, int index, compiler::Node* value, | 359 compiler::Node* object, int index, compiler::Node* value, |
360 WriteBarrierMode barrier_mode = UPDATE_WRITE_BARRIER, | 360 WriteBarrierMode barrier_mode = UPDATE_WRITE_BARRIER, |
361 ParameterMode parameter_mode = INTEGER_PARAMETERS) { | 361 ParameterMode parameter_mode = INTEGER_PARAMETERS) { |
362 return StoreFixedArrayElement(object, Int32Constant(index), value, | 362 return StoreFixedArrayElement(object, Int32Constant(index), value, 0, |
Igor Sheludko
2016/11/22 12:05:08
While you are here: IntPtrOrSmiConstant(index, mod
Jakob Kummerow
2016/11/22 13:47:57
Done, kind of. |parameter_mode| is pretty meaningl
Igor Sheludko
2016/11/22 14:07:31
Indeed :)
| |
363 barrier_mode, parameter_mode); | 363 barrier_mode, parameter_mode); |
364 } | 364 } |
365 | 365 |
366 compiler::Node* StoreFixedArrayElement( | 366 compiler::Node* StoreFixedArrayElement( |
367 compiler::Node* object, compiler::Node* index, compiler::Node* value, | 367 compiler::Node* object, compiler::Node* index, compiler::Node* value, |
368 int additional_offset = 0, | |
Jakob Kummerow
2016/11/21 17:02:58
This mirrors LoadFixedArrayElement().
Igor Sheludko
2016/11/22 12:05:08
Since WriteBarrierMode is defined as an enum but n
Jakob Kummerow
2016/11/22 13:47:57
Yes -> followup.
| |
368 WriteBarrierMode barrier_mode = UPDATE_WRITE_BARRIER, | 369 WriteBarrierMode barrier_mode = UPDATE_WRITE_BARRIER, |
369 ParameterMode parameter_mode = INTEGER_PARAMETERS); | 370 ParameterMode parameter_mode = INTEGER_PARAMETERS); |
370 | 371 |
371 compiler::Node* StoreFixedDoubleArrayElement( | 372 compiler::Node* StoreFixedDoubleArrayElement( |
372 compiler::Node* object, compiler::Node* index, compiler::Node* value, | 373 compiler::Node* object, compiler::Node* index, compiler::Node* value, |
373 ParameterMode parameter_mode = INTEGER_PARAMETERS); | 374 ParameterMode parameter_mode = INTEGER_PARAMETERS); |
374 | 375 |
375 void StoreFieldsNoWriteBarrier(compiler::Node* start_address, | 376 void StoreFieldsNoWriteBarrier(compiler::Node* start_address, |
376 compiler::Node* end_address, | 377 compiler::Node* end_address, |
377 compiler::Node* value); | 378 compiler::Node* value); |
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
755 // See Dictionary::EntryToIndex(). | 756 // See Dictionary::EntryToIndex(). |
756 template <typename Dictionary> | 757 template <typename Dictionary> |
757 compiler::Node* EntryToIndex(compiler::Node* entry, int field_index); | 758 compiler::Node* EntryToIndex(compiler::Node* entry, int field_index); |
758 template <typename Dictionary> | 759 template <typename Dictionary> |
759 compiler::Node* EntryToIndex(compiler::Node* entry) { | 760 compiler::Node* EntryToIndex(compiler::Node* entry) { |
760 return EntryToIndex<Dictionary>(entry, Dictionary::kEntryKeyIndex); | 761 return EntryToIndex<Dictionary>(entry, Dictionary::kEntryKeyIndex); |
761 } | 762 } |
762 // Calculate a valid size for the a hash table. | 763 // Calculate a valid size for the a hash table. |
763 compiler::Node* HashTableComputeCapacity(compiler::Node* at_least_space_for); | 764 compiler::Node* HashTableComputeCapacity(compiler::Node* at_least_space_for); |
764 | 765 |
766 template <class Dictionary> | |
767 compiler::Node* GetNumberOfElements(compiler::Node* dictionary); | |
768 | |
769 template <class Dictionary> | |
770 void SetNumberOfElements(compiler::Node* dictionary, | |
771 compiler::Node* num_elements_smi); | |
772 | |
773 template <class Dictionary> | |
774 compiler::Node* GetCapacity(compiler::Node* dictionary); | |
775 | |
776 template <class Dictionary> | |
777 compiler::Node* GetNextEnumerationIndex(compiler::Node* dictionary); | |
778 | |
779 template <class Dictionary> | |
780 void SetNextEnumerationIndex(compiler::Node* dictionary, | |
781 compiler::Node* next_enum_index_smi); | |
782 | |
765 // Looks up an entry in a NameDictionaryBase successor. If the entry is found | 783 // Looks up an entry in a NameDictionaryBase successor. If the entry is found |
766 // control goes to {if_found} and {var_name_index} contains an index of the | 784 // control goes to {if_found} and {var_name_index} contains an index of the |
767 // key field of the entry found. If the key is not found control goes to | 785 // key field of the entry found. If the key is not found control goes to |
768 // {if_not_found}. | 786 // {if_not_found}. |
769 static const int kInlinedDictionaryProbes = 4; | 787 static const int kInlinedDictionaryProbes = 4; |
788 enum LookupMode { kFindExisting, kFindInsertionIndex }; | |
770 template <typename Dictionary> | 789 template <typename Dictionary> |
771 void NameDictionaryLookup(compiler::Node* dictionary, | 790 void NameDictionaryLookup(compiler::Node* dictionary, |
772 compiler::Node* unique_name, Label* if_found, | 791 compiler::Node* unique_name, Label* if_found, |
773 Variable* var_name_index, Label* if_not_found, | 792 Variable* var_name_index, Label* if_not_found, |
774 int inlined_probes = kInlinedDictionaryProbes); | 793 int inlined_probes = kInlinedDictionaryProbes, |
794 LookupMode mode = kFindExisting); | |
775 | 795 |
776 compiler::Node* ComputeIntegerHash(compiler::Node* key, compiler::Node* seed); | 796 compiler::Node* ComputeIntegerHash(compiler::Node* key, compiler::Node* seed); |
777 | 797 |
778 template <typename Dictionary> | 798 template <typename Dictionary> |
779 void NumberDictionaryLookup(compiler::Node* dictionary, | 799 void NumberDictionaryLookup(compiler::Node* dictionary, |
780 compiler::Node* intptr_index, Label* if_found, | 800 compiler::Node* intptr_index, Label* if_found, |
781 Variable* var_entry, Label* if_not_found); | 801 Variable* var_entry, Label* if_not_found); |
782 | 802 |
803 template <class Dictionary> | |
804 void FindInsertionEntry(compiler::Node* dictionary, compiler::Node* key, | |
805 Variable* var_key_index); | |
806 | |
807 template <class Dictionary> | |
808 void Add(compiler::Node* dictionary, compiler::Node* key, | |
809 compiler::Node* value, Label* bailout); | |
810 | |
783 // Tries to check if {object} has own {unique_name} property. | 811 // Tries to check if {object} has own {unique_name} property. |
784 void TryHasOwnProperty(compiler::Node* object, compiler::Node* map, | 812 void TryHasOwnProperty(compiler::Node* object, compiler::Node* map, |
785 compiler::Node* instance_type, | 813 compiler::Node* instance_type, |
786 compiler::Node* unique_name, Label* if_found, | 814 compiler::Node* unique_name, Label* if_found, |
787 Label* if_not_found, Label* if_bailout); | 815 Label* if_not_found, Label* if_bailout); |
788 | 816 |
789 // Tries to get {object}'s own {unique_name} property value. If the property | 817 // Tries to get {object}'s own {unique_name} property value. If the property |
790 // is an accessor then it also calls a getter. If the property is a double | 818 // is an accessor then it also calls a getter. If the property is a double |
791 // field it re-wraps value in an immutable heap number. | 819 // field it re-wraps value in an immutable heap number. |
792 void TryGetOwnProperty(compiler::Node* context, compiler::Node* receiver, | 820 void TryGetOwnProperty(compiler::Node* context, compiler::Node* receiver, |
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1175 } | 1203 } |
1176 #else | 1204 #else |
1177 #define CSA_SLOW_ASSERT(csa, x) ((void)0) | 1205 #define CSA_SLOW_ASSERT(csa, x) ((void)0) |
1178 #endif | 1206 #endif |
1179 | 1207 |
1180 DEFINE_OPERATORS_FOR_FLAGS(CodeStubAssembler::AllocationFlags); | 1208 DEFINE_OPERATORS_FOR_FLAGS(CodeStubAssembler::AllocationFlags); |
1181 | 1209 |
1182 } // namespace internal | 1210 } // namespace internal |
1183 } // namespace v8 | 1211 } // namespace v8 |
1184 #endif // V8_CODE_STUB_ASSEMBLER_H_ | 1212 #endif // V8_CODE_STUB_ASSEMBLER_H_ |
OLD | NEW |