Chromium Code Reviews| 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 603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 614 | 614 |
| 615 | 615 |
| 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 { |
| 625 i != schedule_root_nodes_.end(); ++i) { | |
| 626 // TODO(mstarzinger): Make the scheduler eat less memory. | |
| 627 Zone zone(zone_->isolate()); | 625 Zone zone(zone_->isolate()); |
|
Michael Starzinger
2014/08/14 13:27:54
As experimented offline: We should now be able to
| |
| 628 GenericGraphVisit::Visit<ScheduleLateNodeVisitor, | 626 GenericGraphVisit::Visit<ScheduleLateNodeVisitor, |
| 629 NodeInputIterationTraits<Node> >( | 627 NodeInputIterationTraits<Node> >( |
| 630 graph_, &zone, *i, &schedule_late_visitor); | 628 graph_, &zone, schedule_root_nodes_.begin(), schedule_root_nodes_.end(), |
| 629 &schedule_late_visitor); | |
| 631 } | 630 } |
| 632 | 631 |
| 633 // Add collected nodes for basic blocks to their blocks in the right order. | 632 // Add collected nodes for basic blocks to their blocks in the right order. |
| 634 int block_num = 0; | 633 int block_num = 0; |
| 635 for (NodeVectorVectorIter i = scheduled_nodes_.begin(); | 634 for (NodeVectorVectorIter i = scheduled_nodes_.begin(); |
| 636 i != scheduled_nodes_.end(); ++i) { | 635 i != scheduled_nodes_.end(); ++i) { |
| 637 for (NodeVectorRIter j = i->rbegin(); j != i->rend(); ++j) { | 636 for (NodeVectorRIter j = i->rbegin(); j != i->rend(); ++j) { |
| 638 schedule_->AddNode(schedule_->all_blocks_.at(block_num), *j); | 637 schedule_->AddNode(schedule_->all_blocks_.at(block_num), *j); |
| 639 } | 638 } |
| 640 block_num++; | 639 block_num++; |
| (...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1042 | 1041 |
| 1043 #if DEBUG | 1042 #if DEBUG |
| 1044 if (FLAG_trace_turbo_scheduler) PrintRPO(num_loops, loops, final_order); | 1043 if (FLAG_trace_turbo_scheduler) PrintRPO(num_loops, loops, final_order); |
| 1045 VerifySpecialRPO(num_loops, loops, final_order); | 1044 VerifySpecialRPO(num_loops, loops, final_order); |
| 1046 #endif | 1045 #endif |
| 1047 return final_order; | 1046 return final_order; |
| 1048 } | 1047 } |
| 1049 } | 1048 } |
| 1050 } | 1049 } |
| 1051 } // namespace v8::internal::compiler | 1050 } // namespace v8::internal::compiler |
| OLD | NEW |