v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
move-optimizer.h
Go to the documentation of this file.
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.
4
5#ifndef V8_COMPILER_BACKEND_MOVE_OPTIMIZER_H_
6#define V8_COMPILER_BACKEND_MOVE_OPTIMIZER_H_
7
10
11namespace v8 {
12namespace internal {
13namespace compiler {
14
16 public:
17 MoveOptimizer(Zone* local_zone, InstructionSequence* code);
18 MoveOptimizer(const MoveOptimizer&) = delete;
20
21 void Run();
22
23 private:
25
26 InstructionSequence* code() const { return code_; }
27 Zone* local_zone() const { return local_zone_; }
28 Zone* code_zone() const { return code()->zone(); }
29 MoveOpVector& local_vector() { return local_vector_; }
30
31 // Consolidate moves into the first gap.
32 void CompressGaps(Instruction* instr);
33
34 // Attempt to push down to the last instruction those moves that can.
35 void CompressBlock(InstructionBlock* block);
36
37 // Consolidate moves into the first gap.
38 void CompressMoves(ParallelMove* left, MoveOpVector* right);
39
40 // Push down those moves in the gap of from that do not change the
41 // semantics of the from instruction, nor the semantics of the moves
42 // that remain behind.
43 void MigrateMoves(Instruction* to, Instruction* from);
44
45 void RemoveClobberedDestinations(Instruction* instruction);
46
47 const Instruction* LastInstruction(const InstructionBlock* block) const;
48
49 // Consolidate common moves appearing across all predecessors of a block.
50 void OptimizeMerge(InstructionBlock* block);
51 void FinalizeMoves(Instruction* instr);
52
56
57 // Reusable buffers for storing operand sets. We need at most two sets
58 // at any given time, so we create two buffers.
61};
62
63} // namespace compiler
64} // namespace internal
65} // namespace v8
66
67#endif // V8_COMPILER_BACKEND_MOVE_OPTIMIZER_H_
ZoneVector< InstructionOperand > operand_buffer2
MoveOptimizer & operator=(const MoveOptimizer &)=delete
InstructionSequence *const code_
MoveOptimizer(const MoveOptimizer &)=delete
ZoneVector< InstructionOperand > operand_buffer1
InstructionSequence * code() const
Handle< Code > code
ZoneList< RegExpInstruction > code_
Instruction * instr
#define V8_EXPORT_PRIVATE
Definition macros.h:460