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 806 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
817 // Create a new weak cell with a specified value and install it into a | 817 // Create a new weak cell with a specified value and install it into a |
818 // feedback vector. | 818 // feedback vector. |
819 compiler::Node* CreateWeakCellInFeedbackVector( | 819 compiler::Node* CreateWeakCellInFeedbackVector( |
820 compiler::Node* feedback_vector, compiler::Node* slot, | 820 compiler::Node* feedback_vector, compiler::Node* slot, |
821 compiler::Node* value); | 821 compiler::Node* value); |
822 | 822 |
823 // Create a new AllocationSite and install it into a feedback vector. | 823 // Create a new AllocationSite and install it into a feedback vector. |
824 compiler::Node* CreateAllocationSiteInFeedbackVector( | 824 compiler::Node* CreateAllocationSiteInFeedbackVector( |
825 compiler::Node* feedback_vector, compiler::Node* slot); | 825 compiler::Node* feedback_vector, compiler::Node* slot); |
826 | 826 |
| 827 enum class IndexAdvanceMode { kPre, kPost }; |
| 828 |
| 829 void BuildFastLoop( |
| 830 MachineRepresentation index_rep, compiler::Node* start_index, |
| 831 compiler::Node* end_index, |
| 832 std::function<void(CodeStubAssembler* assembler, compiler::Node* index)> |
| 833 body, |
| 834 int increment, IndexAdvanceMode mode = IndexAdvanceMode::kPre); |
| 835 |
| 836 enum class ForEachDirection { kForward, kReverse }; |
| 837 |
| 838 void BuildFastFixedArrayForEach( |
| 839 compiler::Node* fixed_array, ElementsKind kind, |
| 840 compiler::Node* first_element_inclusive, |
| 841 compiler::Node* last_element_exclusive, |
| 842 std::function<void(CodeStubAssembler* assembler, |
| 843 compiler::Node* fixed_array, compiler::Node* offset)> |
| 844 body, |
| 845 ParameterMode mode = INTPTR_PARAMETERS, |
| 846 ForEachDirection direction = ForEachDirection::kReverse); |
| 847 |
827 compiler::Node* GetFixedArrayAllocationSize(compiler::Node* element_count, | 848 compiler::Node* GetFixedArrayAllocationSize(compiler::Node* element_count, |
828 ElementsKind kind, | 849 ElementsKind kind, |
829 ParameterMode mode) { | 850 ParameterMode mode) { |
830 return ElementOffsetFromIndex(element_count, kind, mode, | 851 return ElementOffsetFromIndex(element_count, kind, mode, |
831 FixedArray::kHeaderSize); | 852 FixedArray::kHeaderSize); |
832 } | 853 } |
833 | 854 |
834 private: | 855 private: |
835 enum ElementSupport { kOnlyProperties, kSupportElements }; | 856 enum ElementSupport { kOnlyProperties, kSupportElements }; |
836 | 857 |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
893 Label* bailout); | 914 Label* bailout); |
894 | 915 |
895 static const int kElementLoopUnrollThreshold = 8; | 916 static const int kElementLoopUnrollThreshold = 8; |
896 }; | 917 }; |
897 | 918 |
898 DEFINE_OPERATORS_FOR_FLAGS(CodeStubAssembler::AllocationFlags); | 919 DEFINE_OPERATORS_FOR_FLAGS(CodeStubAssembler::AllocationFlags); |
899 | 920 |
900 } // namespace internal | 921 } // namespace internal |
901 } // namespace v8 | 922 } // namespace v8 |
902 #endif // V8_CODE_STUB_ASSEMBLER_H_ | 923 #endif // V8_CODE_STUB_ASSEMBLER_H_ |
OLD | NEW |