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

Unified Diff: src/compiler/simplified-lowering.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/scheduler.cc ('k') | src/compiler/verifier.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/simplified-lowering.cc
diff --git a/src/compiler/simplified-lowering.cc b/src/compiler/simplified-lowering.cc
index df3c825994ec99380eca0beb5939cdb3381f6376..1fea3afa051b9670de624b4c6ea81af269bf065f 100644
--- a/src/compiler/simplified-lowering.cc
+++ b/src/compiler/simplified-lowering.cc
@@ -237,19 +237,19 @@ class RepresentationSelector {
// context, effect, and control inputs, assuming that value inputs should have
// {kRepTagged} representation and can observe all output values {kTypeAny}.
void VisitInputs(Node* node) {
- InputIter i = node->inputs().begin();
+ auto i = node->input_edges().begin();
for (int j = node->op()->ValueInputCount(); j > 0; ++i, j--) {
- ProcessInput(node, i.index(), kMachAnyTagged); // Value inputs
+ ProcessInput(node, (*i).index(), kMachAnyTagged); // Value inputs
}
for (int j = OperatorProperties::GetContextInputCount(node->op()); j > 0;
++i, j--) {
- ProcessInput(node, i.index(), kMachAnyTagged); // Context inputs
+ ProcessInput(node, (*i).index(), kMachAnyTagged); // Context inputs
}
for (int j = node->op()->EffectInputCount(); j > 0; ++i, j--) {
- Enqueue(*i); // Effect inputs: just visit
+ Enqueue((*i).to()); // Effect inputs: just visit
}
for (int j = node->op()->ControlInputCount(); j > 0; ++i, j--) {
- Enqueue(*i); // Control inputs: just visit
+ Enqueue((*i).to()); // Control inputs: just visit
}
SetOutput(node, kMachAnyTagged);
}
@@ -379,21 +379,19 @@ class RepresentationSelector {
}
// Convert inputs to the output representation of this phi.
- Node::Inputs inputs = node->inputs();
- for (Node::Inputs::iterator iter(inputs.begin()); iter != inputs.end();
- ++iter, --values) {
+ for (Edge const edge : node->input_edges()) {
// TODO(titzer): it'd be nice to have distinguished edge kinds here.
- ProcessInput(node, iter.index(), values > 0 ? output_type : 0);
+ ProcessInput(node, edge.index(), values > 0 ? output_type : 0);
+ values--;
}
} else {
// Propagate {use} of the phi to value inputs, and 0 to control.
- Node::Inputs inputs = node->inputs();
MachineType use_type =
static_cast<MachineType>((use & kTypeMask) | output);
- for (Node::Inputs::iterator iter(inputs.begin()); iter != inputs.end();
- ++iter, --values) {
+ for (Edge const edge : node->input_edges()) {
// TODO(titzer): it'd be nice to have distinguished edge kinds here.
- ProcessInput(node, iter.index(), values > 0 ? use_type : 0);
+ ProcessInput(node, edge.index(), values > 0 ? use_type : 0);
+ values--;
}
}
}
« no previous file with comments | « src/compiler/scheduler.cc ('k') | src/compiler/verifier.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698