| 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 <deque> | |
| 6 #include <queue> | |
| 7 | |
| 8 #include "src/compiler/scheduler.h" | 5 #include "src/compiler/scheduler.h" |
| 9 | 6 |
| 10 #include "src/bit-vector.h" | 7 #include "src/bit-vector.h" |
| 8 #include "src/compiler/common-operator.h" |
| 11 #include "src/compiler/control-equivalence.h" | 9 #include "src/compiler/control-equivalence.h" |
| 12 #include "src/compiler/graph.h" | 10 #include "src/compiler/graph.h" |
| 13 #include "src/compiler/graph-inl.h" | 11 #include "src/compiler/graph-inl.h" |
| 14 #include "src/compiler/node.h" | 12 #include "src/compiler/node.h" |
| 15 #include "src/compiler/node-marker.h" | 13 #include "src/compiler/node-marker.h" |
| 16 #include "src/compiler/node-properties-inl.h" | 14 #include "src/compiler/node-properties.h" |
| 17 | 15 |
| 18 namespace v8 { | 16 namespace v8 { |
| 19 namespace internal { | 17 namespace internal { |
| 20 namespace compiler { | 18 namespace compiler { |
| 21 | 19 |
| 22 static inline void Trace(const char* msg, ...) { | 20 static inline void Trace(const char* msg, ...) { |
| 23 if (FLAG_trace_turbo_scheduler) { | 21 if (FLAG_trace_turbo_scheduler) { |
| 24 va_list arguments; | 22 va_list arguments; |
| 25 va_start(arguments, msg); | 23 va_start(arguments, msg); |
| 26 base::OS::VPrint(msg, arguments); | 24 base::OS::VPrint(msg, arguments); |
| (...skipping 1383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1410 } | 1408 } |
| 1411 PropagateImmediateDominators(block->rpo_next()); | 1409 PropagateImmediateDominators(block->rpo_next()); |
| 1412 | 1410 |
| 1413 // Iterate on phase 4: Schedule nodes early. | 1411 // Iterate on phase 4: Schedule nodes early. |
| 1414 // TODO(mstarzinger): The following loop gathering the propagation roots is a | 1412 // TODO(mstarzinger): The following loop gathering the propagation roots is a |
| 1415 // temporary solution and should be merged into the rest of the scheduler as | 1413 // temporary solution and should be merged into the rest of the scheduler as |
| 1416 // soon as the approach settled for all floating loops. | 1414 // soon as the approach settled for all floating loops. |
| 1417 NodeVector propagation_roots(control_flow_builder_->control_); | 1415 NodeVector propagation_roots(control_flow_builder_->control_); |
| 1418 for (Node* node : control_flow_builder_->control_) { | 1416 for (Node* node : control_flow_builder_->control_) { |
| 1419 for (Node* use : node->uses()) { | 1417 for (Node* use : node->uses()) { |
| 1420 if (IrOpcode::IsPhiOpcode(use->opcode())) | 1418 if (NodeProperties::IsPhi(use)) propagation_roots.push_back(use); |
| 1421 propagation_roots.push_back(use); | |
| 1422 } | 1419 } |
| 1423 } | 1420 } |
| 1424 if (FLAG_trace_turbo_scheduler) { | 1421 if (FLAG_trace_turbo_scheduler) { |
| 1425 Trace("propagation roots: "); | 1422 Trace("propagation roots: "); |
| 1426 for (Node* node : propagation_roots) { | 1423 for (Node* node : propagation_roots) { |
| 1427 Trace("#%d:%s ", node->id(), node->op()->mnemonic()); | 1424 Trace("#%d:%s ", node->id(), node->op()->mnemonic()); |
| 1428 } | 1425 } |
| 1429 Trace("\n"); | 1426 Trace("\n"); |
| 1430 } | 1427 } |
| 1431 ScheduleEarlyNodeVisitor schedule_early_visitor(zone_, this); | 1428 ScheduleEarlyNodeVisitor schedule_early_visitor(zone_, this); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 1450 for (Node* const node : *nodes) { | 1447 for (Node* const node : *nodes) { |
| 1451 schedule_->SetBlockForNode(to, node); | 1448 schedule_->SetBlockForNode(to, node); |
| 1452 scheduled_nodes_[to->id().ToSize()].push_back(node); | 1449 scheduled_nodes_[to->id().ToSize()].push_back(node); |
| 1453 } | 1450 } |
| 1454 nodes->clear(); | 1451 nodes->clear(); |
| 1455 } | 1452 } |
| 1456 | 1453 |
| 1457 } // namespace compiler | 1454 } // namespace compiler |
| 1458 } // namespace internal | 1455 } // namespace internal |
| 1459 } // namespace v8 | 1456 } // namespace v8 |
| OLD | NEW |