OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_COMPILER_INSTRUCTION_SELECTOR_H_ | 5 #ifndef V8_COMPILER_INSTRUCTION_SELECTOR_H_ |
6 #define V8_COMPILER_INSTRUCTION_SELECTOR_H_ | 6 #define V8_COMPILER_INSTRUCTION_SELECTOR_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "src/compiler/common-operator.h" | 10 #include "src/compiler/common-operator.h" |
11 #include "src/compiler/instruction.h" | 11 #include "src/compiler/instruction.h" |
12 #include "src/compiler/instruction-scheduler.h" | |
13 #include "src/compiler/machine-operator.h" | 12 #include "src/compiler/machine-operator.h" |
14 #include "src/compiler/node.h" | 13 #include "src/compiler/node.h" |
15 #include "src/zone-containers.h" | 14 #include "src/zone-containers.h" |
16 | 15 |
17 namespace v8 { | 16 namespace v8 { |
18 namespace internal { | 17 namespace internal { |
19 namespace compiler { | 18 namespace compiler { |
20 | 19 |
21 // Forward declarations. | 20 // Forward declarations. |
22 class BasicBlock; | 21 class BasicBlock; |
(...skipping 17 matching lines...) Expand all Loading... |
40 InstructionSelector( | 39 InstructionSelector( |
41 Zone* zone, size_t node_count, Linkage* linkage, | 40 Zone* zone, size_t node_count, Linkage* linkage, |
42 InstructionSequence* sequence, Schedule* schedule, | 41 InstructionSequence* sequence, Schedule* schedule, |
43 SourcePositionTable* source_positions, | 42 SourcePositionTable* source_positions, |
44 SourcePositionMode source_position_mode = kCallSourcePositions, | 43 SourcePositionMode source_position_mode = kCallSourcePositions, |
45 Features features = SupportedFeatures()); | 44 Features features = SupportedFeatures()); |
46 | 45 |
47 // Visit code for the entire graph with the included schedule. | 46 // Visit code for the entire graph with the included schedule. |
48 void SelectInstructions(); | 47 void SelectInstructions(); |
49 | 48 |
50 void StartBlock(RpoNumber rpo); | |
51 void EndBlock(RpoNumber rpo); | |
52 void AddInstruction(Instruction* instr); | |
53 | |
54 // =========================================================================== | 49 // =========================================================================== |
55 // ============= Architecture-independent code emission methods. ============= | 50 // ============= Architecture-independent code emission methods. ============= |
56 // =========================================================================== | 51 // =========================================================================== |
57 | 52 |
58 Instruction* Emit(InstructionCode opcode, InstructionOperand output, | 53 Instruction* Emit(InstructionCode opcode, InstructionOperand output, |
59 size_t temp_count = 0, InstructionOperand* temps = NULL); | 54 size_t temp_count = 0, InstructionOperand* temps = NULL); |
60 Instruction* Emit(InstructionCode opcode, InstructionOperand output, | 55 Instruction* Emit(InstructionCode opcode, InstructionOperand output, |
61 InstructionOperand a, size_t temp_count = 0, | 56 InstructionOperand a, size_t temp_count = 0, |
62 InstructionOperand* temps = NULL); | 57 InstructionOperand* temps = NULL); |
63 Instruction* Emit(InstructionCode opcode, InstructionOperand output, | 58 Instruction* Emit(InstructionCode opcode, InstructionOperand output, |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 InstructionSequence* const sequence_; | 246 InstructionSequence* const sequence_; |
252 SourcePositionTable* const source_positions_; | 247 SourcePositionTable* const source_positions_; |
253 SourcePositionMode const source_position_mode_; | 248 SourcePositionMode const source_position_mode_; |
254 Features features_; | 249 Features features_; |
255 Schedule* const schedule_; | 250 Schedule* const schedule_; |
256 BasicBlock* current_block_; | 251 BasicBlock* current_block_; |
257 ZoneVector<Instruction*> instructions_; | 252 ZoneVector<Instruction*> instructions_; |
258 BoolVector defined_; | 253 BoolVector defined_; |
259 BoolVector used_; | 254 BoolVector used_; |
260 IntVector virtual_registers_; | 255 IntVector virtual_registers_; |
261 InstructionScheduler* scheduler_; | |
262 }; | 256 }; |
263 | 257 |
264 } // namespace compiler | 258 } // namespace compiler |
265 } // namespace internal | 259 } // namespace internal |
266 } // namespace v8 | 260 } // namespace v8 |
267 | 261 |
268 #endif // V8_COMPILER_INSTRUCTION_SELECTOR_H_ | 262 #endif // V8_COMPILER_INSTRUCTION_SELECTOR_H_ |
OLD | NEW |