| 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" |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 | 77 |
| 78 bool IsSupported(CpuFeature feature) const { | 78 bool IsSupported(CpuFeature feature) const { |
| 79 return features_.Contains(feature); | 79 return features_.Contains(feature); |
| 80 } | 80 } |
| 81 | 81 |
| 82 // Returns the features supported on the target platform. | 82 // Returns the features supported on the target platform. |
| 83 static Features SupportedFeatures() { | 83 static Features SupportedFeatures() { |
| 84 return Features(CpuFeatures::SupportedFeatures()); | 84 return Features(CpuFeatures::SupportedFeatures()); |
| 85 } | 85 } |
| 86 | 86 |
| 87 // Checks if {node} was already defined, and therefore code was already |
| 88 // generated for it. |
| 89 bool IsDefined(Node* node) const; |
| 90 |
| 91 // Checks if {node} has any uses, and therefore code has to be generated for |
| 92 // it. |
| 93 bool IsUsed(Node* node) const; |
| 94 |
| 87 private: | 95 private: |
| 88 friend class OperandGenerator; | 96 friend class OperandGenerator; |
| 89 | 97 |
| 90 // =========================================================================== | 98 // =========================================================================== |
| 91 // ============ Architecture-independent graph covering methods. ============= | 99 // ============ Architecture-independent graph covering methods. ============= |
| 92 // =========================================================================== | 100 // =========================================================================== |
| 93 | 101 |
| 94 // Checks if {block} will appear directly after {current_block_} when | 102 // Checks if {block} will appear directly after {current_block_} when |
| 95 // assembling code, in which case, a fall-through can be used. | 103 // assembling code, in which case, a fall-through can be used. |
| 96 bool IsNextInAssemblyOrder(const BasicBlock* block) const; | 104 bool IsNextInAssemblyOrder(const BasicBlock* block) const; |
| 97 | 105 |
| 98 // Used in pattern matching during code generation. | 106 // Used in pattern matching during code generation. |
| 99 // Check if {node} can be covered while generating code for the current | 107 // Check if {node} can be covered while generating code for the current |
| 100 // instruction. A node can be covered if the {user} of the node has the only | 108 // instruction. A node can be covered if the {user} of the node has the only |
| 101 // edge and the two are in the same basic block. | 109 // edge and the two are in the same basic block. |
| 102 bool CanCover(Node* user, Node* node) const; | 110 bool CanCover(Node* user, Node* node) const; |
| 103 | 111 |
| 104 // Checks if {node} was already defined, and therefore code was already | |
| 105 // generated for it. | |
| 106 bool IsDefined(Node* node) const; | |
| 107 | |
| 108 // Inform the instruction selection that {node} was just defined. | 112 // Inform the instruction selection that {node} was just defined. |
| 109 void MarkAsDefined(Node* node); | 113 void MarkAsDefined(Node* node); |
| 110 | 114 |
| 111 // Checks if {node} has any uses, and therefore code has to be generated for | |
| 112 // it. | |
| 113 bool IsUsed(Node* node) const; | |
| 114 | |
| 115 // Inform the instruction selection that {node} has at least one use and we | 115 // Inform the instruction selection that {node} has at least one use and we |
| 116 // will need to generate code for it. | 116 // will need to generate code for it. |
| 117 void MarkAsUsed(Node* node); | 117 void MarkAsUsed(Node* node); |
| 118 | 118 |
| 119 // Checks if {node} is marked as double. | 119 // Checks if {node} is marked as double. |
| 120 bool IsDouble(const Node* node) const; | 120 bool IsDouble(const Node* node) const; |
| 121 | 121 |
| 122 // Inform the register allocator of a double result. | 122 // Inform the register allocator of a double result. |
| 123 void MarkAsDouble(Node* node); | 123 void MarkAsDouble(Node* node); |
| 124 | 124 |
| (...skipping 79 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 |