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 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 } | 170 } |
171 | 171 |
172 // Return true if the instruction is a memory load. | 172 // Return true if the instruction is a memory load. |
173 bool IsLoadOperation(const Instruction* instr) const { | 173 bool IsLoadOperation(const Instruction* instr) const { |
174 return GetInstructionFlags(instr) & kIsLoadOperation; | 174 return GetInstructionFlags(instr) & kIsLoadOperation; |
175 } | 175 } |
176 | 176 |
177 // Identify nops used as a definition point for live-in registers at | 177 // Identify nops used as a definition point for live-in registers at |
178 // function entry. | 178 // function entry. |
179 bool IsFixedRegisterParameter(const Instruction* instr) const { | 179 bool IsFixedRegisterParameter(const Instruction* instr) const { |
180 return (instr->arch_opcode() == kArchNop) && | 180 return (instr->arch_opcode() == kArchNop) && (instr->OutputCount() == 1) && |
181 (instr->OutputCount() == 1) && | 181 (instr->OutputAt(0)->IsUnallocated()) && |
182 (instr->OutputAt(0)->IsUnallocated()) && | 182 (UnallocatedOperand::cast(instr->OutputAt(0)) |
183 (UnallocatedOperand::cast(instr->OutputAt(0))->HasFixedRegisterPolicy() || | 183 ->HasFixedRegisterPolicy() || |
184 UnallocatedOperand::cast( | 184 UnallocatedOperand::cast(instr->OutputAt(0)) |
185 instr->OutputAt(0))->HasFixedDoubleRegisterPolicy()); | 185 ->HasFixedFPRegisterPolicy()); |
186 } | 186 } |
187 | 187 |
188 void ComputeTotalLatencies(); | 188 void ComputeTotalLatencies(); |
189 | 189 |
190 static int GetInstructionLatency(const Instruction* instr); | 190 static int GetInstructionLatency(const Instruction* instr); |
191 | 191 |
192 Zone* zone() { return zone_; } | 192 Zone* zone() { return zone_; } |
193 InstructionSequence* sequence() { return sequence_; } | 193 InstructionSequence* sequence() { return sequence_; } |
194 Isolate* isolate() { return sequence()->isolate(); } | 194 Isolate* isolate() { return sequence()->isolate(); } |
195 | 195 |
(...skipping 18 matching lines...) Expand all Loading... |
214 | 214 |
215 // Last deoptimization instruction encountered while building the graph. | 215 // Last deoptimization instruction encountered while building the graph. |
216 ScheduleGraphNode* last_deopt_; | 216 ScheduleGraphNode* last_deopt_; |
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 |