OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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_SCHEDULER_H_ | 5 #ifndef V8_COMPILER_INSTRUCTION_SCHEDULER_H_ |
6 #define V8_COMPILER_INSTRUCTION_SCHEDULER_H_ | 6 #define V8_COMPILER_INSTRUCTION_SCHEDULER_H_ |
7 | 7 |
8 #include "src/compiler/instruction.h" | 8 #include "src/compiler/instruction.h" |
9 #include "src/zone-containers.h" | 9 #include "src/zone-containers.h" |
10 | 10 |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 | 149 |
150 // Perform scheduling for the current block specifying the queue type to | 150 // Perform scheduling for the current block specifying the queue type to |
151 // use to determine the next best candidate. | 151 // use to determine the next best candidate. |
152 template <typename QueueType> | 152 template <typename QueueType> |
153 void ScheduleBlock(); | 153 void ScheduleBlock(); |
154 | 154 |
155 // Return the scheduling properties of the given instruction. | 155 // Return the scheduling properties of the given instruction. |
156 int GetInstructionFlags(const Instruction* instr) const; | 156 int GetInstructionFlags(const Instruction* instr) const; |
157 int GetTargetInstructionFlags(const Instruction* instr) const; | 157 int GetTargetInstructionFlags(const Instruction* instr) const; |
158 | 158 |
159 // Return true if instr2 uses any value defined by instr1. | |
160 bool HasOperandDependency(const Instruction* instr1, | |
161 const Instruction* instr2) const; | |
162 | |
163 // Return true if the instruction is a basic block terminator. | 159 // Return true if the instruction is a basic block terminator. |
164 bool IsBlockTerminator(const Instruction* instr) const; | 160 bool IsBlockTerminator(const Instruction* instr) const; |
165 | 161 |
166 // Check whether the given instruction has side effects (e.g. function call, | 162 // Check whether the given instruction has side effects (e.g. function call, |
167 // memory store). | 163 // memory store). |
168 bool HasSideEffect(const Instruction* instr) const { | 164 bool HasSideEffect(const Instruction* instr) const { |
169 return GetInstructionFlags(instr) & kHasSideEffect; | 165 return GetInstructionFlags(instr) & kHasSideEffect; |
170 } | 166 } |
171 | 167 |
172 // Return true if the instruction is a memory load. | 168 // Return true if the instruction is a memory load. |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 | 203 |
208 // Live-in register markers are nop instructions which are emitted at the | 204 // Live-in register markers are nop instructions which are emitted at the |
209 // beginning of a basic block so that the register allocator will find a | 205 // beginning of a basic block so that the register allocator will find a |
210 // defining instruction for live-in values. They must not be moved. | 206 // defining instruction for live-in values. They must not be moved. |
211 // All these nops are chained together and added as a predecessor of every | 207 // All these nops are chained together and added as a predecessor of every |
212 // other instructions in the basic block. | 208 // other instructions in the basic block. |
213 ScheduleGraphNode* last_live_in_reg_marker_; | 209 ScheduleGraphNode* last_live_in_reg_marker_; |
214 | 210 |
215 // Last deoptimization instruction encountered while building the graph. | 211 // Last deoptimization instruction encountered while building the graph. |
216 ScheduleGraphNode* last_deopt_; | 212 ScheduleGraphNode* last_deopt_; |
| 213 |
| 214 // Keep track of definition points for virtual registers. This is used to |
| 215 // record operand dependencies in the scheduling graph. |
| 216 ZoneMap<int32_t, ScheduleGraphNode*> operands_map_; |
217 }; | 217 }; |
218 | 218 |
219 } // namespace compiler | 219 } // namespace compiler |
220 } // namespace internal | 220 } // namespace internal |
221 } // namespace v8 | 221 } // namespace v8 |
222 | 222 |
223 #endif // V8_COMPILER_INSTRUCTION_SCHEDULER_H_ | 223 #endif // V8_COMPILER_INSTRUCTION_SCHEDULER_H_ |
OLD | NEW |