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 796 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
807 // Create a new weak cell with a specified value and install it into a | 807 // Create a new weak cell with a specified value and install it into a |
808 // feedback vector. | 808 // feedback vector. |
809 compiler::Node* CreateWeakCellInFeedbackVector( | 809 compiler::Node* CreateWeakCellInFeedbackVector( |
810 compiler::Node* feedback_vector, compiler::Node* slot, | 810 compiler::Node* feedback_vector, compiler::Node* slot, |
811 compiler::Node* value); | 811 compiler::Node* value); |
812 | 812 |
813 // Create a new AllocationSite and install it into a feedback vector. | 813 // Create a new AllocationSite and install it into a feedback vector. |
814 compiler::Node* CreateAllocationSiteInFeedbackVector( | 814 compiler::Node* CreateAllocationSiteInFeedbackVector( |
815 compiler::Node* feedback_vector, compiler::Node* slot); | 815 compiler::Node* feedback_vector, compiler::Node* slot); |
816 | 816 |
| 817 enum class IndexAdvanceMode { kPre, kPost }; |
| 818 |
| 819 void BuildFastLoop( |
| 820 MachineRepresentation index_rep, compiler::Node* start_index, |
| 821 compiler::Node* end_index, |
| 822 std::function<void(CodeStubAssembler* assembler, compiler::Node* index)> |
| 823 body, |
| 824 int increment, IndexAdvanceMode mode = IndexAdvanceMode::kPre); |
| 825 |
| 826 enum class ForEachDirection { kForward, kReverse }; |
| 827 |
| 828 void BuildFastFixedArrayForEach( |
| 829 compiler::Node* fixed_array, ElementsKind kind, |
| 830 compiler::Node* first_element_inclusive, |
| 831 compiler::Node* last_element_exclusive, |
| 832 std::function<void(CodeStubAssembler* assembler, |
| 833 compiler::Node* fixed_array, compiler::Node* offset)> |
| 834 body, |
| 835 ParameterMode mode = INTPTR_PARAMETERS, |
| 836 ForEachDirection direction = ForEachDirection::kReverse); |
| 837 |
817 compiler::Node* GetFixedAarrayAllocationSize(compiler::Node* element_count, | 838 compiler::Node* GetFixedAarrayAllocationSize(compiler::Node* element_count, |
818 ElementsKind kind, | 839 ElementsKind kind, |
819 ParameterMode mode) { | 840 ParameterMode mode) { |
820 return ElementOffsetFromIndex(element_count, kind, mode, | 841 return ElementOffsetFromIndex(element_count, kind, mode, |
821 FixedArray::kHeaderSize); | 842 FixedArray::kHeaderSize); |
822 } | 843 } |
823 | 844 |
824 private: | 845 private: |
825 enum ElementSupport { kOnlyProperties, kSupportElements }; | 846 enum ElementSupport { kOnlyProperties, kSupportElements }; |
826 | 847 |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
883 Label* bailout); | 904 Label* bailout); |
884 | 905 |
885 static const int kElementLoopUnrollThreshold = 8; | 906 static const int kElementLoopUnrollThreshold = 8; |
886 }; | 907 }; |
887 | 908 |
888 DEFINE_OPERATORS_FOR_FLAGS(CodeStubAssembler::AllocationFlags); | 909 DEFINE_OPERATORS_FOR_FLAGS(CodeStubAssembler::AllocationFlags); |
889 | 910 |
890 } // namespace internal | 911 } // namespace internal |
891 } // namespace v8 | 912 } // namespace v8 |
892 #endif // V8_CODE_STUB_ASSEMBLER_H_ | 913 #endif // V8_CODE_STUB_ASSEMBLER_H_ |
OLD | NEW |