| 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" |
| 11 #include "src/globals.h" |
| 11 #include "src/zone/zone-containers.h" | 12 #include "src/zone/zone-containers.h" |
| 12 | 13 |
| 13 namespace v8 { | 14 namespace v8 { |
| 14 namespace internal { | 15 namespace internal { |
| 15 namespace compiler { | 16 namespace compiler { |
| 16 | 17 |
| 17 // TODO(titzer): don't assume entry edges have a particular index. | 18 // TODO(titzer): don't assume entry edges have a particular index. |
| 18 static const int kAssumedLoopEntryIndex = 0; // assume loops are entered here. | 19 static const int kAssumedLoopEntryIndex = 0; // assume loops are entered here. |
| 19 | 20 |
| 20 class LoopFinderImpl; | 21 class LoopFinderImpl; |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 } | 147 } |
| 147 } | 148 } |
| 148 | 149 |
| 149 Zone* zone_; | 150 Zone* zone_; |
| 150 ZoneVector<Loop*> outer_loops_; | 151 ZoneVector<Loop*> outer_loops_; |
| 151 ZoneVector<Loop> all_loops_; | 152 ZoneVector<Loop> all_loops_; |
| 152 ZoneVector<int> node_to_loop_num_; | 153 ZoneVector<int> node_to_loop_num_; |
| 153 ZoneVector<Node*> loop_nodes_; | 154 ZoneVector<Node*> loop_nodes_; |
| 154 }; | 155 }; |
| 155 | 156 |
| 156 class LoopFinder { | 157 class V8_EXPORT_PRIVATE LoopFinder { |
| 157 public: | 158 public: |
| 158 // Build a loop tree for the entire graph. | 159 // Build a loop tree for the entire graph. |
| 159 static LoopTree* BuildLoopTree(Graph* graph, Zone* temp_zone); | 160 static LoopTree* BuildLoopTree(Graph* graph, Zone* temp_zone); |
| 160 }; | 161 }; |
| 161 | 162 |
| 162 | 163 |
| 163 } // namespace compiler | 164 } // namespace compiler |
| 164 } // namespace internal | 165 } // namespace internal |
| 165 } // namespace v8 | 166 } // namespace v8 |
| 166 | 167 |
| 167 #endif // V8_COMPILER_LOOP_ANALYSIS_H_ | 168 #endif // V8_COMPILER_LOOP_ANALYSIS_H_ |
| OLD | NEW |