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/pipeline.h" | 5 #include "src/compiler/pipeline.h" |
6 | 6 |
7 #include <fstream> // NOLINT(readability/streams) | 7 #include <fstream> // NOLINT(readability/streams) |
8 #include <sstream> | 8 #include <sstream> |
9 | 9 |
10 #include "src/base/adapters.h" | 10 #include "src/base/adapters.h" |
11 #include "src/base/platform/elapsed-timer.h" | 11 #include "src/base/platform/elapsed-timer.h" |
12 #include "src/compiler/ast-graph-builder.h" | 12 #include "src/compiler/ast-graph-builder.h" |
13 #include "src/compiler/ast-loop-assignment-analyzer.h" | 13 #include "src/compiler/ast-loop-assignment-analyzer.h" |
14 #include "src/compiler/basic-block-instrumentor.h" | 14 #include "src/compiler/basic-block-instrumentor.h" |
| 15 #include "src/compiler/binary-operator-reducer.h" |
15 #include "src/compiler/bytecode-graph-builder.h" | 16 #include "src/compiler/bytecode-graph-builder.h" |
16 #include "src/compiler/change-lowering.h" | 17 #include "src/compiler/change-lowering.h" |
17 #include "src/compiler/code-generator.h" | 18 #include "src/compiler/code-generator.h" |
18 #include "src/compiler/common-operator-reducer.h" | 19 #include "src/compiler/common-operator-reducer.h" |
19 #include "src/compiler/control-flow-optimizer.h" | 20 #include "src/compiler/control-flow-optimizer.h" |
20 #include "src/compiler/dead-code-elimination.h" | 21 #include "src/compiler/dead-code-elimination.h" |
21 #include "src/compiler/frame-elider.h" | 22 #include "src/compiler/frame-elider.h" |
22 #include "src/compiler/graph-replay.h" | 23 #include "src/compiler/graph-replay.h" |
23 #include "src/compiler/graph-trimmer.h" | 24 #include "src/compiler/graph-trimmer.h" |
24 #include "src/compiler/graph-visualizer.h" | 25 #include "src/compiler/graph-visualizer.h" |
(...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
616 data->source_positions()); | 617 data->source_positions()); |
617 lowering.LowerAllNodes(); | 618 lowering.LowerAllNodes(); |
618 JSGraphReducer graph_reducer(data->jsgraph(), temp_zone); | 619 JSGraphReducer graph_reducer(data->jsgraph(), temp_zone); |
619 DeadCodeElimination dead_code_elimination(&graph_reducer, data->graph(), | 620 DeadCodeElimination dead_code_elimination(&graph_reducer, data->graph(), |
620 data->common()); | 621 data->common()); |
621 SimplifiedOperatorReducer simple_reducer(data->jsgraph()); | 622 SimplifiedOperatorReducer simple_reducer(data->jsgraph()); |
622 ValueNumberingReducer value_numbering(temp_zone); | 623 ValueNumberingReducer value_numbering(temp_zone); |
623 MachineOperatorReducer machine_reducer(data->jsgraph()); | 624 MachineOperatorReducer machine_reducer(data->jsgraph()); |
624 CommonOperatorReducer common_reducer(&graph_reducer, data->graph(), | 625 CommonOperatorReducer common_reducer(&graph_reducer, data->graph(), |
625 data->common(), data->machine()); | 626 data->common(), data->machine()); |
| 627 BinaryOperatorReducer binary_reducer(&graph_reducer, data->graph(), |
| 628 data->common(), data->machine()); |
626 AddReducer(data, &graph_reducer, &dead_code_elimination); | 629 AddReducer(data, &graph_reducer, &dead_code_elimination); |
627 AddReducer(data, &graph_reducer, &simple_reducer); | 630 AddReducer(data, &graph_reducer, &simple_reducer); |
628 AddReducer(data, &graph_reducer, &value_numbering); | 631 AddReducer(data, &graph_reducer, &value_numbering); |
629 AddReducer(data, &graph_reducer, &machine_reducer); | 632 AddReducer(data, &graph_reducer, &machine_reducer); |
630 AddReducer(data, &graph_reducer, &common_reducer); | 633 AddReducer(data, &graph_reducer, &common_reducer); |
| 634 AddReducer(data, &graph_reducer, &binary_reducer); |
631 graph_reducer.ReduceGraph(); | 635 graph_reducer.ReduceGraph(); |
632 } | 636 } |
633 }; | 637 }; |
634 | 638 |
635 | 639 |
636 struct ControlFlowOptimizationPhase { | 640 struct ControlFlowOptimizationPhase { |
637 static const char* phase_name() { return "control flow optimization"; } | 641 static const char* phase_name() { return "control flow optimization"; } |
638 | 642 |
639 void Run(PipelineData* data, Zone* temp_zone) { | 643 void Run(PipelineData* data, Zone* temp_zone) { |
640 ControlFlowOptimizer optimizer(data->graph(), data->common(), | 644 ControlFlowOptimizer optimizer(data->graph(), data->common(), |
(...skipping 768 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1409 tcf << AsC1VRegisterAllocationData("CodeGen", | 1413 tcf << AsC1VRegisterAllocationData("CodeGen", |
1410 data->register_allocation_data()); | 1414 data->register_allocation_data()); |
1411 } | 1415 } |
1412 | 1416 |
1413 data->DeleteRegisterAllocationZone(); | 1417 data->DeleteRegisterAllocationZone(); |
1414 } | 1418 } |
1415 | 1419 |
1416 } // namespace compiler | 1420 } // namespace compiler |
1417 } // namespace internal | 1421 } // namespace internal |
1418 } // namespace v8 | 1422 } // namespace v8 |
OLD | NEW |