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_MOVE_OPTIMIZER_
6 #define V8_COMPILER_MOVE_OPTIMIZER_
8 #include "src/compiler/instruction.h"
9 #include "src/zone-containers.h"
15 class MoveOptimizer FINAL {
17 MoveOptimizer(Zone* local_zone, InstructionSequence* code);
21 typedef ZoneVector<MoveOperands*> MoveOpVector;
22 typedef ZoneVector<GapInstruction*> GapInstructions;
24 InstructionSequence* code() const { return code_; }
25 Zone* local_zone() const { return local_zone_; }
26 Zone* code_zone() const { return code()->zone(); }
27 MoveOpVector& temp_vector_0() { return temp_vector_0_; }
28 MoveOpVector& temp_vector_1() { return temp_vector_1_; }
30 void CompressBlock(InstructionBlock* blocke);
31 void CompressMoves(MoveOpVector* eliminated, ParallelMove* left,
33 void FinalizeMoves(GapInstruction* gap);
35 Zone* const local_zone_;
36 InstructionSequence* const code_;
37 GapInstructions to_finalize_;
38 MoveOpVector temp_vector_0_;
39 MoveOpVector temp_vector_1_;
41 DISALLOW_COPY_AND_ASSIGN(MoveOptimizer);
44 } // namespace compiler
45 } // namespace internal
48 #endif // V8_COMPILER_MOVE_OPTIMIZER_