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/change-lowering.h" | 15 #include "src/compiler/change-lowering.h" |
16 #include "src/compiler/code-generator.h" | 16 #include "src/compiler/code-generator.h" |
17 #include "src/compiler/common-operator-reducer.h" | 17 #include "src/compiler/common-operator-reducer.h" |
18 #include "src/compiler/control-flow-optimizer.h" | 18 #include "src/compiler/control-flow-optimizer.h" |
19 #include "src/compiler/dead-code-elimination.h" | 19 #include "src/compiler/dead-code-elimination.h" |
20 #include "src/compiler/frame-elider.h" | 20 #include "src/compiler/frame-elider.h" |
21 #include "src/compiler/graph-replay.h" | 21 #include "src/compiler/graph-replay.h" |
22 #include "src/compiler/graph-trimmer.h" | 22 #include "src/compiler/graph-trimmer.h" |
23 #include "src/compiler/graph-visualizer.h" | 23 #include "src/compiler/graph-visualizer.h" |
24 #include "src/compiler/greedy-allocator.h" | 24 #include "src/compiler/greedy-allocator.h" |
25 #include "src/compiler/instruction.h" | 25 #include "src/compiler/instruction.h" |
26 #include "src/compiler/instruction-selector.h" | 26 #include "src/compiler/instruction-selector.h" |
27 #include "src/compiler/js-builtin-reducer.h" | 27 #include "src/compiler/js-builtin-reducer.h" |
| 28 #include "src/compiler/js-context-relaxation.h" |
28 #include "src/compiler/js-context-specialization.h" | 29 #include "src/compiler/js-context-specialization.h" |
29 #include "src/compiler/js-frame-specialization.h" | 30 #include "src/compiler/js-frame-specialization.h" |
30 #include "src/compiler/js-generic-lowering.h" | 31 #include "src/compiler/js-generic-lowering.h" |
31 #include "src/compiler/js-inlining.h" | 32 #include "src/compiler/js-inlining.h" |
32 #include "src/compiler/js-intrinsic-lowering.h" | 33 #include "src/compiler/js-intrinsic-lowering.h" |
33 #include "src/compiler/js-type-feedback.h" | 34 #include "src/compiler/js-type-feedback.h" |
34 #include "src/compiler/js-type-feedback-lowering.h" | 35 #include "src/compiler/js-type-feedback-lowering.h" |
35 #include "src/compiler/js-typed-lowering.h" | 36 #include "src/compiler/js-typed-lowering.h" |
36 #include "src/compiler/jump-threading.h" | 37 #include "src/compiler/jump-threading.h" |
37 #include "src/compiler/load-elimination.h" | 38 #include "src/compiler/load-elimination.h" |
(...skipping 659 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
697 } | 698 } |
698 } | 699 } |
699 }; | 700 }; |
700 | 701 |
701 | 702 |
702 struct GenericLoweringPhase { | 703 struct GenericLoweringPhase { |
703 static const char* phase_name() { return "generic lowering"; } | 704 static const char* phase_name() { return "generic lowering"; } |
704 | 705 |
705 void Run(PipelineData* data, Zone* temp_zone) { | 706 void Run(PipelineData* data, Zone* temp_zone) { |
706 JSGraphReducer graph_reducer(data->jsgraph(), temp_zone); | 707 JSGraphReducer graph_reducer(data->jsgraph(), temp_zone); |
| 708 JSContextRelaxation context_relaxing; |
707 DeadCodeElimination dead_code_elimination(&graph_reducer, data->graph(), | 709 DeadCodeElimination dead_code_elimination(&graph_reducer, data->graph(), |
708 data->common()); | 710 data->common()); |
709 CommonOperatorReducer common_reducer(&graph_reducer, data->graph(), | 711 CommonOperatorReducer common_reducer(&graph_reducer, data->graph(), |
710 data->common(), data->machine()); | 712 data->common(), data->machine()); |
711 JSGenericLowering generic_lowering(data->info()->is_typing_enabled(), | 713 JSGenericLowering generic_lowering(data->info()->is_typing_enabled(), |
712 data->jsgraph()); | 714 data->jsgraph()); |
713 SelectLowering select_lowering(data->jsgraph()->graph(), | 715 SelectLowering select_lowering(data->jsgraph()->graph(), |
714 data->jsgraph()->common()); | 716 data->jsgraph()->common()); |
715 TailCallOptimization tco(data->common(), data->graph()); | 717 TailCallOptimization tco(data->common(), data->graph()); |
| 718 AddReducer(data, &graph_reducer, &context_relaxing); |
716 AddReducer(data, &graph_reducer, &dead_code_elimination); | 719 AddReducer(data, &graph_reducer, &dead_code_elimination); |
717 AddReducer(data, &graph_reducer, &common_reducer); | 720 AddReducer(data, &graph_reducer, &common_reducer); |
718 AddReducer(data, &graph_reducer, &generic_lowering); | 721 AddReducer(data, &graph_reducer, &generic_lowering); |
719 AddReducer(data, &graph_reducer, &select_lowering); | 722 AddReducer(data, &graph_reducer, &select_lowering); |
720 AddReducer(data, &graph_reducer, &tco); | 723 AddReducer(data, &graph_reducer, &tco); |
721 graph_reducer.ReduceGraph(); | 724 graph_reducer.ReduceGraph(); |
722 } | 725 } |
723 }; | 726 }; |
724 | 727 |
725 | 728 |
(...skipping 631 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1357 tcf << AsC1VRegisterAllocationData("CodeGen", | 1360 tcf << AsC1VRegisterAllocationData("CodeGen", |
1358 data->register_allocation_data()); | 1361 data->register_allocation_data()); |
1359 } | 1362 } |
1360 | 1363 |
1361 data->DeleteRegisterAllocationZone(); | 1364 data->DeleteRegisterAllocationZone(); |
1362 } | 1365 } |
1363 | 1366 |
1364 } // namespace compiler | 1367 } // namespace compiler |
1365 } // namespace internal | 1368 } // namespace internal |
1366 } // namespace v8 | 1369 } // namespace v8 |
OLD | NEW |