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" |
(...skipping 10 matching lines...) Expand all Loading... |
21 class BasicBlock; | 21 class BasicBlock; |
22 struct CallBuffer; // TODO(bmeurer): Remove this. | 22 struct CallBuffer; // TODO(bmeurer): Remove this. |
23 class FlagsContinuation; | 23 class FlagsContinuation; |
24 class Linkage; | 24 class Linkage; |
25 struct SwitchInfo; | 25 struct SwitchInfo; |
26 | 26 |
27 typedef ZoneVector<InstructionOperand> InstructionOperandVector; | 27 typedef ZoneVector<InstructionOperand> InstructionOperandVector; |
28 | 28 |
29 | 29 |
30 // Instruction selection generates an InstructionSequence for a given Schedule. | 30 // Instruction selection generates an InstructionSequence for a given Schedule. |
31 class InstructionSelector FINAL { | 31 class InstructionSelector final { |
32 public: | 32 public: |
33 // Forward declarations. | 33 // Forward declarations. |
34 class Features; | 34 class Features; |
35 | 35 |
36 InstructionSelector(Zone* zone, size_t node_count, Linkage* linkage, | 36 InstructionSelector(Zone* zone, size_t node_count, Linkage* linkage, |
37 InstructionSequence* sequence, Schedule* schedule, | 37 InstructionSequence* sequence, Schedule* schedule, |
38 SourcePositionTable* source_positions, | 38 SourcePositionTable* source_positions, |
39 Features features = SupportedFeatures()); | 39 Features features = SupportedFeatures()); |
40 | 40 |
41 // Visit code for the entire graph with the included schedule. | 41 // Visit code for the entire graph with the included schedule. |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 Instruction* Emit(InstructionCode opcode, size_t output_count, | 74 Instruction* Emit(InstructionCode opcode, size_t output_count, |
75 InstructionOperand* outputs, size_t input_count, | 75 InstructionOperand* outputs, size_t input_count, |
76 InstructionOperand* inputs, size_t temp_count = 0, | 76 InstructionOperand* inputs, size_t temp_count = 0, |
77 InstructionOperand* temps = NULL); | 77 InstructionOperand* temps = NULL); |
78 Instruction* Emit(Instruction* instr); | 78 Instruction* Emit(Instruction* instr); |
79 | 79 |
80 // =========================================================================== | 80 // =========================================================================== |
81 // ============== Architecture-independent CPU feature methods. ============== | 81 // ============== Architecture-independent CPU feature methods. ============== |
82 // =========================================================================== | 82 // =========================================================================== |
83 | 83 |
84 class Features FINAL { | 84 class Features final { |
85 public: | 85 public: |
86 Features() : bits_(0) {} | 86 Features() : bits_(0) {} |
87 explicit Features(unsigned bits) : bits_(bits) {} | 87 explicit Features(unsigned bits) : bits_(bits) {} |
88 explicit Features(CpuFeature f) : bits_(1u << f) {} | 88 explicit Features(CpuFeature f) : bits_(1u << f) {} |
89 Features(CpuFeature f1, CpuFeature f2) : bits_((1u << f1) | (1u << f2)) {} | 89 Features(CpuFeature f1, CpuFeature f2) : bits_((1u << f1) | (1u << f2)) {} |
90 | 90 |
91 bool Contains(CpuFeature f) const { return (bits_ & (1u << f)); } | 91 bool Contains(CpuFeature f) const { return (bits_ & (1u << f)); } |
92 | 92 |
93 private: | 93 private: |
94 unsigned bits_; | 94 unsigned bits_; |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 BoolVector defined_; | 233 BoolVector defined_; |
234 BoolVector used_; | 234 BoolVector used_; |
235 IntVector virtual_registers_; | 235 IntVector virtual_registers_; |
236 }; | 236 }; |
237 | 237 |
238 } // namespace compiler | 238 } // namespace compiler |
239 } // namespace internal | 239 } // namespace internal |
240 } // namespace v8 | 240 } // namespace v8 |
241 | 241 |
242 #endif // V8_COMPILER_INSTRUCTION_SELECTOR_H_ | 242 #endif // V8_COMPILER_INSTRUCTION_SELECTOR_H_ |
OLD | NEW |