| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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_LOOP_ANALYSIS_H_ | 5 #ifndef V8_COMPILER_LOOP_ANALYSIS_H_ |
| 6 #define V8_COMPILER_LOOP_ANALYSIS_H_ | 6 #define V8_COMPILER_LOOP_ANALYSIS_H_ |
| 7 | 7 |
| 8 #include "src/base/iterator.h" | 8 #include "src/base/iterator.h" |
| 9 #include "src/compiler/graph.h" | 9 #include "src/compiler/graph.h" |
| 10 #include "src/compiler/node.h" | 10 #include "src/compiler/node.h" |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 &loop_nodes_[0] + loop->body_end_); | 106 &loop_nodes_[0] + loop->body_end_); |
| 107 } | 107 } |
| 108 | 108 |
| 109 // Return the node that represents the control, i.e. the loop node itself. | 109 // Return the node that represents the control, i.e. the loop node itself. |
| 110 Node* GetLoopControl(Loop* loop) { | 110 Node* GetLoopControl(Loop* loop) { |
| 111 // TODO(turbofan): make the loop control node always first? | 111 // TODO(turbofan): make the loop control node always first? |
| 112 for (Node* node : HeaderNodes(loop)) { | 112 for (Node* node : HeaderNodes(loop)) { |
| 113 if (node->opcode() == IrOpcode::kLoop) return node; | 113 if (node->opcode() == IrOpcode::kLoop) return node; |
| 114 } | 114 } |
| 115 UNREACHABLE(); | 115 UNREACHABLE(); |
| 116 return NULL; | 116 return nullptr; |
| 117 } | 117 } |
| 118 | 118 |
| 119 private: | 119 private: |
| 120 friend class LoopFinderImpl; | 120 friend class LoopFinderImpl; |
| 121 | 121 |
| 122 Loop* NewLoop() { | 122 Loop* NewLoop() { |
| 123 all_loops_.push_back(Loop(zone_)); | 123 all_loops_.push_back(Loop(zone_)); |
| 124 Loop* result = &all_loops_.back(); | 124 Loop* result = &all_loops_.back(); |
| 125 return result; | 125 return result; |
| 126 } | 126 } |
| (...skipping 20 matching lines...) Expand all Loading... |
| 147 // Build a loop tree for the entire graph. | 147 // Build a loop tree for the entire graph. |
| 148 static LoopTree* BuildLoopTree(Graph* graph, Zone* temp_zone); | 148 static LoopTree* BuildLoopTree(Graph* graph, Zone* temp_zone); |
| 149 }; | 149 }; |
| 150 | 150 |
| 151 | 151 |
| 152 } // namespace compiler | 152 } // namespace compiler |
| 153 } // namespace internal | 153 } // namespace internal |
| 154 } // namespace v8 | 154 } // namespace v8 |
| 155 | 155 |
| 156 #endif // V8_COMPILER_LOOP_ANALYSIS_H_ | 156 #endif // V8_COMPILER_LOOP_ANALYSIS_H_ |
| OLD | NEW |