| 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 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 502 for (LoopTree::Loop* child : loop->children_) PrintLoop(child); | 502 for (LoopTree::Loop* child : loop->children_) PrintLoop(child); |
| 503 } | 503 } |
| 504 }; | 504 }; |
| 505 | 505 |
| 506 | 506 |
| 507 LoopTree* LoopFinder::BuildLoopTree(Graph* graph, Zone* zone) { | 507 LoopTree* LoopFinder::BuildLoopTree(Graph* graph, Zone* zone) { |
| 508 LoopTree* loop_tree = | 508 LoopTree* loop_tree = |
| 509 new (graph->zone()) LoopTree(graph->NodeCount(), graph->zone()); | 509 new (graph->zone()) LoopTree(graph->NodeCount(), graph->zone()); |
| 510 LoopFinderImpl finder(graph, loop_tree, zone); | 510 LoopFinderImpl finder(graph, loop_tree, zone); |
| 511 finder.Run(); | 511 finder.Run(); |
| 512 if (FLAG_trace_turbo_graph) { | 512 if (FLAG_trace_turbo_loop) { |
| 513 finder.Print(); | 513 finder.Print(); |
| 514 } | 514 } |
| 515 return loop_tree; | 515 return loop_tree; |
| 516 } | 516 } |
| 517 | 517 |
| 518 | 518 |
| 519 Node* LoopTree::HeaderNode(Loop* loop) { | 519 Node* LoopTree::HeaderNode(Loop* loop) { |
| 520 Node* first = *HeaderNodes(loop).begin(); | 520 Node* first = *HeaderNodes(loop).begin(); |
| 521 if (first->opcode() == IrOpcode::kLoop) return first; | 521 if (first->opcode() == IrOpcode::kLoop) return first; |
| 522 DCHECK(IrOpcode::IsPhiOpcode(first->opcode())); | 522 DCHECK(IrOpcode::IsPhiOpcode(first->opcode())); |
| 523 Node* header = NodeProperties::GetControlInput(first); | 523 Node* header = NodeProperties::GetControlInput(first); |
| 524 DCHECK_EQ(IrOpcode::kLoop, header->opcode()); | 524 DCHECK_EQ(IrOpcode::kLoop, header->opcode()); |
| 525 return header; | 525 return header; |
| 526 } | 526 } |
| 527 | 527 |
| 528 } // namespace compiler | 528 } // namespace compiler |
| 529 } // namespace internal | 529 } // namespace internal |
| 530 } // namespace v8 | 530 } // namespace v8 |
| OLD | NEW |