| 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 #include "src/compiler/loop-analysis.h" | 5 #include "src/compiler/loop-analysis.h" |
| 6 | 6 |
| 7 #include "src/compiler/graph.h" | 7 #include "src/compiler/graph.h" |
| 8 #include "src/compiler/node.h" | 8 #include "src/compiler/node.h" |
| 9 #include "src/compiler/node-marker.h" | 9 #include "src/compiler/node-marker.h" |
| 10 #include "src/compiler/node-properties.h" | 10 #include "src/compiler/node-properties.h" |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 | 228 |
| 229 // Create a new loop. | 229 // Create a new loop. |
| 230 loops_.push_back({node, nullptr, nullptr, nullptr}); | 230 loops_.push_back({node, nullptr, nullptr, nullptr}); |
| 231 loop_tree_->NewLoop(); | 231 loop_tree_->NewLoop(); |
| 232 SetBackwardMark(node, loop_num); | 232 SetBackwardMark(node, loop_num); |
| 233 loop_tree_->node_to_loop_num_[node->id()] = loop_num; | 233 loop_tree_->node_to_loop_num_[node->id()] = loop_num; |
| 234 | 234 |
| 235 // Setup loop mark for phis attached to loop header. | 235 // Setup loop mark for phis attached to loop header. |
| 236 for (Node* use : node->uses()) { | 236 for (Node* use : node->uses()) { |
| 237 if (NodeProperties::IsPhi(use)) { | 237 if (NodeProperties::IsPhi(use)) { |
| 238 info(use); // create the NodeInfo |
| 238 SetBackwardMark(use, loop_num); | 239 SetBackwardMark(use, loop_num); |
| 239 loop_tree_->node_to_loop_num_[use->id()] = loop_num; | 240 loop_tree_->node_to_loop_num_[use->id()] = loop_num; |
| 240 } | 241 } |
| 241 } | 242 } |
| 242 | 243 |
| 243 return loop_num; | 244 return loop_num; |
| 244 } | 245 } |
| 245 | 246 |
| 246 void ResizeBackwardMarks() { | 247 void ResizeBackwardMarks() { |
| 247 int new_width = width_ + 1; | 248 int new_width = width_ + 1; |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 457 finder.Run(); | 458 finder.Run(); |
| 458 if (FLAG_trace_turbo_graph) { | 459 if (FLAG_trace_turbo_graph) { |
| 459 finder.Print(); | 460 finder.Print(); |
| 460 } | 461 } |
| 461 return loop_tree; | 462 return loop_tree; |
| 462 } | 463 } |
| 463 | 464 |
| 464 } // namespace compiler | 465 } // namespace compiler |
| 465 } // namespace internal | 466 } // namespace internal |
| 466 } // namespace v8 | 467 } // namespace v8 |
| OLD | NEW |