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

Unified Diff: src/compiler/verifier.cc

Issue 1153963006: [turbofan] Verify uses of Deoptimize and Return in graph. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressed comments. 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 9ddb60418329d7694c99cc5f1e85ad782efbb51d..da94390879e11c758b6138dd9c1f657f84c11e37 100644
--- a/src/compiler/verifier.cc
+++ b/src/compiler/verifier.cc
@@ -270,11 +270,17 @@ void Verifier::Visitor::Check(Node* node) {
CheckNotTyped(node);
break;
case IrOpcode::kDeoptimize:
- // TODO(rossberg): check successor is End
+ // Deoptimize uses are End.
+ for (auto use : node->uses()) {
+ CHECK_EQ(IrOpcode::kEnd, use->opcode());
+ }
// Type is empty.
CheckNotTyped(node);
case IrOpcode::kReturn:
- // TODO(rossberg): check successor is End
+ // Return uses are End.
+ for (auto use : node->uses()) {
+ CHECK_EQ(IrOpcode::kEnd, use->opcode());
+ }
// Type is empty.
CheckNotTyped(node);
break;
@@ -284,19 +290,25 @@ void Verifier::Visitor::Check(Node* node) {
CheckNotTyped(node);
break;
case IrOpcode::kTerminate:
+ // Terminates take one loop and effect.
+ CHECK_EQ(1, control_count);
+ CHECK_EQ(1, effect_count);
+ CHECK_EQ(2, input_count);
CHECK_EQ(IrOpcode::kLoop,
NodeProperties::GetControlInput(node)->opcode());
+ // Terminate uses are End.
+ for (auto use : node->uses()) {
+ CHECK_EQ(IrOpcode::kEnd, use->opcode());
+ }
// Type is empty.
CheckNotTyped(node);
- CHECK_EQ(1, control_count);
- CHECK_EQ(1, effect_count);
- CHECK_EQ(2, input_count);
break;
case IrOpcode::kOsrNormalEntry:
case IrOpcode::kOsrLoopEntry:
- // Osr entries have
- CHECK_EQ(1, effect_count);
+ // Osr entries take one control and effect.
CHECK_EQ(1, control_count);
+ CHECK_EQ(1, effect_count);
+ CHECK_EQ(2, input_count);
// Type is empty.
CheckNotTyped(node);
break;
« 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