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

Unified Diff: src/compiler/instruction-selector.cc

Issue 765983002: Clean up node iteration (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Tweaks 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
Index: src/compiler/instruction-selector.cc
diff --git a/src/compiler/instruction-selector.cc b/src/compiler/instruction-selector.cc
index 2bfc3e1c64ee9d0554e53700dceb9889ff0fda16..950b13dc96d8030363c1d551f5a5c4e8b0bed8d8 100644
--- a/src/compiler/instruction-selector.cc
+++ b/src/compiler/instruction-selector.cc
@@ -47,9 +47,8 @@ void InstructionSelector::SelectInstructions() {
if (phi->opcode() != IrOpcode::kPhi) continue;
// Mark all inputs as used.
- Node::Inputs inputs = phi->inputs();
- for (InputIter k = inputs.begin(); k != inputs.end(); ++k) {
- MarkAsUsed(*k);
+ for (Node* const k : phi->inputs()) {
+ MarkAsUsed(k);
}
}
}
@@ -384,11 +383,10 @@ void InstructionSelector::InitializeCallBuffer(Node* call, CallBuffer* buffer,
// arguments require an explicit push instruction before the call and do
// not appear as arguments to the call. Everything else ends up
// as an InstructionOperand argument to the call.
- InputIter iter(call->inputs().begin());
+ auto iter(call->inputs().begin());
int pushed_count = 0;
for (size_t index = 0; index < input_count; ++iter, ++index) {
DCHECK(iter != call->inputs().end());
- DCHECK(index == static_cast<size_t>(iter.index()));
DCHECK((*iter)->op()->opcode() != IrOpcode::kFrameState);
if (index == 0) continue; // The first argument (callee) is already done.
InstructionOperand* op =

Powered by Google App Engine
This is Rietveld 408576698