Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(455)

Side by Side Diff: src/compiler/scheduler.h

Issue 499363002: Schedule floating control. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/compiler/schedule.h ('k') | src/compiler/scheduler.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 13 matching lines...) Expand all
24 static Schedule* ComputeSchedule(Graph* graph); 24 static Schedule* ComputeSchedule(Graph* graph);
25 25
26 // Compute the RPO of blocks in an existing schedule. 26 // Compute the RPO of blocks in an existing schedule.
27 static BasicBlockVector* ComputeSpecialRPO(Schedule* schedule); 27 static BasicBlockVector* ComputeSpecialRPO(Schedule* schedule);
28 28
29 // (Exposed for testing only) 29 // (Exposed for testing only)
30 // Build and connect the CFG for a node graph, but don't schedule nodes. 30 // Build and connect the CFG for a node graph, but don't schedule nodes.
31 static void ComputeCFG(Graph* graph, Schedule* schedule); 31 static void ComputeCFG(Graph* graph, Schedule* schedule);
32 32
33 private: 33 private:
34 enum Placement { kUnknown, kSchedulable, kFixed };
35
36 // Per-node data tracked during scheduling.
37 struct SchedulerData {
38 int unscheduled_count_; // Number of unscheduled uses of this node.
39 int minimum_rpo_; // Minimum legal RPO placement.
40 bool is_connected_control_; // {true} if control-connected to the end node.
41 bool is_floating_control_; // {true} if control, but not control-connected
42 // to the end node.
43 Placement placement_ : 3; // Whether the node is fixed, schedulable,
44 // or not yet known.
45 };
46
34 Zone* zone_; 47 Zone* zone_;
35 Graph* graph_; 48 Graph* graph_;
36 Schedule* schedule_; 49 Schedule* schedule_;
37 IntVector unscheduled_uses_;
38 NodeVectorVector scheduled_nodes_; 50 NodeVectorVector scheduled_nodes_;
39 NodeVector schedule_root_nodes_; 51 NodeVector schedule_root_nodes_;
40 IntVector schedule_early_rpo_index_; 52 ZoneVector<SchedulerData> node_data_;
53 bool has_floating_control_;
41 54
42 Scheduler(Zone* zone, Graph* graph, Schedule* schedule); 55 Scheduler(Zone* zone, Graph* graph, Schedule* schedule);
43 56
44 bool IsBasicBlockBegin(Node* node); 57 SchedulerData* GetData(Node* node) {
45 bool HasFixedSchedulePosition(Node* node); 58 DCHECK(node->id() < static_cast<int>(node_data_.size()));
46 bool IsScheduleRoot(Node* node); 59 return &node_data_[node->id()];
60 }
61
62 void BuildCFG();
63
64 Placement GetPlacement(Node* node);
47 65
48 int GetRPONumber(BasicBlock* block) { 66 int GetRPONumber(BasicBlock* block) {
49 DCHECK(block->rpo_number_ >= 0 && 67 DCHECK(block->rpo_number_ >= 0 &&
50 block->rpo_number_ < static_cast<int>(schedule_->rpo_order_.size())); 68 block->rpo_number_ < static_cast<int>(schedule_->rpo_order_.size()));
51 DCHECK(schedule_->rpo_order_[block->rpo_number_] == block); 69 DCHECK(schedule_->rpo_order_[block->rpo_number_] == block);
52 return block->rpo_number_; 70 return block->rpo_number_;
53 } 71 }
54 72
55 void PrepareAuxiliaryNodeData();
56 void PrepareAuxiliaryBlockData();
57
58 void GenerateImmediateDominatorTree(); 73 void GenerateImmediateDominatorTree();
59 BasicBlock* GetCommonDominator(BasicBlock* b1, BasicBlock* b2); 74 BasicBlock* GetCommonDominator(BasicBlock* b1, BasicBlock* b2);
60 75
76 friend class CFGBuilder;
77
61 friend class ScheduleEarlyNodeVisitor; 78 friend class ScheduleEarlyNodeVisitor;
62 void ScheduleEarly(); 79 void ScheduleEarly();
63 80
64 friend class PrepareUsesVisitor; 81 friend class PrepareUsesVisitor;
65 void PrepareUses(); 82 void PrepareUses();
66 83
67 friend class ScheduleLateNodeVisitor; 84 friend class ScheduleLateNodeVisitor;
68 void ScheduleLate(); 85 void ScheduleLate();
86
87 bool ConnectFloatingControl();
88
89 void ConnectFloatingControlSubgraph(BasicBlock* block, Node* node);
69 }; 90 };
70 } 91 }
71 } 92 }
72 } // namespace v8::internal::compiler 93 } // namespace v8::internal::compiler
73 94
74 #endif // V8_COMPILER_SCHEDULER_H_ 95 #endif // V8_COMPILER_SCHEDULER_H_
OLDNEW
« no previous file with comments | « src/compiler/schedule.h ('k') | src/compiler/scheduler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698