| 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 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, Schedule* schedule, | 28 InstructionSelector(Linkage* linkage, InstructionSequence* sequence, |
| 29 SourcePositionTable* source_positions, | 29 Schedule* schedule, 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(); |
| 34 | 34 |
| 35 // =========================================================================== | 35 // =========================================================================== |
| 36 // ============= Architecture-independent code emission methods. ============= | 36 // ============= Architecture-independent code emission methods. ============= |
| 37 // =========================================================================== | 37 // =========================================================================== |
| 38 | 38 |
| 39 Instruction* Emit(InstructionCode opcode, InstructionOperand* output, | 39 Instruction* Emit(InstructionCode opcode, InstructionOperand* output, |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 void VisitConstant(Node* node); | 176 void VisitConstant(Node* node); |
| 177 void VisitCall(Node* call); | 177 void VisitCall(Node* call); |
| 178 void VisitGoto(BasicBlock* target); | 178 void VisitGoto(BasicBlock* target); |
| 179 void VisitBranch(Node* input, BasicBlock* tbranch, BasicBlock* fbranch); | 179 void VisitBranch(Node* input, BasicBlock* tbranch, BasicBlock* fbranch); |
| 180 void VisitReturn(Node* value); | 180 void VisitReturn(Node* value); |
| 181 void VisitThrow(Node* value); | 181 void VisitThrow(Node* value); |
| 182 void VisitDeoptimize(Node* deopt); | 182 void VisitDeoptimize(Node* deopt); |
| 183 | 183 |
| 184 // =========================================================================== | 184 // =========================================================================== |
| 185 | 185 |
| 186 Linkage* linkage() const { return sequence()->linkage(); } | |
| 187 Schedule* schedule() const { return schedule_; } | 186 Schedule* schedule() const { return schedule_; } |
| 187 Linkage* linkage() const { return linkage_; } |
| 188 InstructionSequence* sequence() const { return sequence_; } | 188 InstructionSequence* sequence() const { return sequence_; } |
| 189 Zone* instruction_zone() const { return sequence()->zone(); } | 189 Zone* instruction_zone() const { return sequence()->zone(); } |
| 190 Zone* zone() { return &zone_; } | 190 Zone* zone() { return &zone_; } |
| 191 | 191 |
| 192 // =========================================================================== | 192 // =========================================================================== |
| 193 | 193 |
| 194 Zone zone_; | 194 Zone zone_; |
| 195 InstructionSequence* sequence_; | 195 Linkage* const linkage_; |
| 196 SourcePositionTable* source_positions_; | 196 InstructionSequence* const sequence_; |
| 197 SourcePositionTable* const source_positions_; |
| 197 Features features_; | 198 Features features_; |
| 198 Schedule* schedule_; | 199 Schedule* const schedule_; |
| 199 BasicBlock* current_block_; | 200 BasicBlock* current_block_; |
| 200 ZoneDeque<Instruction*> instructions_; | 201 ZoneDeque<Instruction*> instructions_; |
| 201 BoolVector defined_; | 202 BoolVector defined_; |
| 202 BoolVector used_; | 203 BoolVector used_; |
| 203 }; | 204 }; |
| 204 | 205 |
| 205 } // namespace compiler | 206 } // namespace compiler |
| 206 } // namespace internal | 207 } // namespace internal |
| 207 } // namespace v8 | 208 } // namespace v8 |
| 208 | 209 |
| 209 #endif // V8_COMPILER_INSTRUCTION_SELECTOR_H_ | 210 #endif // V8_COMPILER_INSTRUCTION_SELECTOR_H_ |
| OLD | NEW |