Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(96)

Unified Diff: src/compiler/verifier.cc

Issue 602083003: Fix scheduler to correctly schedule nested diamonds. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: titzer's comments Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/compiler/verifier.cc
diff --git a/src/compiler/verifier.cc b/src/compiler/verifier.cc
index 23cec7a809794623625823e99d8f0b2688508d6b..fddc86f3fc7884b86ccbcf45c995cd49dcfd91f4 100644
--- a/src/compiler/verifier.cc
+++ b/src/compiler/verifier.cc
@@ -271,6 +271,19 @@ static bool HasDominatingDef(Schedule* schedule, Node* node,
}
+static bool Dominates(Schedule* schedule, Node* dominator, Node* dominatee) {
+ BasicBlock* dom = schedule->block(dominator);
+ BasicBlock* sub = schedule->block(dominatee);
+ while (sub != NULL) {
+ if (sub == dom) {
+ return true;
+ }
+ sub = sub->dominator_;
+ }
+ return false;
+}
+
+
static void CheckInputsDominate(Schedule* schedule, BasicBlock* block,
Node* node, int use_pos) {
for (int j = OperatorProperties::GetValueInputCount(node->op()) - 1; j >= 0;
@@ -289,6 +302,19 @@ static void CheckInputsDominate(Schedule* schedule, BasicBlock* block,
input->op()->mnemonic());
}
}
+ // Ensure that nodes are dominated by their control inputs;
+ // kEnd is an exception, as unreachable blocks resulting from kMerge
+ // are not in the RPO.
+ if (OperatorProperties::GetControlInputCount(node->op()) == 1 &&
+ node->opcode() != IrOpcode::kEnd) {
+ 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());
+ }
+ }
}

Powered by Google App Engine
This is Rietveld 408576698