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

Unified Diff: src/compiler/verifier.cc

Issue 2227763004: [turbofan] Verify nodes without kNoThrow have only IfSuccess or IfException uses. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@p7
Patch Set: Localize and inline CHECK_EXTRA. Fix the check as discussed. Make OsrLoopEntry, Start, Tailcall NoT… Created 4 years, 4 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
« no previous file with comments | « src/compiler/common-operator.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/verifier.cc
diff --git a/src/compiler/verifier.cc b/src/compiler/verifier.cc
index eabd99dcf479dbb93bc5c2834aac32509a08bf7a..c4b3158dc58cbdac2fc0f5b8ef5c947be014aebf 100644
--- a/src/compiler/verifier.cc
+++ b/src/compiler/verifier.cc
@@ -149,6 +149,30 @@ void Verifier::Visitor::Check(Node* node) {
CheckOutput(control, node, control->op()->ControlOutputCount(),
"control");
}
+
+ // Verify that no-no-throw nodes only have IfSuccess/IfException control
+ // uses.
+ if (!node->op()->HasProperty(Operator::kNoThrow)) {
+ int count_success = 0, count_exception = 0;
+ for (Edge edge : node->use_edges()) {
+ if (!NodeProperties::IsControlEdge(edge)) {
+ continue;
+ }
+ Node* control_use = edge.from();
+ if (control_use->opcode() != IrOpcode::kIfSuccess &&
+ control_use->opcode() != IrOpcode::kIfException) {
+ V8_Fatal(__FILE__, __LINE__,
+ "#%d:%s should be followed by IfSuccess/IfException, but is "
+ "followed by #%d:%s",
+ node->id(), node->op()->mnemonic(), control_use->id(),
+ control_use->op()->mnemonic());
+ }
+ if (control_use->opcode() == IrOpcode::kIfSuccess) ++count_success;
+ if (control_use->opcode() == IrOpcode::kIfException) ++count_exception;
+ CHECK_LE(count_success, 1);
+ CHECK_LE(count_exception, 1);
+ }
+ }
}
switch (node->opcode()) {
« no previous file with comments | « src/compiler/common-operator.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698