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 500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
511 // |capacity| size respecting both array's elements kinds. | 511 // |capacity| size respecting both array's elements kinds. |
512 void CopyFixedArrayElements( | 512 void CopyFixedArrayElements( |
513 ElementsKind from_kind, compiler::Node* from_array, ElementsKind to_kind, | 513 ElementsKind from_kind, compiler::Node* from_array, ElementsKind to_kind, |
514 compiler::Node* to_array, compiler::Node* element_count, | 514 compiler::Node* to_array, compiler::Node* element_count, |
515 compiler::Node* capacity, | 515 compiler::Node* capacity, |
516 WriteBarrierMode barrier_mode = UPDATE_WRITE_BARRIER, | 516 WriteBarrierMode barrier_mode = UPDATE_WRITE_BARRIER, |
517 ParameterMode mode = INTEGER_PARAMETERS); | 517 ParameterMode mode = INTEGER_PARAMETERS); |
518 | 518 |
519 // Copies |character_count| elements from |from_string| to |to_string| | 519 // Copies |character_count| elements from |from_string| to |to_string| |
520 // starting at the |from_index|'th character. |from_string| and |to_string| | 520 // starting at the |from_index|'th character. |from_string| and |to_string| |
521 // must be either both one-byte strings or both two-byte strings. | 521 // can either be one-byte strings or two-byte strings, although if |
| 522 // |from_string| is two-byte, then |to_string| must be two-byte. |
522 // |from_index|, |to_index| and |character_count| must be either Smis or | 523 // |from_index|, |to_index| and |character_count| must be either Smis or |
523 // intptr_ts depending on |mode| s.t. 0 <= |from_index| <= |from_index| + | 524 // intptr_ts depending on |mode| s.t. 0 <= |from_index| <= |from_index| + |
524 // |character_count| <= from_string.length and 0 <= |to_index| <= |to_index| + | 525 // |character_count| <= from_string.length and 0 <= |to_index| <= |to_index| + |
525 // |character_count| <= to_string.length. | 526 // |character_count| <= to_string.length. |
526 void CopyStringCharacters(compiler::Node* from_string, | 527 void CopyStringCharacters(compiler::Node* from_string, |
527 compiler::Node* to_string, | 528 compiler::Node* to_string, |
528 compiler::Node* from_index, | 529 compiler::Node* from_index, |
529 compiler::Node* to_index, | 530 compiler::Node* to_index, |
530 compiler::Node* character_count, | 531 compiler::Node* character_count, |
531 String::Encoding encoding, ParameterMode mode); | 532 String::Encoding from_encoding, |
| 533 String::Encoding to_encoding, ParameterMode mode); |
532 | 534 |
533 // Loads an element from |array| of |from_kind| elements by given |offset| | 535 // Loads an element from |array| of |from_kind| elements by given |offset| |
534 // (NOTE: not index!), does a hole check if |if_hole| is provided and | 536 // (NOTE: not index!), does a hole check if |if_hole| is provided and |
535 // converts the value so that it becomes ready for storing to array of | 537 // converts the value so that it becomes ready for storing to array of |
536 // |to_kind| elements. | 538 // |to_kind| elements. |
537 compiler::Node* LoadElementAndPrepareForStore(compiler::Node* array, | 539 compiler::Node* LoadElementAndPrepareForStore(compiler::Node* array, |
538 compiler::Node* offset, | 540 compiler::Node* offset, |
539 ElementsKind from_kind, | 541 ElementsKind from_kind, |
540 ElementsKind to_kind, | 542 ElementsKind to_kind, |
541 Label* if_hole); | 543 Label* if_hole); |
(...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1016 compiler::Node* feedback_vector, compiler::Node* slot, | 1018 compiler::Node* feedback_vector, compiler::Node* slot, |
1017 compiler::Node* value); | 1019 compiler::Node* value); |
1018 | 1020 |
1019 // Create a new AllocationSite and install it into a feedback vector. | 1021 // Create a new AllocationSite and install it into a feedback vector. |
1020 compiler::Node* CreateAllocationSiteInFeedbackVector( | 1022 compiler::Node* CreateAllocationSiteInFeedbackVector( |
1021 compiler::Node* feedback_vector, compiler::Node* slot); | 1023 compiler::Node* feedback_vector, compiler::Node* slot); |
1022 | 1024 |
1023 enum class IndexAdvanceMode { kPre, kPost }; | 1025 enum class IndexAdvanceMode { kPre, kPost }; |
1024 | 1026 |
1025 void BuildFastLoop( | 1027 void BuildFastLoop( |
| 1028 const VariableList& var_list, MachineRepresentation index_rep, |
| 1029 compiler::Node* start_index, compiler::Node* end_index, |
| 1030 std::function<void(CodeStubAssembler* assembler, compiler::Node* index)> |
| 1031 body, |
| 1032 int increment, IndexAdvanceMode mode = IndexAdvanceMode::kPre); |
| 1033 |
| 1034 void BuildFastLoop( |
1026 MachineRepresentation index_rep, compiler::Node* start_index, | 1035 MachineRepresentation index_rep, compiler::Node* start_index, |
1027 compiler::Node* end_index, | 1036 compiler::Node* end_index, |
1028 std::function<void(CodeStubAssembler* assembler, compiler::Node* index)> | 1037 std::function<void(CodeStubAssembler* assembler, compiler::Node* index)> |
1029 body, | 1038 body, |
1030 int increment, IndexAdvanceMode mode = IndexAdvanceMode::kPre); | 1039 int increment, IndexAdvanceMode mode = IndexAdvanceMode::kPre) { |
| 1040 BuildFastLoop(VariableList(0, zone()), index_rep, start_index, end_index, |
| 1041 body, increment, mode); |
| 1042 } |
1031 | 1043 |
1032 enum class ForEachDirection { kForward, kReverse }; | 1044 enum class ForEachDirection { kForward, kReverse }; |
1033 | 1045 |
1034 void BuildFastFixedArrayForEach( | 1046 void BuildFastFixedArrayForEach( |
1035 compiler::Node* fixed_array, ElementsKind kind, | 1047 compiler::Node* fixed_array, ElementsKind kind, |
1036 compiler::Node* first_element_inclusive, | 1048 compiler::Node* first_element_inclusive, |
1037 compiler::Node* last_element_exclusive, | 1049 compiler::Node* last_element_exclusive, |
1038 std::function<void(CodeStubAssembler* assembler, | 1050 std::function<void(CodeStubAssembler* assembler, |
1039 compiler::Node* fixed_array, compiler::Node* offset)> | 1051 compiler::Node* fixed_array, compiler::Node* offset)> |
1040 body, | 1052 body, |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1204 } | 1216 } |
1205 #else | 1217 #else |
1206 #define CSA_SLOW_ASSERT(x) | 1218 #define CSA_SLOW_ASSERT(x) |
1207 #endif | 1219 #endif |
1208 | 1220 |
1209 DEFINE_OPERATORS_FOR_FLAGS(CodeStubAssembler::AllocationFlags); | 1221 DEFINE_OPERATORS_FOR_FLAGS(CodeStubAssembler::AllocationFlags); |
1210 | 1222 |
1211 } // namespace internal | 1223 } // namespace internal |
1212 } // namespace v8 | 1224 } // namespace v8 |
1213 #endif // V8_CODE_STUB_ASSEMBLER_H_ | 1225 #endif // V8_CODE_STUB_ASSEMBLER_H_ |
OLD | NEW |