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
3 // found in the LICENSE file.
5 #ifndef V8_COMPILER_GAP_RESOLVER_H_
6 #define V8_COMPILER_GAP_RESOLVER_H_
8 #include "src/compiler/instruction.h"
14 class GapResolver FINAL {
16 // Interface used by the gap resolver to emit moves and swaps.
19 virtual ~Assembler() {}
22 virtual void AssembleMove(InstructionOperand* source,
23 InstructionOperand* destination) = 0;
25 virtual void AssembleSwap(InstructionOperand* source,
26 InstructionOperand* destination) = 0;
29 explicit GapResolver(Assembler* assembler) : assembler_(assembler) {}
31 // Resolve a set of parallel moves, emitting assembler instructions.
32 void Resolve(ParallelMove* parallel_move) const;
35 // Perform the given move, possibly requiring other moves to satisfy
37 void PerformMove(ZoneList<MoveOperands>* moves, MoveOperands* move) const;
39 // Assembler used to emit moves and save registers.
40 Assembler* const assembler_;
44 } // namespace v8::internal::compiler
46 #endif // V8_COMPILER_GAP_RESOLVER_H_