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

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

Issue 755353003: Reuse CFGBuilder in the scheduler to save memory. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 6 years 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
« no previous file with comments | « no previous file | 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"
11 #include "src/compiler/schedule.h" 11 #include "src/compiler/schedule.h"
12 #include "src/compiler/zone-pool.h" 12 #include "src/compiler/zone-pool.h"
13 #include "src/zone-containers.h" 13 #include "src/zone-containers.h"
14 14
15 namespace v8 { 15 namespace v8 {
16 namespace internal { 16 namespace internal {
17 namespace compiler { 17 namespace compiler {
18 18
19 class CFGBuilder;
19 class SpecialRPONumberer; 20 class SpecialRPONumberer;
20 21
21 // Computes a schedule from a graph, placing nodes into basic blocks and 22 // Computes a schedule from a graph, placing nodes into basic blocks and
22 // ordering the basic blocks in the special RPO order. 23 // ordering the basic blocks in the special RPO order.
23 class Scheduler { 24 class Scheduler {
24 public: 25 public:
25 // The complete scheduling algorithm. Creates a new schedule and places all 26 // The complete scheduling algorithm. Creates a new schedule and places all
26 // nodes from the graph into it. 27 // nodes from the graph into it.
27 static Schedule* ComputeSchedule(Zone* zone, Graph* graph); 28 static Schedule* ComputeSchedule(Zone* zone, Graph* graph);
28 29
(...skipping 25 matching lines...) Expand all
54 // coupled to another node, or not yet known. 55 // coupled to another node, or not yet known.
55 }; 56 };
56 57
57 Zone* zone_; 58 Zone* zone_;
58 Graph* graph_; 59 Graph* graph_;
59 Schedule* schedule_; 60 Schedule* schedule_;
60 NodeVectorVector scheduled_nodes_; // Per-block list of nodes in reverse. 61 NodeVectorVector scheduled_nodes_; // Per-block list of nodes in reverse.
61 NodeVector schedule_root_nodes_; // Fixed root nodes seed the worklist. 62 NodeVector schedule_root_nodes_; // Fixed root nodes seed the worklist.
62 ZoneQueue<Node*> schedule_queue_; // Worklist of schedulable nodes. 63 ZoneQueue<Node*> schedule_queue_; // Worklist of schedulable nodes.
63 ZoneVector<SchedulerData> node_data_; // Per-node data for all nodes. 64 ZoneVector<SchedulerData> node_data_; // Per-node data for all nodes.
65 CFGBuilder* control_flow_builder_; // Builds basic blocks for controls.
64 SpecialRPONumberer* special_rpo_; // Special RPO numbering of blocks. 66 SpecialRPONumberer* special_rpo_; // Special RPO numbering of blocks.
65 67
66 Scheduler(Zone* zone, Graph* graph, Schedule* schedule); 68 Scheduler(Zone* zone, Graph* graph, Schedule* schedule);
67 69
68 inline SchedulerData DefaultSchedulerData(); 70 inline SchedulerData DefaultSchedulerData();
69 inline SchedulerData* GetData(Node* node); 71 inline SchedulerData* GetData(Node* node);
70 72
71 Placement GetPlacement(Node* node); 73 Placement GetPlacement(Node* node);
72 void UpdatePlacement(Node* node, Placement placement); 74 void UpdatePlacement(Node* node, Placement placement);
73 75
(...skipping 29 matching lines...) Expand all
103 105
104 void FuseFloatingControl(BasicBlock* block, Node* node); 106 void FuseFloatingControl(BasicBlock* block, Node* node);
105 void MovePlannedNodes(BasicBlock* from, BasicBlock* to); 107 void MovePlannedNodes(BasicBlock* from, BasicBlock* to);
106 }; 108 };
107 109
108 } // namespace compiler 110 } // namespace compiler
109 } // namespace internal 111 } // namespace internal
110 } // namespace v8 112 } // namespace v8
111 113
112 #endif // V8_COMPILER_SCHEDULER_H_ 114 #endif // V8_COMPILER_SCHEDULER_H_
OLDNEW
« no previous file with comments | « no previous file | src/compiler/scheduler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698