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 <deque> | 8 #include <deque> |
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/machine-operator.h" | 12 #include "src/compiler/machine-operator.h" |
13 #include "src/zone-containers.h" | 13 #include "src/zone-containers.h" |
14 | 14 |
15 namespace v8 { | 15 namespace v8 { |
16 namespace internal { | 16 namespace internal { |
17 namespace compiler { | 17 namespace compiler { |
18 | 18 |
19 // Forward declarations. | 19 // Forward declarations. |
20 struct CallBuffer; // TODO(bmeurer): Remove this. | 20 struct CallBuffer; // TODO(bmeurer): Remove this. |
21 class FlagsContinuation; | 21 class FlagsContinuation; |
22 | 22 |
23 class InstructionSelector V8_FINAL { | 23 class InstructionSelector FINAL { |
24 public: | 24 public: |
25 // Forward declarations. | 25 // Forward declarations. |
26 class Features; | 26 class Features; |
27 | 27 |
28 InstructionSelector(InstructionSequence* sequence, | 28 InstructionSelector(InstructionSequence* sequence, |
29 SourcePositionTable* source_positions, | 29 SourcePositionTable* source_positions, |
30 Features features = SupportedFeatures()); | 30 Features features = SupportedFeatures()); |
31 | 31 |
32 // Visit code for the entire graph with the included schedule. | 32 // Visit code for the entire graph with the included schedule. |
33 void SelectInstructions(); | 33 void SelectInstructions(); |
(...skipping 21 matching lines...) Expand all Loading... |
55 Instruction* Emit(InstructionCode opcode, size_t output_count, | 55 Instruction* Emit(InstructionCode opcode, size_t output_count, |
56 InstructionOperand** outputs, size_t input_count, | 56 InstructionOperand** outputs, size_t input_count, |
57 InstructionOperand** inputs, size_t temp_count = 0, | 57 InstructionOperand** inputs, size_t temp_count = 0, |
58 InstructionOperand* *temps = NULL); | 58 InstructionOperand* *temps = NULL); |
59 Instruction* Emit(Instruction* instr); | 59 Instruction* Emit(Instruction* instr); |
60 | 60 |
61 // =========================================================================== | 61 // =========================================================================== |
62 // ============== Architecture-independent CPU feature methods. ============== | 62 // ============== Architecture-independent CPU feature methods. ============== |
63 // =========================================================================== | 63 // =========================================================================== |
64 | 64 |
65 class Features V8_FINAL { | 65 class Features FINAL { |
66 public: | 66 public: |
67 Features() : bits_(0) {} | 67 Features() : bits_(0) {} |
68 explicit Features(unsigned bits) : bits_(bits) {} | 68 explicit Features(unsigned bits) : bits_(bits) {} |
69 explicit Features(CpuFeature f) : bits_(1u << f) {} | 69 explicit Features(CpuFeature f) : bits_(1u << f) {} |
70 Features(CpuFeature f1, CpuFeature f2) : bits_((1u << f1) | (1u << f2)) {} | 70 Features(CpuFeature f1, CpuFeature f2) : bits_((1u << f1) | (1u << f2)) {} |
71 | 71 |
72 bool Contains(CpuFeature f) const { return (bits_ & (1u << f)); } | 72 bool Contains(CpuFeature f) const { return (bits_ & (1u << f)); } |
73 | 73 |
74 private: | 74 private: |
75 unsigned bits_; | 75 unsigned bits_; |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 ZoneDeque<Instruction*> instructions_; | 204 ZoneDeque<Instruction*> instructions_; |
205 BoolVector defined_; | 205 BoolVector defined_; |
206 BoolVector used_; | 206 BoolVector used_; |
207 }; | 207 }; |
208 | 208 |
209 } // namespace compiler | 209 } // namespace compiler |
210 } // namespace internal | 210 } // namespace internal |
211 } // namespace v8 | 211 } // namespace v8 |
212 | 212 |
213 #endif // V8_COMPILER_INSTRUCTION_SELECTOR_H_ | 213 #endif // V8_COMPILER_INSTRUCTION_SELECTOR_H_ |
OLD | NEW |