OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |