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" |
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/compiler/node.h" | 13 #include "src/compiler/node.h" |
14 #include "src/zone-containers.h" | 14 #include "src/zone-containers.h" |
15 | 15 |
16 namespace v8 { | 16 namespace v8 { |
17 namespace internal { | 17 namespace internal { |
18 namespace compiler { | 18 namespace compiler { |
19 | 19 |
20 // Forward declarations. | 20 // Forward declarations. |
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 class OperandGenerator; |
25 struct SwitchInfo; | 26 struct SwitchInfo; |
26 | 27 |
27 typedef ZoneVector<InstructionOperand> InstructionOperandVector; | 28 typedef ZoneVector<InstructionOperand> InstructionOperandVector; |
28 | 29 |
29 | 30 |
30 // Instruction selection generates an InstructionSequence for a given Schedule. | 31 // Instruction selection generates an InstructionSequence for a given Schedule. |
31 class InstructionSelector final { | 32 class InstructionSelector final { |
32 public: | 33 public: |
33 // Forward declarations. | 34 // Forward declarations. |
34 class Features; | 35 class Features; |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 // Initialize the call buffer with the InstructionOperands, nodes, etc, | 167 // Initialize the call buffer with the InstructionOperands, nodes, etc, |
167 // corresponding | 168 // corresponding |
168 // to the inputs and outputs of the call. | 169 // to the inputs and outputs of the call. |
169 // {call_code_immediate} to generate immediate operands to calls of code. | 170 // {call_code_immediate} to generate immediate operands to calls of code. |
170 // {call_address_immediate} to generate immediate operands to address calls. | 171 // {call_address_immediate} to generate immediate operands to address calls. |
171 void InitializeCallBuffer(Node* call, CallBuffer* buffer, | 172 void InitializeCallBuffer(Node* call, CallBuffer* buffer, |
172 bool call_code_immediate, | 173 bool call_code_immediate, |
173 bool call_address_immediate); | 174 bool call_address_immediate); |
174 | 175 |
175 FrameStateDescriptor* GetFrameStateDescriptor(Node* node); | 176 FrameStateDescriptor* GetFrameStateDescriptor(Node* node); |
| 177 |
| 178 enum class FrameStateInputKind { kAny, kStackSlot }; |
176 void AddFrameStateInputs(Node* state, InstructionOperandVector* inputs, | 179 void AddFrameStateInputs(Node* state, InstructionOperandVector* inputs, |
177 FrameStateDescriptor* descriptor); | 180 FrameStateDescriptor* descriptor, |
| 181 FrameStateInputKind kind); |
| 182 static InstructionOperand OperandForDeopt(OperandGenerator* g, Node* input, |
| 183 FrameStateInputKind kind); |
178 | 184 |
179 // =========================================================================== | 185 // =========================================================================== |
180 // ============= Architecture-specific graph covering methods. =============== | 186 // ============= Architecture-specific graph covering methods. =============== |
181 // =========================================================================== | 187 // =========================================================================== |
182 | 188 |
183 // Visit nodes in the given block and generate code. | 189 // Visit nodes in the given block and generate code. |
184 void VisitBlock(BasicBlock* block); | 190 void VisitBlock(BasicBlock* block); |
185 | 191 |
186 // Visit the node for the control flow at the end of the block, generating | 192 // Visit the node for the control flow at the end of the block, generating |
187 // code if necessary. | 193 // code if necessary. |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 BoolVector defined_; | 238 BoolVector defined_; |
233 BoolVector used_; | 239 BoolVector used_; |
234 IntVector virtual_registers_; | 240 IntVector virtual_registers_; |
235 }; | 241 }; |
236 | 242 |
237 } // namespace compiler | 243 } // namespace compiler |
238 } // namespace internal | 244 } // namespace internal |
239 } // namespace v8 | 245 } // namespace v8 |
240 | 246 |
241 #endif // V8_COMPILER_INSTRUCTION_SELECTOR_H_ | 247 #endif // V8_COMPILER_INSTRUCTION_SELECTOR_H_ |
OLD | NEW |