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

Unified Diff: src/compiler/verifier.cc

Issue 1155723005: [turbofan] Make the verifier a little bit more cooperative. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 7 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 | « no previous file | 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 6424fa6334bd3e7f212cb64b162e8da34bf37266..66aeffa2b2b7c42ae2c32172fc6cc5fce0649f8c 100644
--- a/src/compiler/verifier.cc
+++ b/src/compiler/verifier.cc
@@ -98,6 +98,15 @@ class Verifier::Visitor {
FATAL(str.str().c_str());
}
}
+ void CheckOutput(Node* node, Node* use, int count, const char* kind) {
+ if (count <= 0) {
+ std::ostringstream str;
+ str << "GraphError: node #" << node->id() << ":" << *node->op()
+ << " does not produce " << kind << " output used by node #"
+ << use->id() << ":" << *use->op();
+ FATAL(str.str().c_str());
+ }
+ }
};
@@ -128,7 +137,7 @@ void Verifier::Visitor::Check(Node* node) {
// Verify all value inputs actually produce a value.
for (int i = 0; i < value_count; ++i) {
Node* value = NodeProperties::GetValueInput(node, i);
- CHECK(value->op()->ValueOutputCount() > 0);
+ CheckOutput(value, node, value->op()->ValueOutputCount(), "value");
CHECK(IsDefUseChainLinkPresent(value, node));
CHECK(IsUseDefChainLinkPresent(value, node));
}
@@ -136,7 +145,7 @@ void Verifier::Visitor::Check(Node* node) {
// Verify all context inputs are value nodes.
for (int i = 0; i < context_count; ++i) {
Node* context = NodeProperties::GetContextInput(node);
- CHECK(context->op()->ValueOutputCount() > 0);
+ CheckOutput(context, node, context->op()->ValueOutputCount(), "context");
CHECK(IsDefUseChainLinkPresent(context, node));
CHECK(IsUseDefChainLinkPresent(context, node));
}
@@ -144,7 +153,7 @@ void Verifier::Visitor::Check(Node* node) {
// Verify all effect inputs actually have an effect.
for (int i = 0; i < effect_count; ++i) {
Node* effect = NodeProperties::GetEffectInput(node);
- CHECK(effect->op()->EffectOutputCount() > 0);
+ CheckOutput(effect, node, effect->op()->EffectOutputCount(), "effect");
CHECK(IsDefUseChainLinkPresent(effect, node));
CHECK(IsUseDefChainLinkPresent(effect, node));
}
@@ -152,7 +161,7 @@ void Verifier::Visitor::Check(Node* node) {
// Verify all control inputs are control nodes.
for (int i = 0; i < control_count; ++i) {
Node* control = NodeProperties::GetControlInput(node, i);
- CHECK(control->op()->ControlOutputCount() > 0);
+ CheckOutput(control, node, control->op()->ControlOutputCount(), "control");
CHECK(IsDefUseChainLinkPresent(control, node));
CHECK(IsUseDefChainLinkPresent(control, node));
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698