| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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/scheduler.h" | 5 #include "src/compiler/scheduler.h" |
| 6 | 6 |
| 7 #include "src/compiler/graph.h" | 7 #include "src/compiler/graph.h" |
| 8 #include "src/compiler/graph-inl.h" | 8 #include "src/compiler/graph-inl.h" |
| 9 #include "src/compiler/node.h" | 9 #include "src/compiler/node.h" |
| 10 #include "src/compiler/node-properties.h" | 10 #include "src/compiler/node-properties.h" |
| (...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 616 void Scheduler::ScheduleLate() { | 616 void Scheduler::ScheduleLate() { |
| 617 if (FLAG_trace_turbo_scheduler) { | 617 if (FLAG_trace_turbo_scheduler) { |
| 618 PrintF("------------------- SCHEDULE LATE -----------------\n"); | 618 PrintF("------------------- SCHEDULE LATE -----------------\n"); |
| 619 } | 619 } |
| 620 | 620 |
| 621 // Schedule: Places nodes in dominator block of all their uses. | 621 // Schedule: Places nodes in dominator block of all their uses. |
| 622 ScheduleLateNodeVisitor schedule_late_visitor(this); | 622 ScheduleLateNodeVisitor schedule_late_visitor(this); |
| 623 | 623 |
| 624 for (NodeVectorIter i = schedule_root_nodes_.begin(); | 624 for (NodeVectorIter i = schedule_root_nodes_.begin(); |
| 625 i != schedule_root_nodes_.end(); ++i) { | 625 i != schedule_root_nodes_.end(); ++i) { |
| 626 // TODO(mstarzinger): Make the scheduler eat less memory. |
| 627 Zone zone(zone_->isolate()); |
| 626 GenericGraphVisit::Visit<ScheduleLateNodeVisitor, | 628 GenericGraphVisit::Visit<ScheduleLateNodeVisitor, |
| 627 NodeInputIterationTraits<Node> >( | 629 NodeInputIterationTraits<Node> >( |
| 628 graph_, zone_, *i, &schedule_late_visitor); | 630 graph_, &zone, *i, &schedule_late_visitor); |
| 629 } | 631 } |
| 630 | 632 |
| 631 // Add collected nodes for basic blocks to their blocks in the right order. | 633 // Add collected nodes for basic blocks to their blocks in the right order. |
| 632 int block_num = 0; | 634 int block_num = 0; |
| 633 for (NodeVectorVectorIter i = scheduled_nodes_.begin(); | 635 for (NodeVectorVectorIter i = scheduled_nodes_.begin(); |
| 634 i != scheduled_nodes_.end(); ++i) { | 636 i != scheduled_nodes_.end(); ++i) { |
| 635 for (NodeVectorRIter j = i->rbegin(); j != i->rend(); ++j) { | 637 for (NodeVectorRIter j = i->rbegin(); j != i->rend(); ++j) { |
| 636 schedule_->AddNode(schedule_->all_blocks_.at(block_num), *j); | 638 schedule_->AddNode(schedule_->all_blocks_.at(block_num), *j); |
| 637 } | 639 } |
| 638 block_num++; | 640 block_num++; |
| (...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1040 | 1042 |
| 1041 #if DEBUG | 1043 #if DEBUG |
| 1042 if (FLAG_trace_turbo_scheduler) PrintRPO(num_loops, loops, final_order); | 1044 if (FLAG_trace_turbo_scheduler) PrintRPO(num_loops, loops, final_order); |
| 1043 VerifySpecialRPO(num_loops, loops, final_order); | 1045 VerifySpecialRPO(num_loops, loops, final_order); |
| 1044 #endif | 1046 #endif |
| 1045 return final_order; | 1047 return final_order; |
| 1046 } | 1048 } |
| 1047 } | 1049 } |
| 1048 } | 1050 } |
| 1049 } // namespace v8::internal::compiler | 1051 } // namespace v8::internal::compiler |
| OLD | NEW |