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_; // Whether the node is fixed, schedulable, | 39 Placement placement_ : 3; // Whether the node is fixed, schedulable, |
40 // or not yet known. | 40 // or not yet known. |
41 NodeVector additional_dependencies; | |
42 }; | 41 }; |
43 | 42 |
44 Zone* zone_; | 43 Zone* zone_; |
45 Graph* graph_; | 44 Graph* graph_; |
46 Schedule* schedule_; | 45 Schedule* schedule_; |
47 NodeVectorVector scheduled_nodes_; | 46 NodeVectorVector scheduled_nodes_; |
48 NodeVector schedule_root_nodes_; | 47 NodeVector schedule_root_nodes_; |
49 ZoneVector<SchedulerData> node_data_; | 48 ZoneVector<SchedulerData> node_data_; |
50 bool has_floating_control_; | 49 bool has_floating_control_; |
51 | 50 |
52 Scheduler(Zone* zone, Graph* graph, Schedule* schedule); | 51 Scheduler(Zone* zone, Graph* graph, Schedule* schedule); |
53 | 52 |
54 SchedulerData DefaultSchedulerData(Zone* zone); | 53 SchedulerData DefaultSchedulerData(); |
55 | 54 |
56 SchedulerData* GetData(Node* node) { | 55 SchedulerData* GetData(Node* node) { |
57 DCHECK(node->id() < static_cast<int>(node_data_.size())); | 56 DCHECK(node->id() < static_cast<int>(node_data_.size())); |
58 return &node_data_[node->id()]; | 57 return &node_data_[node->id()]; |
59 } | 58 } |
60 | 59 |
61 Placement GetPlacement(Node* node); | 60 Placement GetPlacement(Node* node); |
62 | 61 |
63 int GetRPONumber(BasicBlock* block) { | 62 int GetRPONumber(BasicBlock* block) { |
64 DCHECK(block->rpo_number() >= 0 && | 63 DCHECK(block->rpo_number() >= 0 && |
(...skipping 24 matching lines...) Expand all Loading... |
89 | 88 |
90 bool ConnectFloatingControl(); | 89 bool ConnectFloatingControl(); |
91 void ConnectFloatingControlSubgraph(BasicBlock* block, Node* node); | 90 void ConnectFloatingControlSubgraph(BasicBlock* block, Node* node); |
92 }; | 91 }; |
93 | 92 |
94 } // namespace compiler | 93 } // namespace compiler |
95 } // namespace internal | 94 } // namespace internal |
96 } // namespace v8 | 95 } // namespace v8 |
97 | 96 |
98 #endif // V8_COMPILER_SCHEDULER_H_ | 97 #endif // V8_COMPILER_SCHEDULER_H_ |
OLD | NEW |