| 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 1073 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1084 BuildFastLoop(VariableList(0, zone()), index_rep, start_index, end_index, | 1084 BuildFastLoop(VariableList(0, zone()), index_rep, start_index, end_index, |
| 1085 body, increment, mode); | 1085 body, increment, mode); |
| 1086 } | 1086 } |
| 1087 | 1087 |
| 1088 enum class ForEachDirection { kForward, kReverse }; | 1088 enum class ForEachDirection { kForward, kReverse }; |
| 1089 | 1089 |
| 1090 typedef std::function<void(Node* fixed_array, Node* offset)> | 1090 typedef std::function<void(Node* fixed_array, Node* offset)> |
| 1091 FastFixedArrayForEachBody; | 1091 FastFixedArrayForEachBody; |
| 1092 | 1092 |
| 1093 void BuildFastFixedArrayForEach( | 1093 void BuildFastFixedArrayForEach( |
| 1094 const CodeStubAssembler::VariableList& vars, Node* fixed_array, |
| 1095 ElementsKind kind, Node* first_element_inclusive, |
| 1096 Node* last_element_exclusive, const FastFixedArrayForEachBody& body, |
| 1097 ParameterMode mode = INTPTR_PARAMETERS, |
| 1098 ForEachDirection direction = ForEachDirection::kReverse); |
| 1099 |
| 1100 void BuildFastFixedArrayForEach( |
| 1094 Node* fixed_array, ElementsKind kind, Node* first_element_inclusive, | 1101 Node* fixed_array, ElementsKind kind, Node* first_element_inclusive, |
| 1095 Node* last_element_exclusive, const FastFixedArrayForEachBody& body, | 1102 Node* last_element_exclusive, const FastFixedArrayForEachBody& body, |
| 1096 ParameterMode mode = INTPTR_PARAMETERS, | 1103 ParameterMode mode = INTPTR_PARAMETERS, |
| 1097 ForEachDirection direction = ForEachDirection::kReverse); | 1104 ForEachDirection direction = ForEachDirection::kReverse) { |
| 1105 CodeStubAssembler::VariableList list(0, zone()); |
| 1106 BuildFastFixedArrayForEach(list, fixed_array, kind, first_element_inclusive, |
| 1107 last_element_exclusive, body, mode, direction); |
| 1108 } |
| 1098 | 1109 |
| 1099 Node* GetArrayAllocationSize(Node* element_count, ElementsKind kind, | 1110 Node* GetArrayAllocationSize(Node* element_count, ElementsKind kind, |
| 1100 ParameterMode mode, int header_size) { | 1111 ParameterMode mode, int header_size) { |
| 1101 return ElementOffsetFromIndex(element_count, kind, mode, header_size); | 1112 return ElementOffsetFromIndex(element_count, kind, mode, header_size); |
| 1102 } | 1113 } |
| 1103 | 1114 |
| 1104 Node* GetFixedArrayAllocationSize(Node* element_count, ElementsKind kind, | 1115 Node* GetFixedArrayAllocationSize(Node* element_count, ElementsKind kind, |
| 1105 ParameterMode mode) { | 1116 ParameterMode mode) { |
| 1106 return GetArrayAllocationSize(element_count, kind, mode, | 1117 return GetArrayAllocationSize(element_count, kind, mode, |
| 1107 FixedArray::kHeaderSize); | 1118 FixedArray::kHeaderSize); |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1304 } | 1315 } |
| 1305 #else | 1316 #else |
| 1306 #define CSA_SLOW_ASSERT(csa, x) ((void)0) | 1317 #define CSA_SLOW_ASSERT(csa, x) ((void)0) |
| 1307 #endif | 1318 #endif |
| 1308 | 1319 |
| 1309 DEFINE_OPERATORS_FOR_FLAGS(CodeStubAssembler::AllocationFlags); | 1320 DEFINE_OPERATORS_FOR_FLAGS(CodeStubAssembler::AllocationFlags); |
| 1310 | 1321 |
| 1311 } // namespace internal | 1322 } // namespace internal |
| 1312 } // namespace v8 | 1323 } // namespace v8 |
| 1313 #endif // V8_CODE_STUB_ASSEMBLER_H_ | 1324 #endif // V8_CODE_STUB_ASSEMBLER_H_ |
| OLD | NEW |