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

Side by Side Diff: src/compiler/control-flow-optimizer.h

Issue 1160863003: [turbofan] Remove the JSGraph dependency from the ControlFlowOptimizer. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 6 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
« no previous file with comments | « no previous file | src/compiler/control-flow-optimizer.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 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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_CONTROL_FLOW_OPTIMIZER_H_ 5 #ifndef V8_COMPILER_CONTROL_FLOW_OPTIMIZER_H_
6 #define V8_COMPILER_CONTROL_FLOW_OPTIMIZER_H_ 6 #define V8_COMPILER_CONTROL_FLOW_OPTIMIZER_H_
7 7
8 #include "src/compiler/node-marker.h" 8 #include "src/compiler/node-marker.h"
9 #include "src/zone-containers.h" 9 #include "src/zone-containers.h"
10 10
11 namespace v8 { 11 namespace v8 {
12 namespace internal { 12 namespace internal {
13 namespace compiler { 13 namespace compiler {
14 14
15 // Forward declarations. 15 // Forward declarations.
16 class CommonOperatorBuilder; 16 class CommonOperatorBuilder;
17 class Graph; 17 class Graph;
18 class JSGraph;
19 class MachineOperatorBuilder; 18 class MachineOperatorBuilder;
20 class Node; 19 class Node;
21 20
22 21
23 class ControlFlowOptimizer final { 22 class ControlFlowOptimizer final {
24 public: 23 public:
25 ControlFlowOptimizer(JSGraph* jsgraph, Zone* zone); 24 ControlFlowOptimizer(Graph* graph, CommonOperatorBuilder* common,
25 MachineOperatorBuilder* machine, Zone* zone);
26 26
27 void Optimize(); 27 void Optimize();
28 28
29 private: 29 private:
30 void Enqueue(Node* node); 30 void Enqueue(Node* node);
31 void VisitNode(Node* node); 31 void VisitNode(Node* node);
32 void VisitBranch(Node* node); 32 void VisitBranch(Node* node);
33 33
34 bool TryBuildSwitch(Node* node); 34 bool TryBuildSwitch(Node* node);
35 bool TryCloneBranch(Node* node); 35 bool TryCloneBranch(Node* node);
36 36
37 CommonOperatorBuilder* common() const; 37 Graph* graph() const { return graph_; }
38 Graph* graph() const; 38 CommonOperatorBuilder* common() const { return common_; }
39 JSGraph* jsgraph() const { return jsgraph_; } 39 MachineOperatorBuilder* machine() const { return machine_; }
40 MachineOperatorBuilder* machine() const;
41 Zone* zone() const { return zone_; } 40 Zone* zone() const { return zone_; }
42 41
43 JSGraph* const jsgraph_; 42 Graph* const graph_;
43 CommonOperatorBuilder* const common_;
44 MachineOperatorBuilder* const machine_;
44 ZoneQueue<Node*> queue_; 45 ZoneQueue<Node*> queue_;
45 NodeMarker<bool> queued_; 46 NodeMarker<bool> queued_;
46 Zone* const zone_; 47 Zone* const zone_;
47 48
48 DISALLOW_COPY_AND_ASSIGN(ControlFlowOptimizer); 49 DISALLOW_COPY_AND_ASSIGN(ControlFlowOptimizer);
49 }; 50 };
50 51
51 } // namespace compiler 52 } // namespace compiler
52 } // namespace internal 53 } // namespace internal
53 } // namespace v8 54 } // namespace v8
54 55
55 #endif // V8_COMPILER_CONTROL_FLOW_OPTIMIZER_H_ 56 #endif // V8_COMPILER_CONTROL_FLOW_OPTIMIZER_H_
OLDNEW
« no previous file with comments | « no previous file | src/compiler/control-flow-optimizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698