| 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 "src/compiler/scheduler.h" | 5 #include "src/compiler/scheduler.h" |
| 6 | 6 |
| 7 #include <iomanip> | 7 #include <iomanip> |
| 8 | 8 |
| 9 #include "src/bit-vector.h" | 9 #include "src/bit-vector.h" |
| 10 #include "src/compiler/common-operator.h" | 10 #include "src/compiler/common-operator.h" |
| (...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 338 ConnectMerge(node); | 338 ConnectMerge(node); |
| 339 break; | 339 break; |
| 340 case IrOpcode::kBranch: | 340 case IrOpcode::kBranch: |
| 341 scheduler_->UpdatePlacement(node, Scheduler::kFixed); | 341 scheduler_->UpdatePlacement(node, Scheduler::kFixed); |
| 342 ConnectBranch(node); | 342 ConnectBranch(node); |
| 343 break; | 343 break; |
| 344 case IrOpcode::kSwitch: | 344 case IrOpcode::kSwitch: |
| 345 scheduler_->UpdatePlacement(node, Scheduler::kFixed); | 345 scheduler_->UpdatePlacement(node, Scheduler::kFixed); |
| 346 ConnectSwitch(node); | 346 ConnectSwitch(node); |
| 347 break; | 347 break; |
| 348 case IrOpcode::kDeoptimize: |
| 349 scheduler_->UpdatePlacement(node, Scheduler::kFixed); |
| 350 ConnectDeoptimize(node); |
| 351 break; |
| 348 case IrOpcode::kReturn: | 352 case IrOpcode::kReturn: |
| 349 scheduler_->UpdatePlacement(node, Scheduler::kFixed); | 353 scheduler_->UpdatePlacement(node, Scheduler::kFixed); |
| 350 ConnectReturn(node); | 354 ConnectReturn(node); |
| 351 break; | 355 break; |
| 352 case IrOpcode::kThrow: | 356 case IrOpcode::kThrow: |
| 353 scheduler_->UpdatePlacement(node, Scheduler::kFixed); | 357 scheduler_->UpdatePlacement(node, Scheduler::kFixed); |
| 354 ConnectThrow(node); | 358 ConnectThrow(node); |
| 355 break; | 359 break; |
| 356 case IrOpcode::kCall: | 360 case IrOpcode::kCall: |
| 357 if (IsExceptionalCall(node)) { | 361 if (IsExceptionalCall(node)) { |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 487 } | 491 } |
| 488 } | 492 } |
| 489 | 493 |
| 490 void ConnectReturn(Node* ret) { | 494 void ConnectReturn(Node* ret) { |
| 491 Node* return_control = NodeProperties::GetControlInput(ret); | 495 Node* return_control = NodeProperties::GetControlInput(ret); |
| 492 BasicBlock* return_block = FindPredecessorBlock(return_control); | 496 BasicBlock* return_block = FindPredecessorBlock(return_control); |
| 493 TraceConnect(ret, return_block, NULL); | 497 TraceConnect(ret, return_block, NULL); |
| 494 schedule_->AddReturn(return_block, ret); | 498 schedule_->AddReturn(return_block, ret); |
| 495 } | 499 } |
| 496 | 500 |
| 501 void ConnectDeoptimize(Node* deopt) { |
| 502 Node* deoptimize_control = NodeProperties::GetControlInput(deopt); |
| 503 BasicBlock* deoptimize_block = FindPredecessorBlock(deoptimize_control); |
| 504 TraceConnect(deopt, deoptimize_block, NULL); |
| 505 schedule_->AddDeoptimize(deoptimize_block, deopt); |
| 506 } |
| 507 |
| 497 void ConnectThrow(Node* thr) { | 508 void ConnectThrow(Node* thr) { |
| 498 Node* throw_control = NodeProperties::GetControlInput(thr); | 509 Node* throw_control = NodeProperties::GetControlInput(thr); |
| 499 BasicBlock* throw_block = FindPredecessorBlock(throw_control); | 510 BasicBlock* throw_block = FindPredecessorBlock(throw_control); |
| 500 TraceConnect(thr, throw_block, NULL); | 511 TraceConnect(thr, throw_block, NULL); |
| 501 schedule_->AddThrow(throw_block, thr); | 512 schedule_->AddThrow(throw_block, thr); |
| 502 } | 513 } |
| 503 | 514 |
| 504 void TraceConnect(Node* node, BasicBlock* block, BasicBlock* succ) { | 515 void TraceConnect(Node* node, BasicBlock* block, BasicBlock* succ) { |
| 505 DCHECK_NOT_NULL(block); | 516 DCHECK_NOT_NULL(block); |
| 506 if (succ == NULL) { | 517 if (succ == NULL) { |
| (...skipping 1173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1680 for (Node* const node : *nodes) { | 1691 for (Node* const node : *nodes) { |
| 1681 schedule_->SetBlockForNode(to, node); | 1692 schedule_->SetBlockForNode(to, node); |
| 1682 scheduled_nodes_[to->id().ToSize()].push_back(node); | 1693 scheduled_nodes_[to->id().ToSize()].push_back(node); |
| 1683 } | 1694 } |
| 1684 nodes->clear(); | 1695 nodes->clear(); |
| 1685 } | 1696 } |
| 1686 | 1697 |
| 1687 } // namespace compiler | 1698 } // namespace compiler |
| 1688 } // namespace internal | 1699 } // namespace internal |
| 1689 } // namespace v8 | 1700 } // namespace v8 |
| OLD | NEW |