Index: src/compiler/verifier.cc |
diff --git a/src/compiler/verifier.cc b/src/compiler/verifier.cc |
index 23cec7a809794623625823e99d8f0b2688508d6b..26d5373b65491ee557cbd81220966f135aca842a 100644 |
--- a/src/compiler/verifier.cc |
+++ b/src/compiler/verifier.cc |
@@ -271,6 +271,12 @@ static bool HasDominatingDef(Schedule* schedule, Node* node, |
} |
+static bool Dominates(Schedule* schedule, Node* dominator, Node* dominee) { |
titzer
2014/09/25 12:19:24
You should walk up the dominator tree and very the
titzer
2014/09/26 10:44:38
BTW can you split this check out into a separate C
sigurds
2014/09/26 11:35:24
Done.
|
+ return schedule->block(dominator)->rpo_number_ <= |
+ schedule->block(dominee)->rpo_number_; |
+} |
+ |
+ |
static void CheckInputsDominate(Schedule* schedule, BasicBlock* block, |
Node* node, int use_pos) { |
for (int j = OperatorProperties::GetValueInputCount(node->op()) - 1; j >= 0; |
@@ -289,6 +295,15 @@ static void CheckInputsDominate(Schedule* schedule, BasicBlock* block, |
input->op()->mnemonic()); |
} |
} |
+ if (OperatorProperties::GetControlInputCount(node->op()) == 1) { |
+ Node* ctl = NodeProperties::GetControlInput(node); |
+ if (!Dominates(schedule, ctl, node)) { |
+ V8_Fatal(__FILE__, __LINE__, |
+ "Node #%d:%s in B%d is not dominated by control input #%d:%s", |
+ node->id(), node->op()->mnemonic(), block->id(), ctl->id(), |
+ ctl->op()->mnemonic()); |
+ } |
+ } |
} |