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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 | 146 |
147 // Inform the instruction selection that {node} was just defined. | 147 // Inform the instruction selection that {node} was just defined. |
148 void MarkAsDefined(Node* node); | 148 void MarkAsDefined(Node* node); |
149 | 149 |
150 // Inform the instruction selection that {node} has at least one use and we | 150 // Inform the instruction selection that {node} has at least one use and we |
151 // will need to generate code for it. | 151 // will need to generate code for it. |
152 void MarkAsUsed(Node* node); | 152 void MarkAsUsed(Node* node); |
153 | 153 |
154 // Inform the register allocation of the representation of the value produced | 154 // Inform the register allocation of the representation of the value produced |
155 // by {node}. | 155 // by {node}. |
156 void MarkAsRepresentation(MachineType rep, Node* node); | 156 void MarkAsRepresentation(MachineRepresentation rep, Node* node); |
157 void MarkAsWord32(Node* node) { MarkAsRepresentation(kRepWord32, node); } | 157 void MarkAsWord32(Node* node) { |
158 void MarkAsWord64(Node* node) { MarkAsRepresentation(kRepWord64, node); } | 158 MarkAsRepresentation(MachineRepresentation::kWord32, node); |
159 void MarkAsFloat32(Node* node) { MarkAsRepresentation(kRepFloat32, node); } | 159 } |
160 void MarkAsFloat64(Node* node) { MarkAsRepresentation(kRepFloat64, node); } | 160 void MarkAsWord64(Node* node) { |
161 void MarkAsReference(Node* node) { MarkAsRepresentation(kRepTagged, node); } | 161 MarkAsRepresentation(MachineRepresentation::kWord64, node); |
| 162 } |
| 163 void MarkAsFloat32(Node* node) { |
| 164 MarkAsRepresentation(MachineRepresentation::kFloat32, node); |
| 165 } |
| 166 void MarkAsFloat64(Node* node) { |
| 167 MarkAsRepresentation(MachineRepresentation::kFloat64, node); |
| 168 } |
| 169 void MarkAsReference(Node* node) { |
| 170 MarkAsRepresentation(MachineRepresentation::kTagged, node); |
| 171 } |
162 | 172 |
163 // Inform the register allocation of the representation of the unallocated | 173 // Inform the register allocation of the representation of the unallocated |
164 // operand {op}. | 174 // operand {op}. |
165 void MarkAsRepresentation(MachineType rep, const InstructionOperand& op); | 175 void MarkAsRepresentation(MachineRepresentation rep, |
| 176 const InstructionOperand& op); |
166 | 177 |
167 enum CallBufferFlag { | 178 enum CallBufferFlag { |
168 kCallCodeImmediate = 1u << 0, | 179 kCallCodeImmediate = 1u << 0, |
169 kCallAddressImmediate = 1u << 1, | 180 kCallAddressImmediate = 1u << 1, |
170 kCallTail = 1u << 2 | 181 kCallTail = 1u << 2 |
171 }; | 182 }; |
172 typedef base::Flags<CallBufferFlag> CallBufferFlags; | 183 typedef base::Flags<CallBufferFlag> CallBufferFlags; |
173 | 184 |
174 // Initialize the call buffer with the InstructionOperands, nodes, etc, | 185 // Initialize the call buffer with the InstructionOperands, nodes, etc, |
175 // corresponding | 186 // corresponding |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 BoolVector defined_; | 253 BoolVector defined_; |
243 BoolVector used_; | 254 BoolVector used_; |
244 IntVector virtual_registers_; | 255 IntVector virtual_registers_; |
245 }; | 256 }; |
246 | 257 |
247 } // namespace compiler | 258 } // namespace compiler |
248 } // namespace internal | 259 } // namespace internal |
249 } // namespace v8 | 260 } // namespace v8 |
250 | 261 |
251 #endif // V8_COMPILER_INSTRUCTION_SELECTOR_H_ | 262 #endif // V8_COMPILER_INSTRUCTION_SELECTOR_H_ |
OLD | NEW |