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

Unified Diff: src/compiler/change-lowering.cc

Issue 765983002: Clean up node iteration (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix comment Created 6 years, 1 month 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 | « no previous file | src/compiler/control-reducer.cc » ('j') | src/compiler/control-reducer.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/change-lowering.cc
diff --git a/src/compiler/change-lowering.cc b/src/compiler/change-lowering.cc
index a4e081a58d6481d39aa0f082353bd856eb5cdbdd..8baa4dad05862407d76e618aeea6e8416aadaad0 100644
--- a/src/compiler/change-lowering.cc
+++ b/src/compiler/change-lowering.cc
@@ -199,9 +199,9 @@ namespace {
bool CanCover(Node* value, IrOpcode::Value opcode) {
if (value->opcode() != opcode) return false;
bool first = true;
- for (auto i = value->uses().begin(); i != value->uses().end(); ++i) {
- if (NodeProperties::IsEffectEdge(i.edge())) continue;
- DCHECK(NodeProperties::IsValueEdge(i.edge()));
+ for (auto edge : value->use_edges()) {
+ if (NodeProperties::IsEffectEdge(edge)) continue;
+ DCHECK(NodeProperties::IsValueEdge(edge));
if (!first) return false;
first = false;
}
@@ -236,11 +236,9 @@ Reduction ChangeLowering::ChangeTaggedToFloat64(Node* value, Node* control) {
Node* phi1 = d1.Phi(kMachFloat64, phi2, ChangeSmiToFloat64(object));
Node* ephi1 = d1.EffectPhi(number, effect);
- for (auto i = value->uses().begin(); i != value->uses().end();) {
- if (NodeProperties::IsEffectEdge(i.edge())) {
- i.UpdateToAndIncrement(ephi1);
- } else {
- ++i;
+ for (auto edge : value->use_edges()) {
+ if (NodeProperties::IsEffectEdge(edge)) {
+ edge.UpdateTo(ephi1);
}
}
return Replace(phi1);
« no previous file with comments | « no previous file | src/compiler/control-reducer.cc » ('j') | src/compiler/control-reducer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698