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 27 matching lines...) Expand all Loading... |
38 bool is_connected_control_; // {true} if control-connected to the end node. | 38 bool is_connected_control_; // {true} if control-connected to the end node. |
39 bool is_floating_control_; // {true} if control, but not control-connected | 39 bool is_floating_control_; // {true} if control, but not control-connected |
40 // to the end node. | 40 // to the end node. |
41 Placement placement_; // Whether the node is fixed, schedulable, | 41 Placement placement_; // Whether the node is fixed, schedulable, |
42 // coupled to another node, or not yet known. | 42 // coupled to another node, or not yet known. |
43 }; | 43 }; |
44 | 44 |
45 Zone* zone_; | 45 Zone* zone_; |
46 Graph* graph_; | 46 Graph* graph_; |
47 Schedule* schedule_; | 47 Schedule* schedule_; |
48 NodeVectorVector scheduled_nodes_; | 48 NodeVectorVector scheduled_nodes_; // Per-block list of nodes in reverse. |
49 NodeVector schedule_root_nodes_; | 49 NodeVector schedule_root_nodes_; // Fixed root nodes seed the worklist. |
50 ZoneQueue<Node*> schedule_queue_; | 50 ZoneQueue<Node*> schedule_queue_; // Worklist of schedulable nodes. |
51 ZoneVector<SchedulerData> node_data_; | 51 ZoneVector<SchedulerData> node_data_; // Per-node data for all nodes. |
52 bool has_floating_control_; | 52 bool has_floating_control_; |
53 | 53 |
54 Scheduler(Zone* zone, Graph* graph, Schedule* schedule); | 54 Scheduler(Zone* zone, Graph* graph, Schedule* schedule); |
55 | 55 |
56 inline SchedulerData DefaultSchedulerData(); | 56 inline SchedulerData DefaultSchedulerData(); |
57 inline SchedulerData* GetData(Node* node); | 57 inline SchedulerData* GetData(Node* node); |
58 | 58 |
59 Placement GetPlacement(Node* node); | 59 Placement GetPlacement(Node* node); |
60 | 60 |
61 void IncrementUnscheduledUseCount(Node* node, Node* from); | 61 void IncrementUnscheduledUseCount(Node* node, Node* from); |
62 void DecrementUnscheduledUseCount(Node* node, Node* from); | 62 void DecrementUnscheduledUseCount(Node* node, Node* from); |
63 | 63 |
64 inline int GetRPONumber(BasicBlock* block); | 64 inline int GetRPONumber(BasicBlock* block); |
65 BasicBlock* GetCommonDominator(BasicBlock* b1, BasicBlock* b2); | 65 BasicBlock* GetCommonDominator(BasicBlock* b1, BasicBlock* b2); |
66 | 66 |
67 // Phase 1: Build control-flow graph and dominator tree. | 67 // Phase 1: Build control-flow graph. |
68 friend class CFGBuilder; | 68 friend class CFGBuilder; |
69 void BuildCFG(); | 69 void BuildCFG(); |
| 70 |
| 71 // Phase 2: Compute special RPO and dominator tree. |
| 72 friend class SpecialRPONumberer; |
| 73 void ComputeSpecialRPONumbering(); |
70 void GenerateImmediateDominatorTree(); | 74 void GenerateImmediateDominatorTree(); |
71 | 75 |
72 // Phase 2: Prepare use counts for nodes. | 76 // Phase 3: Prepare use counts for nodes. |
73 friend class PrepareUsesVisitor; | 77 friend class PrepareUsesVisitor; |
74 void PrepareUses(); | 78 void PrepareUses(); |
75 | 79 |
76 // Phase 3: Schedule nodes early. | 80 // Phase 4: Schedule nodes early. |
77 friend class ScheduleEarlyNodeVisitor; | 81 friend class ScheduleEarlyNodeVisitor; |
78 void ScheduleEarly(); | 82 void ScheduleEarly(); |
79 | 83 |
80 // Phase 4: Schedule nodes late. | 84 // Phase 5: Schedule nodes late. |
81 friend class ScheduleLateNodeVisitor; | 85 friend class ScheduleLateNodeVisitor; |
82 void ScheduleLate(); | 86 void ScheduleLate(); |
83 | 87 |
84 bool ConnectFloatingControl(); | 88 bool ConnectFloatingControl(); |
85 void ConnectFloatingControlSubgraph(BasicBlock* block, Node* node); | 89 void ConnectFloatingControlSubgraph(BasicBlock* block, Node* node); |
86 }; | 90 }; |
87 | 91 |
88 } // namespace compiler | 92 } // namespace compiler |
89 } // namespace internal | 93 } // namespace internal |
90 } // namespace v8 | 94 } // namespace v8 |
91 | 95 |
92 #endif // V8_COMPILER_SCHEDULER_H_ | 96 #endif // V8_COMPILER_SCHEDULER_H_ |
OLD | NEW |