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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « src/compiler/common-operator.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/compiler/verifier.h" 5 #include "src/compiler/verifier.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <deque> 8 #include <deque>
9 #include <queue> 9 #include <queue>
10 #include <sstream> 10 #include <sstream>
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 Node* effect = NodeProperties::GetEffectInput(node); 142 Node* effect = NodeProperties::GetEffectInput(node);
143 CheckOutput(effect, node, effect->op()->EffectOutputCount(), "effect"); 143 CheckOutput(effect, node, effect->op()->EffectOutputCount(), "effect");
144 } 144 }
145 145
146 // Verify all control inputs are control nodes. 146 // Verify all control inputs are control nodes.
147 for (int i = 0; i < control_count; ++i) { 147 for (int i = 0; i < control_count; ++i) {
148 Node* control = NodeProperties::GetControlInput(node, i); 148 Node* control = NodeProperties::GetControlInput(node, i);
149 CheckOutput(control, node, control->op()->ControlOutputCount(), 149 CheckOutput(control, node, control->op()->ControlOutputCount(),
150 "control"); 150 "control");
151 } 151 }
152
153 // Verify that no-no-throw nodes only have IfSuccess/IfException control
154 // uses.
155 if (!node->op()->HasProperty(Operator::kNoThrow)) {
156 int count_success = 0, count_exception = 0;
157 for (Edge edge : node->use_edges()) {
158 if (!NodeProperties::IsControlEdge(edge)) {
159 continue;
160 }
161 Node* control_use = edge.from();
162 if (control_use->opcode() != IrOpcode::kIfSuccess &&
163 control_use->opcode() != IrOpcode::kIfException) {
164 V8_Fatal(__FILE__, __LINE__,
165 "#%d:%s should be followed by IfSuccess/IfException, but is "
166 "followed by #%d:%s",
167 node->id(), node->op()->mnemonic(), control_use->id(),
168 control_use->op()->mnemonic());
169 }
170 if (control_use->opcode() == IrOpcode::kIfSuccess) ++count_success;
171 if (control_use->opcode() == IrOpcode::kIfException) ++count_exception;
172 CHECK_LE(count_success, 1);
173 CHECK_LE(count_exception, 1);
174 }
175 }
152 } 176 }
153 177
154 switch (node->opcode()) { 178 switch (node->opcode()) {
155 case IrOpcode::kStart: 179 case IrOpcode::kStart:
156 // Start has no inputs. 180 // Start has no inputs.
157 CHECK_EQ(0, input_count); 181 CHECK_EQ(0, input_count);
158 // Type is a tuple. 182 // Type is a tuple.
159 // TODO(rossberg): Multiple outputs are currently typed as Internal. 183 // TODO(rossberg): Multiple outputs are currently typed as Internal.
160 CheckUpperIs(node, Type::Internal()); 184 CheckUpperIs(node, Type::Internal());
161 break; 185 break;
(...skipping 1414 matching lines...) Expand 10 before | Expand all | Expand 10 after
1576 replacement->op()->EffectOutputCount() > 0); 1600 replacement->op()->EffectOutputCount() > 0);
1577 DCHECK(!NodeProperties::IsFrameStateEdge(edge) || 1601 DCHECK(!NodeProperties::IsFrameStateEdge(edge) ||
1578 replacement->opcode() == IrOpcode::kFrameState); 1602 replacement->opcode() == IrOpcode::kFrameState);
1579 } 1603 }
1580 1604
1581 #endif // DEBUG 1605 #endif // DEBUG
1582 1606
1583 } // namespace compiler 1607 } // namespace compiler
1584 } // namespace internal 1608 } // namespace internal
1585 } // namespace v8 1609 } // namespace v8
OLDNEW
« 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