| OLD | NEW |
| 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 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 public: | 24 public: |
| 25 ControlFlowOptimizer(JSGraph* jsgraph, Zone* zone); | 25 ControlFlowOptimizer(JSGraph* jsgraph, 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); |
| 35 bool TryCloneBranch(Node* node); |
| 36 |
| 34 CommonOperatorBuilder* common() const; | 37 CommonOperatorBuilder* common() const; |
| 35 Graph* graph() const; | 38 Graph* graph() const; |
| 36 JSGraph* jsgraph() const { return jsgraph_; } | 39 JSGraph* jsgraph() const { return jsgraph_; } |
| 37 MachineOperatorBuilder* machine() const; | 40 MachineOperatorBuilder* machine() const; |
| 38 Zone* zone() const { return zone_; } | 41 Zone* zone() const { return zone_; } |
| 39 | 42 |
| 40 JSGraph* const jsgraph_; | 43 JSGraph* const jsgraph_; |
| 41 ZoneQueue<Node*> queue_; | 44 ZoneQueue<Node*> queue_; |
| 42 NodeMarker<bool> queued_; | 45 NodeMarker<bool> queued_; |
| 43 Zone* const zone_; | 46 Zone* const zone_; |
| 44 | 47 |
| 45 DISALLOW_COPY_AND_ASSIGN(ControlFlowOptimizer); | 48 DISALLOW_COPY_AND_ASSIGN(ControlFlowOptimizer); |
| 46 }; | 49 }; |
| 47 | 50 |
| 48 } // namespace compiler | 51 } // namespace compiler |
| 49 } // namespace internal | 52 } // namespace internal |
| 50 } // namespace v8 | 53 } // namespace v8 |
| 51 | 54 |
| 52 #endif // V8_COMPILER_CONTROL_FLOW_OPTIMIZER_H_ | 55 #endif // V8_COMPILER_CONTROL_FLOW_OPTIMIZER_H_ |
| OLD | NEW |