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

Side by Side Diff: src/compiler/graph-reducer.cc

Issue 1178403004: [turbofan] Use appropriate type for NodeId. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix useless static_cast. Created 5 years, 6 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 unified diff | Download patch
« no previous file with comments | « src/compiler/graph-reducer.h ('k') | src/compiler/loop-analysis.h » ('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 <functional> 5 #include <functional>
6 #include <limits> 6 #include <limits>
7 7
8 #include "src/compiler/graph.h" 8 #include "src/compiler/graph.h"
9 #include "src/compiler/graph-reducer.h" 9 #include "src/compiler/graph-reducer.h"
10 #include "src/compiler/node.h" 10 #include "src/compiler/node.h"
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 entry.input_index = i + 1; 133 entry.input_index = i + 1;
134 if (input != node && Recurse(input)) return; 134 if (input != node && Recurse(input)) return;
135 } 135 }
136 for (int i = 0; i < start; i++) { 136 for (int i = 0; i < start; i++) {
137 Node* input = node->InputAt(i); 137 Node* input = node->InputAt(i);
138 entry.input_index = i + 1; 138 entry.input_index = i + 1;
139 if (input != node && Recurse(input)) return; 139 if (input != node && Recurse(input)) return;
140 } 140 }
141 141
142 // Remember the max node id before reduction. 142 // Remember the max node id before reduction.
143 NodeId const max_id = graph()->NodeCount() - 1; 143 NodeId const max_id = static_cast<NodeId>(graph()->NodeCount() - 1);
144 144
145 // All inputs should be visited or on stack. Apply reductions to node. 145 // All inputs should be visited or on stack. Apply reductions to node.
146 Reduction reduction = Reduce(node); 146 Reduction reduction = Reduce(node);
147 147
148 // If there was no reduction, pop {node} and continue. 148 // If there was no reduction, pop {node} and continue.
149 if (!reduction.Changed()) return Pop(); 149 if (!reduction.Changed()) return Pop();
150 150
151 // Check if the reduction is an in-place update of the {node}. 151 // Check if the reduction is an in-place update of the {node}.
152 Node* const replacement = reduction.replacement(); 152 Node* const replacement = reduction.replacement();
153 if (replacement == node) { 153 if (replacement == node) {
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 void GraphReducer::Revisit(Node* node) { 275 void GraphReducer::Revisit(Node* node) {
276 if (state_.Get(node) == State::kVisited) { 276 if (state_.Get(node) == State::kVisited) {
277 state_.Set(node, State::kRevisit); 277 state_.Set(node, State::kRevisit);
278 revisit_.push(node); 278 revisit_.push(node);
279 } 279 }
280 } 280 }
281 281
282 } // namespace compiler 282 } // namespace compiler
283 } // namespace internal 283 } // namespace internal
284 } // namespace v8 284 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/graph-reducer.h ('k') | src/compiler/loop-analysis.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698