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

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

Issue 877753007: Reland "Initial switch to Chromium-style CHECK_* and DCHECK_* macros.". (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: VS201x now happy? Created 5 years, 10 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/code-generator.cc ('k') | src/compiler/ia32/code-generator-ia32.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 "src/compiler/common-operator.h" 5 #include "src/compiler/common-operator.h"
6 #include "src/compiler/control-reducer.h" 6 #include "src/compiler/control-reducer.h"
7 #include "src/compiler/graph.h" 7 #include "src/compiler/graph.h"
8 #include "src/compiler/js-graph.h" 8 #include "src/compiler/js-graph.h"
9 #include "src/compiler/node-marker.h" 9 #include "src/compiler/node-marker.h"
10 #include "src/compiler/node-matchers.h" 10 #include "src/compiler/node-matchers.h"
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 node->op()->mnemonic())); 289 node->op()->mnemonic()));
290 edge.UpdateTo(NULL); 290 edge.UpdateTo(NULL);
291 } 291 }
292 } 292 }
293 } 293 }
294 #if DEBUG 294 #if DEBUG
295 // Verify that no inputs to live nodes are NULL. 295 // Verify that no inputs to live nodes are NULL.
296 for (size_t j = 0; j < nodes.size(); j++) { 296 for (size_t j = 0; j < nodes.size(); j++) {
297 Node* node = nodes[j]; 297 Node* node = nodes[j];
298 for (Node* const input : node->inputs()) { 298 for (Node* const input : node->inputs()) {
299 CHECK_NE(NULL, input); 299 CHECK(input);
300 } 300 }
301 for (Node* const use : node->uses()) { 301 for (Node* const use : node->uses()) {
302 CHECK(marked.IsReachableFromEnd(use)); 302 CHECK(marked.IsReachableFromEnd(use));
303 } 303 }
304 } 304 }
305 #endif 305 #endif
306 } 306 }
307 307
308 // Reduce the node on the top of the stack. 308 // Reduce the node on the top of the stack.
309 // If an input {i} is not yet visited or needs to be revisited, push {i} onto 309 // If an input {i} is not yet visited or needs to be revisited, push {i} onto
310 // the stack and return. Otherwise, all inputs are visited, so apply 310 // the stack and return. Otherwise, all inputs are visited, so apply
311 // reductions for {node} and pop it off the stack. 311 // reductions for {node} and pop it off the stack.
312 void ReduceTop() { 312 void ReduceTop() {
313 size_t height = stack_.size(); 313 size_t height = stack_.size();
314 Node* node = stack_.back(); 314 Node* node = stack_.back();
315 315
316 if (node->IsDead()) return Pop(); // Node was killed while on stack. 316 if (node->IsDead()) return Pop(); // Node was killed while on stack.
317 317
318 TRACE(("ControlReduce: #%d:%s\n", node->id(), node->op()->mnemonic())); 318 TRACE(("ControlReduce: #%d:%s\n", node->id(), node->op()->mnemonic()));
319 319
320 // Recurse on an input if necessary. 320 // Recurse on an input if necessary.
321 for (Node* const input : node->inputs()) { 321 for (Node* const input : node->inputs()) {
322 CHECK_NE(NULL, input); 322 DCHECK(input);
323 if (Recurse(input)) return; 323 if (Recurse(input)) return;
324 } 324 }
325 325
326 // All inputs should be visited or on stack. Apply reductions to node. 326 // All inputs should be visited or on stack. Apply reductions to node.
327 Node* replacement = ReduceNode(node); 327 Node* replacement = ReduceNode(node);
328 if (replacement != node) ReplaceNode(node, replacement); 328 if (replacement != node) ReplaceNode(node, replacement);
329 329
330 // After reducing the node, pop it off the stack. 330 // After reducing the node, pop it off the stack.
331 CHECK_EQ(static_cast<int>(height), static_cast<int>(stack_.size())); 331 CHECK_EQ(static_cast<int>(height), static_cast<int>(stack_.size()));
332 Pop(); 332 Pop();
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
634 return impl.ReduceIfTrue(node); 634 return impl.ReduceIfTrue(node);
635 case IrOpcode::kIfFalse: 635 case IrOpcode::kIfFalse:
636 return impl.ReduceIfFalse(node); 636 return impl.ReduceIfFalse(node);
637 default: 637 default:
638 return node; 638 return node;
639 } 639 }
640 } 640 }
641 } 641 }
642 } 642 }
643 } // namespace v8::internal::compiler 643 } // namespace v8::internal::compiler
OLDNEW
« no previous file with comments | « src/compiler/code-generator.cc ('k') | src/compiler/ia32/code-generator-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698