Steve Block | 1e0659c | 2011-05-24 12:43:12 +0100 | [diff] [blame] | 1 | // Copyright 2011 the V8 project authors. All rights reserved. |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame^] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
Steve Block | 1e0659c | 2011-05-24 12:43:12 +0100 | [diff] [blame] | 4 | |
| 5 | #ifndef V8_X64_LITHIUM_GAP_RESOLVER_X64_H_ |
| 6 | #define V8_X64_LITHIUM_GAP_RESOLVER_X64_H_ |
| 7 | |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame^] | 8 | #include "src/v8.h" |
Steve Block | 1e0659c | 2011-05-24 12:43:12 +0100 | [diff] [blame] | 9 | |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame^] | 10 | #include "src/lithium.h" |
Steve Block | 1e0659c | 2011-05-24 12:43:12 +0100 | [diff] [blame] | 11 | |
| 12 | namespace v8 { |
| 13 | namespace internal { |
| 14 | |
| 15 | class LCodeGen; |
| 16 | class LGapResolver; |
| 17 | |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame^] | 18 | class LGapResolver FINAL BASE_EMBEDDED { |
Steve Block | 1e0659c | 2011-05-24 12:43:12 +0100 | [diff] [blame] | 19 | public: |
| 20 | explicit LGapResolver(LCodeGen* owner); |
| 21 | |
| 22 | // Resolve a set of parallel moves, emitting assembler instructions. |
| 23 | void Resolve(LParallelMove* parallel_move); |
| 24 | |
| 25 | private: |
| 26 | // Build the initial list of moves. |
| 27 | void BuildInitialMoveList(LParallelMove* parallel_move); |
| 28 | |
| 29 | // Perform the move at the moves_ index in question (possibly requiring |
| 30 | // other moves to satisfy dependencies). |
| 31 | void PerformMove(int index); |
| 32 | |
| 33 | // Emit a move and remove it from the move graph. |
| 34 | void EmitMove(int index); |
| 35 | |
| 36 | // Execute a move by emitting a swap of two operands. The move from |
| 37 | // source to destination is removed from the move graph. |
| 38 | void EmitSwap(int index); |
| 39 | |
| 40 | // Verify the move list before performing moves. |
| 41 | void Verify(); |
| 42 | |
| 43 | LCodeGen* cgen_; |
| 44 | |
| 45 | // List of moves not yet resolved. |
| 46 | ZoneList<LMoveOperands> moves_; |
| 47 | }; |
| 48 | |
| 49 | } } // namespace v8::internal |
| 50 | |
| 51 | #endif // V8_X64_LITHIUM_GAP_RESOLVER_X64_H_ |