OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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_COMPILER_INSTRUCTION_H_ | 5 #ifndef V8_COMPILER_INSTRUCTION_H_ |
6 #define V8_COMPILER_INSTRUCTION_H_ | 6 #define V8_COMPILER_INSTRUCTION_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 #include <iosfwd> | 9 #include <iosfwd> |
10 #include <map> | 10 #include <map> |
(...skipping 615 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
626 | 626 |
627 | 627 |
628 class ParallelMove final : public ZoneVector<MoveOperands*>, public ZoneObject { | 628 class ParallelMove final : public ZoneVector<MoveOperands*>, public ZoneObject { |
629 public: | 629 public: |
630 explicit ParallelMove(Zone* zone) : ZoneVector<MoveOperands*>(zone) { | 630 explicit ParallelMove(Zone* zone) : ZoneVector<MoveOperands*>(zone) { |
631 reserve(4); | 631 reserve(4); |
632 } | 632 } |
633 | 633 |
634 MoveOperands* AddMove(const InstructionOperand& from, | 634 MoveOperands* AddMove(const InstructionOperand& from, |
635 const InstructionOperand& to) { | 635 const InstructionOperand& to) { |
636 auto zone = get_allocator().zone(); | 636 Zone* zone = get_allocator().zone(); |
637 auto move = new (zone) MoveOperands(from, to); | 637 return AddMove(from, to, zone); |
| 638 } |
| 639 |
| 640 MoveOperands* AddMove(const InstructionOperand& from, |
| 641 const InstructionOperand& to, |
| 642 Zone* operand_allocation_zone) { |
| 643 MoveOperands* move = new (operand_allocation_zone) MoveOperands(from, to); |
638 push_back(move); | 644 push_back(move); |
639 return move; | 645 return move; |
640 } | 646 } |
641 | 647 |
642 bool IsRedundant() const; | 648 bool IsRedundant() const; |
643 | 649 |
644 // Prepare this ParallelMove to insert move as if it happened in a subsequent | 650 // Prepare this ParallelMove to insert move as if it happened in a subsequent |
645 // ParallelMove. move->source() may be changed. The MoveOperand returned | 651 // ParallelMove. move->source() may be changed. The MoveOperand returned |
646 // must be Eliminated. | 652 // must be Eliminated. |
647 MoveOperands* PrepareInsertAfter(MoveOperands* move) const; | 653 MoveOperands* PrepareInsertAfter(MoveOperands* move) const; |
(...skipping 708 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1356 | 1362 |
1357 | 1363 |
1358 std::ostream& operator<<(std::ostream& os, | 1364 std::ostream& operator<<(std::ostream& os, |
1359 const PrintableInstructionSequence& code); | 1365 const PrintableInstructionSequence& code); |
1360 | 1366 |
1361 } // namespace compiler | 1367 } // namespace compiler |
1362 } // namespace internal | 1368 } // namespace internal |
1363 } // namespace v8 | 1369 } // namespace v8 |
1364 | 1370 |
1365 #endif // V8_COMPILER_INSTRUCTION_H_ | 1371 #endif // V8_COMPILER_INSTRUCTION_H_ |
OLD | NEW |