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

Unified Diff: src/compiler/graph-reducer.cc

Issue 2617123002: [turbofan] Allow indexed access to node inputs/input_edges (Closed)
Patch Set: Revert AST graph builder change Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/dead-code-elimination.cc ('k') | src/compiler/node.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/graph-reducer.cc
diff --git a/src/compiler/graph-reducer.cc b/src/compiler/graph-reducer.cc
index 9460e6ca9611e3f074b01440d37f4077523c79b6..117e569ad88cd282da6cd8cad5d1dded413f54fa 100644
--- a/src/compiler/graph-reducer.cc
+++ b/src/compiler/graph-reducer.cc
@@ -115,25 +115,21 @@ void GraphReducer::ReduceTop() {
if (node->IsDead()) return Pop(); // Node was killed while on stack.
- // Recurse on an input if necessary.
- int start = entry.input_index < node->InputCount() ? entry.input_index : 0;
-
Node::Inputs node_inputs = node->inputs();
- auto node_inputs_begin = node_inputs.begin();
- auto node_inputs_end = node_inputs.end();
- DCHECK(node_inputs_end == node_inputs_begin + node->InputCount());
- for (auto it = node_inputs_begin + start; it != node_inputs_end; ++it) {
- Node* input = *it;
+ // Recurse on an input if necessary.
+ int start = entry.input_index < node_inputs.count() ? entry.input_index : 0;
+ for (int i = start; i < node_inputs.count(); ++i) {
+ Node* input = node_inputs[i];
if (input != node && Recurse(input)) {
- entry.input_index = (it - node_inputs_begin) + 1;
+ entry.input_index = i + 1;
return;
}
}
- for (auto it = node_inputs_begin; it != node_inputs_begin + start; ++it) {
- Node* input = *it;
+ for (int i = 0; i < start; ++i) {
+ Node* input = node_inputs[i];
if (input != node && Recurse(input)) {
- entry.input_index = (it - node_inputs_begin) + 1;
+ entry.input_index = i + 1;
return;
}
}
@@ -152,12 +148,10 @@ void GraphReducer::ReduceTop() {
if (replacement == node) {
// In-place update of {node}, may need to recurse on an input.
Node::Inputs node_inputs = node->inputs();
- auto node_inputs_begin = node_inputs.begin();
- auto node_inputs_end = node_inputs.end();
- for (auto it = node_inputs_begin; it != node_inputs_end; ++it) {
- Node* input = *it;
+ for (int i = 0; i < node_inputs.count(); ++i) {
+ Node* input = node_inputs[i];
if (input != node && Recurse(input)) {
- entry.input_index = (it - node_inputs_begin) + 1;
+ entry.input_index = i + 1;
return;
}
}
« no previous file with comments | « src/compiler/dead-code-elimination.cc ('k') | src/compiler/node.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698