| 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 #ifndef V8_COMPILER_SCHEDULER_H_ | 5 #ifndef V8_COMPILER_SCHEDULER_H_ |
| 6 #define V8_COMPILER_SCHEDULER_H_ | 6 #define V8_COMPILER_SCHEDULER_H_ |
| 7 | 7 |
| 8 #include "src/v8.h" | 8 #include "src/v8.h" |
| 9 | 9 |
| 10 #include "src/compiler/opcodes.h" | 10 #include "src/compiler/opcodes.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 private: | 29 private: |
| 30 enum Placement { kUnknown, kSchedulable, kFixed }; | 30 enum Placement { kUnknown, kSchedulable, kFixed }; |
| 31 | 31 |
| 32 // Per-node data tracked during scheduling. | 32 // Per-node data tracked during scheduling. |
| 33 struct SchedulerData { | 33 struct SchedulerData { |
| 34 int unscheduled_count_; // Number of unscheduled uses of this node. | 34 int unscheduled_count_; // Number of unscheduled uses of this node. |
| 35 int minimum_rpo_; // Minimum legal RPO placement. | 35 int minimum_rpo_; // Minimum legal RPO placement. |
| 36 bool is_connected_control_; // {true} if control-connected to the end node. | 36 bool is_connected_control_; // {true} if control-connected to the end node. |
| 37 bool is_floating_control_; // {true} if control, but not control-connected | 37 bool is_floating_control_; // {true} if control, but not control-connected |
| 38 // to the end node. | 38 // to the end node. |
| 39 Placement placement_ : 3; // Whether the node is fixed, schedulable, | 39 Placement placement_; // Whether the node is fixed, schedulable, |
| 40 // or not yet known. | 40 // or not yet known. |
| 41 NodeVector additional_dependencies; |
| 41 }; | 42 }; |
| 42 | 43 |
| 43 Zone* zone_; | 44 Zone* zone_; |
| 44 Graph* graph_; | 45 Graph* graph_; |
| 45 Schedule* schedule_; | 46 Schedule* schedule_; |
| 46 NodeVectorVector scheduled_nodes_; | 47 NodeVectorVector scheduled_nodes_; |
| 47 NodeVector schedule_root_nodes_; | 48 NodeVector schedule_root_nodes_; |
| 48 ZoneVector<SchedulerData> node_data_; | 49 ZoneVector<SchedulerData> node_data_; |
| 49 bool has_floating_control_; | 50 bool has_floating_control_; |
| 50 | 51 |
| 51 Scheduler(Zone* zone, Graph* graph, Schedule* schedule); | 52 Scheduler(Zone* zone, Graph* graph, Schedule* schedule); |
| 52 | 53 |
| 53 SchedulerData DefaultSchedulerData(); | 54 SchedulerData DefaultSchedulerData(Zone* zone); |
| 54 | 55 |
| 55 SchedulerData* GetData(Node* node) { | 56 SchedulerData* GetData(Node* node) { |
| 56 DCHECK(node->id() < static_cast<int>(node_data_.size())); | 57 DCHECK(node->id() < static_cast<int>(node_data_.size())); |
| 57 return &node_data_[node->id()]; | 58 return &node_data_[node->id()]; |
| 58 } | 59 } |
| 59 | 60 |
| 60 Placement GetPlacement(Node* node); | 61 Placement GetPlacement(Node* node); |
| 61 | 62 |
| 62 int GetRPONumber(BasicBlock* block) { | 63 int GetRPONumber(BasicBlock* block) { |
| 63 DCHECK(block->rpo_number() >= 0 && | 64 DCHECK(block->rpo_number() >= 0 && |
| (...skipping 24 matching lines...) Expand all Loading... |
| 88 | 89 |
| 89 bool ConnectFloatingControl(); | 90 bool ConnectFloatingControl(); |
| 90 void ConnectFloatingControlSubgraph(BasicBlock* block, Node* node); | 91 void ConnectFloatingControlSubgraph(BasicBlock* block, Node* node); |
| 91 }; | 92 }; |
| 92 | 93 |
| 93 } // namespace compiler | 94 } // namespace compiler |
| 94 } // namespace internal | 95 } // namespace internal |
| 95 } // namespace v8 | 96 } // namespace v8 |
| 96 | 97 |
| 97 #endif // V8_COMPILER_SCHEDULER_H_ | 98 #endif // V8_COMPILER_SCHEDULER_H_ |
| OLD | NEW |