| 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" |
| (...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 568 void Run(PipelineData* data, Zone* temp_zone) { | 568 void Run(PipelineData* data, Zone* temp_zone) { |
| 569 JSGraphReducer graph_reducer(data->jsgraph(), temp_zone); | 569 JSGraphReducer graph_reducer(data->jsgraph(), temp_zone); |
| 570 LoadElimination load_elimination(&graph_reducer); | 570 LoadElimination load_elimination(&graph_reducer); |
| 571 JSBuiltinReducer builtin_reducer(&graph_reducer, data->jsgraph()); | 571 JSBuiltinReducer builtin_reducer(&graph_reducer, data->jsgraph()); |
| 572 JSTypedLowering typed_lowering(&graph_reducer, data->jsgraph(), temp_zone); | 572 JSTypedLowering typed_lowering(&graph_reducer, data->jsgraph(), temp_zone); |
| 573 JSIntrinsicLowering intrinsic_lowering( | 573 JSIntrinsicLowering intrinsic_lowering( |
| 574 &graph_reducer, data->jsgraph(), | 574 &graph_reducer, data->jsgraph(), |
| 575 data->info()->is_deoptimization_enabled() | 575 data->info()->is_deoptimization_enabled() |
| 576 ? JSIntrinsicLowering::kDeoptimizationEnabled | 576 ? JSIntrinsicLowering::kDeoptimizationEnabled |
| 577 : JSIntrinsicLowering::kDeoptimizationDisabled); | 577 : JSIntrinsicLowering::kDeoptimizationDisabled); |
| 578 CommonOperatorReducer common_reducer(data->jsgraph()); | 578 CommonOperatorReducer common_reducer(&graph_reducer, data->graph(), |
| 579 data->common(), data->machine()); |
| 579 AddReducer(data, &graph_reducer, &builtin_reducer); | 580 AddReducer(data, &graph_reducer, &builtin_reducer); |
| 580 AddReducer(data, &graph_reducer, &typed_lowering); | 581 AddReducer(data, &graph_reducer, &typed_lowering); |
| 581 AddReducer(data, &graph_reducer, &intrinsic_lowering); | 582 AddReducer(data, &graph_reducer, &intrinsic_lowering); |
| 582 AddReducer(data, &graph_reducer, &load_elimination); | 583 AddReducer(data, &graph_reducer, &load_elimination); |
| 583 AddReducer(data, &graph_reducer, &common_reducer); | 584 AddReducer(data, &graph_reducer, &common_reducer); |
| 584 graph_reducer.ReduceGraph(); | 585 graph_reducer.ReduceGraph(); |
| 585 } | 586 } |
| 586 }; | 587 }; |
| 587 | 588 |
| 588 | 589 |
| 589 struct SimplifiedLoweringPhase { | 590 struct SimplifiedLoweringPhase { |
| 590 static const char* phase_name() { return "simplified lowering"; } | 591 static const char* phase_name() { return "simplified lowering"; } |
| 591 | 592 |
| 592 void Run(PipelineData* data, Zone* temp_zone) { | 593 void Run(PipelineData* data, Zone* temp_zone) { |
| 593 SimplifiedLowering lowering(data->jsgraph(), temp_zone, | 594 SimplifiedLowering lowering(data->jsgraph(), temp_zone, |
| 594 data->source_positions()); | 595 data->source_positions()); |
| 595 lowering.LowerAllNodes(); | 596 lowering.LowerAllNodes(); |
| 597 JSGraphReducer graph_reducer(data->jsgraph(), temp_zone); |
| 596 ValueNumberingReducer vn_reducer(temp_zone); | 598 ValueNumberingReducer vn_reducer(temp_zone); |
| 597 MachineOperatorReducer machine_reducer(data->jsgraph()); | 599 MachineOperatorReducer machine_reducer(data->jsgraph()); |
| 598 CommonOperatorReducer common_reducer(data->jsgraph()); | 600 CommonOperatorReducer common_reducer(&graph_reducer, data->graph(), |
| 599 JSGraphReducer graph_reducer(data->jsgraph(), temp_zone); | 601 data->common(), data->machine()); |
| 600 AddReducer(data, &graph_reducer, &vn_reducer); | 602 AddReducer(data, &graph_reducer, &vn_reducer); |
| 601 AddReducer(data, &graph_reducer, &machine_reducer); | 603 AddReducer(data, &graph_reducer, &machine_reducer); |
| 602 AddReducer(data, &graph_reducer, &common_reducer); | 604 AddReducer(data, &graph_reducer, &common_reducer); |
| 603 graph_reducer.ReduceGraph(); | 605 graph_reducer.ReduceGraph(); |
| 604 } | 606 } |
| 605 }; | 607 }; |
| 606 | 608 |
| 607 | 609 |
| 608 struct ControlFlowOptimizationPhase { | 610 struct ControlFlowOptimizationPhase { |
| 609 static const char* phase_name() { return "control flow optimization"; } | 611 static const char* phase_name() { return "control flow optimization"; } |
| 610 | 612 |
| 611 void Run(PipelineData* data, Zone* temp_zone) { | 613 void Run(PipelineData* data, Zone* temp_zone) { |
| 612 ControlFlowOptimizer optimizer(data->graph(), data->common(), | 614 ControlFlowOptimizer optimizer(data->graph(), data->common(), |
| 613 data->machine(), temp_zone); | 615 data->machine(), temp_zone); |
| 614 optimizer.Optimize(); | 616 optimizer.Optimize(); |
| 615 } | 617 } |
| 616 }; | 618 }; |
| 617 | 619 |
| 618 | 620 |
| 619 struct ChangeLoweringPhase { | 621 struct ChangeLoweringPhase { |
| 620 static const char* phase_name() { return "change lowering"; } | 622 static const char* phase_name() { return "change lowering"; } |
| 621 | 623 |
| 622 void Run(PipelineData* data, Zone* temp_zone) { | 624 void Run(PipelineData* data, Zone* temp_zone) { |
| 625 JSGraphReducer graph_reducer(data->jsgraph(), temp_zone); |
| 623 ValueNumberingReducer vn_reducer(temp_zone); | 626 ValueNumberingReducer vn_reducer(temp_zone); |
| 624 ChangeLowering lowering(data->jsgraph()); | 627 ChangeLowering lowering(data->jsgraph()); |
| 625 MachineOperatorReducer machine_reducer(data->jsgraph()); | 628 MachineOperatorReducer machine_reducer(data->jsgraph()); |
| 626 CommonOperatorReducer common_reducer(data->jsgraph()); | 629 CommonOperatorReducer common_reducer(&graph_reducer, data->graph(), |
| 627 JSGraphReducer graph_reducer(data->jsgraph(), temp_zone); | 630 data->common(), data->machine()); |
| 628 AddReducer(data, &graph_reducer, &vn_reducer); | 631 AddReducer(data, &graph_reducer, &vn_reducer); |
| 629 AddReducer(data, &graph_reducer, &lowering); | 632 AddReducer(data, &graph_reducer, &lowering); |
| 630 AddReducer(data, &graph_reducer, &machine_reducer); | 633 AddReducer(data, &graph_reducer, &machine_reducer); |
| 631 AddReducer(data, &graph_reducer, &common_reducer); | 634 AddReducer(data, &graph_reducer, &common_reducer); |
| 632 graph_reducer.ReduceGraph(); | 635 graph_reducer.ReduceGraph(); |
| 633 } | 636 } |
| 634 }; | 637 }; |
| 635 | 638 |
| 636 | 639 |
| 637 struct EarlyControlReductionPhase { | 640 struct EarlyControlReductionPhase { |
| (...skipping 723 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1361 tcf << AsC1VRegisterAllocationData("CodeGen", | 1364 tcf << AsC1VRegisterAllocationData("CodeGen", |
| 1362 data->register_allocation_data()); | 1365 data->register_allocation_data()); |
| 1363 } | 1366 } |
| 1364 | 1367 |
| 1365 data->DeleteRegisterAllocationZone(); | 1368 data->DeleteRegisterAllocationZone(); |
| 1366 } | 1369 } |
| 1367 | 1370 |
| 1368 } // namespace compiler | 1371 } // namespace compiler |
| 1369 } // namespace internal | 1372 } // namespace internal |
| 1370 } // namespace v8 | 1373 } // namespace v8 |
| OLD | NEW |