OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 <deque> | 5 #include <deque> |
6 #include <queue> | 6 #include <queue> |
7 | 7 |
8 #include "src/compiler/scheduler.h" | 8 #include "src/compiler/scheduler.h" |
9 | 9 |
10 #include "src/bit-vector.h" | 10 #include "src/bit-vector.h" |
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 case IrOpcode::kEnd: | 309 case IrOpcode::kEnd: |
310 FixNode(schedule_->end(), node); | 310 FixNode(schedule_->end(), node); |
311 break; | 311 break; |
312 case IrOpcode::kStart: | 312 case IrOpcode::kStart: |
313 FixNode(schedule_->start(), node); | 313 FixNode(schedule_->start(), node); |
314 break; | 314 break; |
315 case IrOpcode::kLoop: | 315 case IrOpcode::kLoop: |
316 case IrOpcode::kMerge: | 316 case IrOpcode::kMerge: |
317 BuildBlockForNode(node); | 317 BuildBlockForNode(node); |
318 break; | 318 break; |
319 case IrOpcode::kTerminate: { | |
320 // Put Terminate in the loop to which it refers. | |
321 Node* loop = NodeProperties::GetControlInput(node); | |
322 BasicBlock* block = BuildBlockForNode(loop); | |
323 FixNode(block, node); | |
324 break; | |
325 } | |
326 case IrOpcode::kBranch: | 319 case IrOpcode::kBranch: |
327 BuildBlocksForSuccessors(node, IrOpcode::kIfTrue, IrOpcode::kIfFalse); | 320 BuildBlocksForSuccessors(node, IrOpcode::kIfTrue, IrOpcode::kIfFalse); |
328 break; | 321 break; |
329 default: | 322 default: |
330 break; | 323 break; |
331 } | 324 } |
332 } | 325 } |
333 | 326 |
334 void ConnectBlocks(Node* node) { | 327 void ConnectBlocks(Node* node) { |
335 switch (node->opcode()) { | 328 switch (node->opcode()) { |
(...skipping 1121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1457 for (Node* const node : *nodes) { | 1450 for (Node* const node : *nodes) { |
1458 schedule_->SetBlockForNode(to, node); | 1451 schedule_->SetBlockForNode(to, node); |
1459 scheduled_nodes_[to->id().ToSize()].push_back(node); | 1452 scheduled_nodes_[to->id().ToSize()].push_back(node); |
1460 } | 1453 } |
1461 nodes->clear(); | 1454 nodes->clear(); |
1462 } | 1455 } |
1463 | 1456 |
1464 } // namespace compiler | 1457 } // namespace compiler |
1465 } // namespace internal | 1458 } // namespace internal |
1466 } // namespace v8 | 1459 } // namespace v8 |
OLD | NEW |