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

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

Issue 2123283006: [turbofan] Renamed tracing flags for TurboFan reducers and graph trimmer (Closed) Base URL: https://chromium.googlesource.com/v8/v8@master
Patch Set: Renamed tracing flags for TurboFan reducers and graph trimmer Created 4 years, 5 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 | « no previous file | src/compiler/graph-trimmer.cc » ('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 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 } 161 }
162 } 162 }
163 163
164 164
165 void GraphReducer::Replace(Node* node, Node* replacement) { 165 void GraphReducer::Replace(Node* node, Node* replacement) {
166 Replace(node, replacement, std::numeric_limits<NodeId>::max()); 166 Replace(node, replacement, std::numeric_limits<NodeId>::max());
167 } 167 }
168 168
169 169
170 void GraphReducer::Replace(Node* node, Node* replacement, NodeId max_id) { 170 void GraphReducer::Replace(Node* node, Node* replacement, NodeId max_id) {
171 if (FLAG_trace_turbo_reduction) {
172 OFStream os(stdout);
173 os << "- Replacing " << *node << " with " << *replacement << std::endl;
174 }
171 if (node == graph()->start()) graph()->SetStart(replacement); 175 if (node == graph()->start()) graph()->SetStart(replacement);
172 if (node == graph()->end()) graph()->SetEnd(replacement); 176 if (node == graph()->end()) graph()->SetEnd(replacement);
173 if (replacement->id() <= max_id) { 177 if (replacement->id() <= max_id) {
174 // {replacement} is an old node, so unlink {node} and assume that 178 // {replacement} is an old node, so unlink {node} and assume that
175 // {replacement} was already reduced and finish. 179 // {replacement} was already reduced and finish.
176 for (Edge edge : node->use_edges()) { 180 for (Edge edge : node->use_edges()) {
177 Node* const user = edge.from(); 181 Node* const user = edge.from();
178 Verifier::VerifyEdgeInputReplacement(edge, replacement); 182 Verifier::VerifyEdgeInputReplacement(edge, replacement);
179 edge.UpdateTo(replacement); 183 edge.UpdateTo(replacement);
180 // Don't revisit this node if it refers to itself. 184 // Don't revisit this node if it refers to itself.
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 void GraphReducer::Revisit(Node* node) { 269 void GraphReducer::Revisit(Node* node) {
266 if (state_.Get(node) == State::kVisited) { 270 if (state_.Get(node) == State::kVisited) {
267 state_.Set(node, State::kRevisit); 271 state_.Set(node, State::kRevisit);
268 revisit_.push(node); 272 revisit_.push(node);
269 } 273 }
270 } 274 }
271 275
272 } // namespace compiler 276 } // namespace compiler
273 } // namespace internal 277 } // namespace internal
274 } // namespace v8 278 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/compiler/graph-trimmer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698