Index: src/compiler/schedule.cc |
diff --git a/src/compiler/schedule.cc b/src/compiler/schedule.cc |
index 8924ae54401a0c8919281228d7f7bdd70a8adfd9..ec0caf0008cab5e1a8d91ee1af0ab2c3a957fbf1 100644 |
--- a/src/compiler/schedule.cc |
+++ b/src/compiler/schedule.cc |
@@ -100,6 +100,8 @@ std::ostream& operator<<(std::ostream& os, const BasicBlock::Control& c) { |
return os << "none"; |
case BasicBlock::kGoto: |
return os << "goto"; |
+ case BasicBlock::kCall: |
+ return os << "call"; |
case BasicBlock::kBranch: |
return os << "branch"; |
case BasicBlock::kSwitch: |
@@ -194,16 +196,27 @@ void Schedule::AddNode(BasicBlock* block, Node* node) { |
void Schedule::AddGoto(BasicBlock* block, BasicBlock* succ) { |
- DCHECK(block->control() == BasicBlock::kNone); |
+ DCHECK_EQ(BasicBlock::kNone, block->control()); |
block->set_control(BasicBlock::kGoto); |
AddSuccessor(block, succ); |
} |
+void Schedule::AddCall(BasicBlock* block, Node* call, BasicBlock* success_block, |
+ BasicBlock* exception_block) { |
+ DCHECK_EQ(BasicBlock::kNone, block->control()); |
+ DCHECK_EQ(IrOpcode::kCall, call->opcode()); |
+ block->set_control(BasicBlock::kCall); |
+ AddSuccessor(block, success_block); |
+ AddSuccessor(block, exception_block); |
+ SetControlInput(block, call); |
+} |
+ |
+ |
void Schedule::AddBranch(BasicBlock* block, Node* branch, BasicBlock* tblock, |
BasicBlock* fblock) { |
- DCHECK(block->control() == BasicBlock::kNone); |
- DCHECK(branch->opcode() == IrOpcode::kBranch); |
+ DCHECK_EQ(BasicBlock::kNone, block->control()); |
+ DCHECK_EQ(IrOpcode::kBranch, branch->opcode()); |
block->set_control(BasicBlock::kBranch); |
AddSuccessor(block, tblock); |
AddSuccessor(block, fblock); |
@@ -224,7 +237,7 @@ void Schedule::AddSwitch(BasicBlock* block, Node* sw, BasicBlock** succ_blocks, |
void Schedule::AddReturn(BasicBlock* block, Node* input) { |
- DCHECK(block->control() == BasicBlock::kNone); |
+ DCHECK_EQ(BasicBlock::kNone, block->control()); |
block->set_control(BasicBlock::kReturn); |
SetControlInput(block, input); |
if (block != end()) AddSuccessor(block, end()); |
@@ -232,7 +245,7 @@ void Schedule::AddReturn(BasicBlock* block, Node* input) { |
void Schedule::AddThrow(BasicBlock* block, Node* input) { |
- DCHECK(block->control() == BasicBlock::kNone); |
+ DCHECK_EQ(BasicBlock::kNone, block->control()); |
block->set_control(BasicBlock::kThrow); |
SetControlInput(block, input); |
if (block != end()) AddSuccessor(block, end()); |
@@ -241,8 +254,8 @@ void Schedule::AddThrow(BasicBlock* block, Node* input) { |
void Schedule::InsertBranch(BasicBlock* block, BasicBlock* end, Node* branch, |
BasicBlock* tblock, BasicBlock* fblock) { |
- DCHECK(block->control() != BasicBlock::kNone); |
- DCHECK(end->control() == BasicBlock::kNone); |
+ DCHECK_NE(BasicBlock::kNone, block->control()); |
+ DCHECK_EQ(BasicBlock::kNone, end->control()); |
end->set_control(block->control()); |
block->set_control(BasicBlock::kBranch); |
MoveSuccessors(block, end); |