Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(88)

Side by Side Diff: src/code-stub-assembler.h

Issue 2380953002: [stubs] Generalize loop handling in CodeStubAssembler and improve common loop performance (Closed)
Patch Set: Working version Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/code-stub-assembler.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 820 matching lines...) Expand 10 before | Expand all | Expand 10 after
831 // Create a new weak cell with a specified value and install it into a 831 // Create a new weak cell with a specified value and install it into a
832 // feedback vector. 832 // feedback vector.
833 compiler::Node* CreateWeakCellInFeedbackVector( 833 compiler::Node* CreateWeakCellInFeedbackVector(
834 compiler::Node* feedback_vector, compiler::Node* slot, 834 compiler::Node* feedback_vector, compiler::Node* slot,
835 compiler::Node* value); 835 compiler::Node* value);
836 836
837 // Create a new AllocationSite and install it into a feedback vector. 837 // Create a new AllocationSite and install it into a feedback vector.
838 compiler::Node* CreateAllocationSiteInFeedbackVector( 838 compiler::Node* CreateAllocationSiteInFeedbackVector(
839 compiler::Node* feedback_vector, compiler::Node* slot); 839 compiler::Node* feedback_vector, compiler::Node* slot);
840 840
841 enum class IndexAdvanceMode { kPre, kPost };
842
843 void BuildFastLoop(
844 MachineRepresentation index_rep, compiler::Node* start_index,
845 compiler::Node* end_index,
846 std::function<void(CodeStubAssembler* assembler, compiler::Node* index)>
847 body,
848 int increment, IndexAdvanceMode mode = IndexAdvanceMode::kPre);
849
850 enum class ForEachDirection { kForward, kReverse };
851
852 void BuildFastFixedArrayForEach(
853 compiler::Node* fixed_array, ElementsKind kind,
854 compiler::Node* first_element_inclusive,
855 compiler::Node* last_element_exclusive,
856 std::function<void(CodeStubAssembler* assembler,
857 compiler::Node* fixed_array, compiler::Node* offset)>
858 body,
859 ParameterMode mode = INTPTR_PARAMETERS,
860 ForEachDirection direction = ForEachDirection::kReverse);
861
841 compiler::Node* GetFixedArrayAllocationSize(compiler::Node* element_count, 862 compiler::Node* GetFixedArrayAllocationSize(compiler::Node* element_count,
842 ElementsKind kind, 863 ElementsKind kind,
843 ParameterMode mode) { 864 ParameterMode mode) {
844 return ElementOffsetFromIndex(element_count, kind, mode, 865 return ElementOffsetFromIndex(element_count, kind, mode,
845 FixedArray::kHeaderSize); 866 FixedArray::kHeaderSize);
846 } 867 }
847 868
848 private: 869 private:
849 enum ElementSupport { kOnlyProperties, kSupportElements }; 870 enum ElementSupport { kOnlyProperties, kSupportElements };
850 871
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
907 Label* bailout); 928 Label* bailout);
908 929
909 static const int kElementLoopUnrollThreshold = 8; 930 static const int kElementLoopUnrollThreshold = 8;
910 }; 931 };
911 932
912 DEFINE_OPERATORS_FOR_FLAGS(CodeStubAssembler::AllocationFlags); 933 DEFINE_OPERATORS_FOR_FLAGS(CodeStubAssembler::AllocationFlags);
913 934
914 } // namespace internal 935 } // namespace internal
915 } // namespace v8 936 } // namespace v8
916 #endif // V8_CODE_STUB_ASSEMBLER_H_ 937 #endif // V8_CODE_STUB_ASSEMBLER_H_
OLDNEW
« no previous file with comments | « no previous file | src/code-stub-assembler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698