From 3c13e81721d60120e5fbc54c4bb77fc980381faa Mon Sep 17 00:00:00 2001 From: mstarzinger Date: Tue, 26 May 2015 04:52:44 -0700 Subject: [PATCH] [turbofan] Verify uses of Deoptimize and Return in graph. R=bmeurer@chromium.org Review URL: https://codereview.chromium.org/1153963006 Cr-Commit-Position: refs/heads/master@{#28624} --- src/compiler/verifier.cc | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/src/compiler/verifier.cc b/src/compiler/verifier.cc index 9ddb60418..da9439087 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; -- 2.34.1