| 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 #include "src/compiler/instruction-selector.h" | 5 #include "src/compiler/instruction-selector.h" |
| 6 | 6 |
| 7 #include "src/compiler/instruction-selector-impl.h" | 7 #include "src/compiler/instruction-selector-impl.h" |
| 8 #include "src/compiler/node-matchers.h" | 8 #include "src/compiler/node-matchers.h" |
| 9 #include "src/compiler/node-properties-inl.h" | 9 #include "src/compiler/node-properties-inl.h" |
| 10 #include "src/compiler/pipeline.h" | 10 #include "src/compiler/pipeline.h" |
| 11 | 11 |
| 12 namespace v8 { | 12 namespace v8 { |
| 13 namespace internal { | 13 namespace internal { |
| 14 namespace compiler { | 14 namespace compiler { |
| 15 | 15 |
| 16 InstructionSelector::InstructionSelector(InstructionSequence* sequence, | 16 InstructionSelector::InstructionSelector(InstructionSequence* sequence, |
| 17 SourcePositionTable* source_positions, | 17 SourcePositionTable* source_positions, |
| 18 Features features) | 18 Features features) |
| 19 : zone_(sequence->isolate()), | 19 : zone_(sequence->isolate()), |
| 20 sequence_(sequence), | 20 sequence_(sequence), |
| 21 source_positions_(source_positions), | 21 source_positions_(source_positions), |
| 22 features_(features), | 22 features_(features), |
| 23 current_block_(NULL), | 23 current_block_(NULL), |
| 24 instructions_(zone()), | 24 instructions_(zone()), |
| 25 defined_(graph()->NodeCount(), false, zone()), | 25 defined_(sequence->node_count(), false, zone()), |
| 26 used_(graph()->NodeCount(), false, zone()) {} | 26 used_(sequence->node_count(), false, zone()) {} |
| 27 | 27 |
| 28 | 28 |
| 29 void InstructionSelector::SelectInstructions() { | 29 void InstructionSelector::SelectInstructions() { |
| 30 // Mark the inputs of all phis in loop headers as used. | 30 // Mark the inputs of all phis in loop headers as used. |
| 31 BasicBlockVector* blocks = schedule()->rpo_order(); | 31 BasicBlockVector* blocks = schedule()->rpo_order(); |
| 32 for (BasicBlockVectorIter i = blocks->begin(); i != blocks->end(); ++i) { | 32 for (BasicBlockVectorIter i = blocks->begin(); i != blocks->end(); ++i) { |
| 33 BasicBlock* block = *i; | 33 BasicBlock* block = *i; |
| 34 if (!block->IsLoopHeader()) continue; | 34 if (!block->IsLoopHeader()) continue; |
| 35 DCHECK_NE(0, static_cast<int>(block->PredecessorCount())); | 35 DCHECK_NE(0, static_cast<int>(block->PredecessorCount())); |
| 36 DCHECK_NE(1, static_cast<int>(block->PredecessorCount())); | 36 DCHECK_NE(1, static_cast<int>(block->PredecessorCount())); |
| (...skipping 1227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1264 | 1264 |
| 1265 | 1265 |
| 1266 void InstructionSelector::VisitCall(Node* call, BasicBlock* continuation, | 1266 void InstructionSelector::VisitCall(Node* call, BasicBlock* continuation, |
| 1267 BasicBlock* deoptimization) {} | 1267 BasicBlock* deoptimization) {} |
| 1268 | 1268 |
| 1269 #endif // !V8_TURBOFAN_BACKEND | 1269 #endif // !V8_TURBOFAN_BACKEND |
| 1270 | 1270 |
| 1271 } // namespace compiler | 1271 } // namespace compiler |
| 1272 } // namespace internal | 1272 } // namespace internal |
| 1273 } // namespace v8 | 1273 } // namespace v8 |
| OLD | NEW |