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

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

Issue 1168693002: [turbofan] Allow ReplaceWithValue to kill control. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressed comments. 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 | « no previous file | src/compiler/graph-reducer.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 "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/graph-reducer.h" 8 #include "src/compiler/graph-reducer.h"
9 #include "src/compiler/js-graph.h" 9 #include "src/compiler/js-graph.h"
10 #include "src/compiler/node-marker.h" 10 #include "src/compiler/node-marker.h"
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after
418 DCHECK_EQ(total, live + node->InputCount() - merge->InputCount()); 418 DCHECK_EQ(total, live + node->InputCount() - merge->InputCount());
419 DCHECK_NE(total, node->InputCount()); 419 DCHECK_NE(total, node->InputCount());
420 node->TrimInputCount(total); 420 node->TrimInputCount(total);
421 node->set_op(common()->ResizeMergeOrPhi(node->op(), live)); 421 node->set_op(common()->ResizeMergeOrPhi(node->op(), live));
422 } 422 }
423 }; 423 };
424 424
425 425
426 void ControlReducer::ReduceGraph(Zone* zone, JSGraph* jsgraph, 426 void ControlReducer::ReduceGraph(Zone* zone, JSGraph* jsgraph,
427 int max_phis_for_select) { 427 int max_phis_for_select) {
428 GraphReducer graph_reducer(jsgraph->graph(), zone); 428 GraphReducer graph_reducer(zone, jsgraph->graph());
429 ControlReducerImpl impl(&graph_reducer, zone, jsgraph); 429 ControlReducerImpl impl(&graph_reducer, zone, jsgraph);
430 impl.max_phis_for_select_ = max_phis_for_select; 430 impl.max_phis_for_select_ = max_phis_for_select;
431 graph_reducer.AddReducer(&impl); 431 graph_reducer.AddReducer(&impl);
432 graph_reducer.ReduceGraph(); 432 graph_reducer.ReduceGraph();
433 } 433 }
434 434
435 435
436 namespace { 436 namespace {
437 437
438 class DummyEditor final : public AdvancedReducer::Editor { 438 class DummyEditor final : public AdvancedReducer::Editor {
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
483 case IrOpcode::kIfFalse: 483 case IrOpcode::kIfFalse:
484 return impl.ReduceIfProjection(node, kFalse); 484 return impl.ReduceIfProjection(node, kFalse);
485 default: 485 default:
486 return node; 486 return node;
487 } 487 }
488 } 488 }
489 489
490 } // namespace compiler 490 } // namespace compiler
491 } // namespace internal 491 } // namespace internal
492 } // namespace v8 492 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/compiler/graph-reducer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698