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

Side by Side Diff: src/compiler/verifier.cc

Issue 765983002: Clean up node iteration (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix windows build Created 6 years 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/simplified-lowering.cc ('k') | test/cctest/compiler/test-control-reducer.cc » ('j') | 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 <deque> 7 #include <deque>
8 #include <queue> 8 #include <queue>
9 #include <sstream> 9 #include <sstream>
10 #include <string> 10 #include <string>
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 // Verify all control inputs are control nodes. 169 // Verify all control inputs are control nodes.
170 for (int i = 0; i < control_count; ++i) { 170 for (int i = 0; i < control_count; ++i) {
171 Node* control = NodeProperties::GetControlInput(node, i); 171 Node* control = NodeProperties::GetControlInput(node, i);
172 CHECK(control->op()->ControlOutputCount() > 0); 172 CHECK(control->op()->ControlOutputCount() > 0);
173 CHECK(IsDefUseChainLinkPresent(control, node)); 173 CHECK(IsDefUseChainLinkPresent(control, node));
174 CHECK(IsUseDefChainLinkPresent(control, node)); 174 CHECK(IsUseDefChainLinkPresent(control, node));
175 } 175 }
176 176
177 // Verify all successors are projections if multiple value outputs exist. 177 // Verify all successors are projections if multiple value outputs exist.
178 if (node->op()->ValueOutputCount() > 1) { 178 if (node->op()->ValueOutputCount() > 1) {
179 Node::Uses uses = node->uses(); 179 for (Edge edge : node->use_edges()) {
180 for (Node::Uses::iterator it = uses.begin(); it != uses.end(); ++it) { 180 Node* use = edge.from();
181 CHECK(!NodeProperties::IsValueEdge(it.edge()) || 181 CHECK(!NodeProperties::IsValueEdge(edge) ||
182 (*it)->opcode() == IrOpcode::kProjection || 182 use->opcode() == IrOpcode::kProjection ||
183 (*it)->opcode() == IrOpcode::kParameter); 183 use->opcode() == IrOpcode::kParameter);
184 } 184 }
185 } 185 }
186 186
187 switch (node->opcode()) { 187 switch (node->opcode()) {
188 case IrOpcode::kStart: 188 case IrOpcode::kStart:
189 // Start has no inputs. 189 // Start has no inputs.
190 CHECK_EQ(0, input_count); 190 CHECK_EQ(0, input_count);
191 // Type is a tuple. 191 // Type is a tuple.
192 // TODO(rossberg): Multiple outputs are currently typed as Internal. 192 // TODO(rossberg): Multiple outputs are currently typed as Internal.
193 CheckUpperIs(node, Type::Internal()); 193 CheckUpperIs(node, Type::Internal());
(...skipping 781 matching lines...) Expand 10 before | Expand all | Expand 10 after
975 // Check inputs for all nodes in the block. 975 // Check inputs for all nodes in the block.
976 for (size_t i = 0; i < block->NodeCount(); i++) { 976 for (size_t i = 0; i < block->NodeCount(); i++) {
977 Node* node = block->NodeAt(i); 977 Node* node = block->NodeAt(i);
978 CheckInputsDominate(schedule, block, node, static_cast<int>(i) - 1); 978 CheckInputsDominate(schedule, block, node, static_cast<int>(i) - 1);
979 } 979 }
980 } 980 }
981 } 981 }
982 } 982 }
983 } 983 }
984 } // namespace v8::internal::compiler 984 } // namespace v8::internal::compiler
OLDNEW
« no previous file with comments | « src/compiler/simplified-lowering.cc ('k') | test/cctest/compiler/test-control-reducer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698