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

Unified Diff: src/compiler/verifier.cc

Issue 892513003: [turbofan] Initial support for Switch. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix Wuschelstudio build. Created 5 years, 10 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/scheduler.cc ('k') | src/compiler/x64/code-generator-x64.cc » ('j') | 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 e040cd296cccaba8b665d2119ae5f55522577424..1cc8c9f32e7011c67b4d2f452c6fe0e6f1c3f640 100644
--- a/src/compiler/verifier.cc
+++ b/src/compiler/verifier.cc
@@ -228,6 +228,27 @@ void Verifier::Visitor::Check(Node* node) {
// Type is empty.
CheckNotTyped(node);
break;
+ case IrOpcode::kSwitch: {
+ // Switch uses are Case.
+ std::vector<bool> uses;
+ uses.resize(node->UseCount());
+ for (auto use : node->uses()) {
+ CHECK_EQ(IrOpcode::kCase, use->opcode());
+ size_t const index = CaseIndexOf(use->op());
+ CHECK_LT(index, uses.size());
+ CHECK(!uses[index]);
+ uses[index] = true;
+ }
+ // Type is empty.
+ CheckNotTyped(node);
+ break;
+ }
+ case IrOpcode::kCase:
+ CHECK_EQ(IrOpcode::kSwitch,
+ NodeProperties::GetControlInput(node)->opcode());
+ // Type is empty.
+ CheckNotTyped(node);
+ break;
case IrOpcode::kLoop:
case IrOpcode::kMerge:
CHECK_EQ(control_count, input_count);
« no previous file with comments | « src/compiler/scheduler.cc ('k') | src/compiler/x64/code-generator-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698