Chromium Code Reviews| 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 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 455 LoopTree* loop_tree = | 455 LoopTree* loop_tree = |
| 456 new (graph->zone()) LoopTree(graph->NodeCount(), graph->zone()); | 456 new (graph->zone()) LoopTree(graph->NodeCount(), graph->zone()); |
| 457 LoopFinderImpl finder(graph, loop_tree, zone); | 457 LoopFinderImpl finder(graph, loop_tree, zone); |
| 458 finder.Run(); | 458 finder.Run(); |
| 459 if (FLAG_trace_turbo_graph) { | 459 if (FLAG_trace_turbo_graph) { |
| 460 finder.Print(); | 460 finder.Print(); |
| 461 } | 461 } |
| 462 return loop_tree; | 462 return loop_tree; |
| 463 } | 463 } |
| 464 | 464 |
| 465 | |
| 466 Node* LoopTree::HeaderNode(Loop* loop) { | |
| 467 Node* first = *HeaderNodes(loop).begin(); | |
| 468 if (first->opcode() == IrOpcode::kLoop) return first; | |
| 469 DCHECK(IrOpcode::IsPhiOpcode(first->opcode())); | |
| 470 return first->InputAt(first->InputCount() - 1); | |
|
Michael Starzinger
2015/02/10 15:28:21
nit: Can we use NodeProperties::GetControlInput he
titzer
2015/02/11 13:03:35
Done.
| |
| 471 } | |
| 472 | |
| 465 } // namespace compiler | 473 } // namespace compiler |
| 466 } // namespace internal | 474 } // namespace internal |
| 467 } // namespace v8 | 475 } // namespace v8 |
| OLD | NEW |