blob: 695b3526ed9e3b2ac7c9500d5f2595a153bb616d [file] [log] [blame]
Steve Block1e0659c2011-05-24 12:43:12 +01001// Copyright 2011 the V8 project authors. All rights reserved.
Ben Murdochb8a8cc12014-11-26 15:28:44 +00002// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
Steve Block1e0659c2011-05-24 12:43:12 +01004
5#ifndef V8_X64_LITHIUM_GAP_RESOLVER_X64_H_
6#define V8_X64_LITHIUM_GAP_RESOLVER_X64_H_
7
Ben Murdochb8a8cc12014-11-26 15:28:44 +00008#include "src/v8.h"
Steve Block1e0659c2011-05-24 12:43:12 +01009
Ben Murdochb8a8cc12014-11-26 15:28:44 +000010#include "src/lithium.h"
Steve Block1e0659c2011-05-24 12:43:12 +010011
12namespace v8 {
13namespace internal {
14
15class LCodeGen;
16class LGapResolver;
17
Ben Murdochb8a8cc12014-11-26 15:28:44 +000018class LGapResolver FINAL BASE_EMBEDDED {
Steve Block1e0659c2011-05-24 12:43:12 +010019 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_