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_GAP_RESOLVER_H_ | 5 #ifndef V8_COMPILER_GAP_RESOLVER_H_ |
6 #define V8_COMPILER_GAP_RESOLVER_H_ | 6 #define V8_COMPILER_GAP_RESOLVER_H_ |
7 | 7 |
8 #include "src/compiler/instruction.h" | 8 #include "src/compiler/instruction.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
11 namespace internal { | 11 namespace internal { |
12 namespace compiler { | 12 namespace compiler { |
13 | 13 |
14 class GapResolver final { | 14 class GapResolver final { |
15 public: | 15 public: |
16 // Interface used by the gap resolver to emit moves and swaps. | 16 // Interface used by the gap resolver to emit moves and swaps. |
17 class Assembler { | 17 class Assembler { |
18 public: | 18 public: |
19 virtual ~Assembler() {} | 19 virtual ~Assembler() {} |
20 | 20 |
21 // Assemble move. | 21 // Assemble move. |
22 virtual void AssembleMove(InstructionOperand* source, | 22 virtual void AssembleMove(InstructionOperand* source, |
23 InstructionOperand* destination) = 0; | 23 InstructionOperand* destination) = 0; |
24 // Assemble swap. | 24 // Assemble swap. |
25 virtual void AssembleSwap(InstructionOperand* source, | 25 virtual void AssembleSwap(InstructionOperand* source, |
26 InstructionOperand* destination) = 0; | 26 InstructionOperand* destination) = 0; |
27 }; | 27 }; |
28 | 28 |
29 explicit GapResolver(Assembler* assembler) : assembler_(assembler) {} | 29 explicit GapResolver(Assembler* assembler) |
30 : assembler_(assembler), split_rep_(MachineRepresentation::kSimd128) {} | |
30 | 31 |
31 // Resolve a set of parallel moves, emitting assembler instructions. | 32 // Resolve a set of parallel moves, emitting assembler instructions. |
32 void Resolve(ParallelMove* parallel_move) const; | 33 void Resolve(ParallelMove* parallel_move); |
33 | 34 |
34 private: | 35 private: |
35 // Perform the given move, possibly requiring other moves to satisfy | 36 // Performs the given move, possibly performing other moves to unblock the |
36 // dependencies. | 37 // destination operand. |
37 void PerformMove(ParallelMove* moves, MoveOperands* move) const; | 38 void PerformMove(ParallelMove* moves, MoveOperands* move); |
38 | 39 |
39 // Assembler used to emit moves and save registers. | 40 // Assembler used to emit moves and save registers. |
40 Assembler* const assembler_; | 41 Assembler* const assembler_; |
42 | |
43 MachineRepresentation split_rep_; | |
Jarin
2016/10/18 11:44:28
Please, describe what this field means.
bbudge
2016/10/19 00:32:20
Done.
| |
41 }; | 44 }; |
42 | 45 |
43 } // namespace compiler | 46 } // namespace compiler |
44 } // namespace internal | 47 } // namespace internal |
45 } // namespace v8 | 48 } // namespace v8 |
46 | 49 |
47 #endif // V8_COMPILER_GAP_RESOLVER_H_ | 50 #endif // V8_COMPILER_GAP_RESOLVER_H_ |
OLD | NEW |