| 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 <memory> | 8 #include <memory> |
| 9 #include <sstream> | 9 #include <sstream> |
| 10 | 10 |
| (...skipping 1023 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1034 data->common()); | 1034 data->common()); |
| 1035 SimplifiedOperatorReducer simple_reducer(&graph_reducer, data->jsgraph()); | 1035 SimplifiedOperatorReducer simple_reducer(&graph_reducer, data->jsgraph()); |
| 1036 RedundancyElimination redundancy_elimination(&graph_reducer, temp_zone); | 1036 RedundancyElimination redundancy_elimination(&graph_reducer, temp_zone); |
| 1037 ValueNumberingReducer value_numbering(temp_zone, data->graph()->zone()); | 1037 ValueNumberingReducer value_numbering(temp_zone, data->graph()->zone()); |
| 1038 MachineOperatorReducer machine_reducer(data->jsgraph()); | 1038 MachineOperatorReducer machine_reducer(data->jsgraph()); |
| 1039 CommonOperatorReducer common_reducer(&graph_reducer, data->graph(), | 1039 CommonOperatorReducer common_reducer(&graph_reducer, data->graph(), |
| 1040 data->common(), data->machine()); | 1040 data->common(), data->machine()); |
| 1041 AddReducer(data, &graph_reducer, &dead_code_elimination); | 1041 AddReducer(data, &graph_reducer, &dead_code_elimination); |
| 1042 AddReducer(data, &graph_reducer, &simple_reducer); | 1042 AddReducer(data, &graph_reducer, &simple_reducer); |
| 1043 AddReducer(data, &graph_reducer, &redundancy_elimination); | 1043 AddReducer(data, &graph_reducer, &redundancy_elimination); |
| 1044 AddReducer(data, &graph_reducer, &value_numbering); | |
| 1045 AddReducer(data, &graph_reducer, &machine_reducer); | 1044 AddReducer(data, &graph_reducer, &machine_reducer); |
| 1046 AddReducer(data, &graph_reducer, &common_reducer); | 1045 AddReducer(data, &graph_reducer, &common_reducer); |
| 1046 AddReducer(data, &graph_reducer, &value_numbering); |
| 1047 graph_reducer.ReduceGraph(); | 1047 graph_reducer.ReduceGraph(); |
| 1048 } | 1048 } |
| 1049 }; | 1049 }; |
| 1050 | 1050 |
| 1051 struct ControlFlowOptimizationPhase { | 1051 struct ControlFlowOptimizationPhase { |
| 1052 static const char* phase_name() { return "control flow optimization"; } | 1052 static const char* phase_name() { return "control flow optimization"; } |
| 1053 | 1053 |
| 1054 void Run(PipelineData* data, Zone* temp_zone) { | 1054 void Run(PipelineData* data, Zone* temp_zone) { |
| 1055 ControlFlowOptimizer optimizer(data->graph(), data->common(), | 1055 ControlFlowOptimizer optimizer(data->graph(), data->common(), |
| 1056 data->machine(), temp_zone); | 1056 data->machine(), temp_zone); |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1134 RedundancyElimination redundancy_elimination(&graph_reducer, temp_zone); | 1134 RedundancyElimination redundancy_elimination(&graph_reducer, temp_zone); |
| 1135 LoadElimination load_elimination(&graph_reducer, data->jsgraph(), | 1135 LoadElimination load_elimination(&graph_reducer, data->jsgraph(), |
| 1136 temp_zone); | 1136 temp_zone); |
| 1137 ValueNumberingReducer value_numbering(temp_zone, data->graph()->zone()); | 1137 ValueNumberingReducer value_numbering(temp_zone, data->graph()->zone()); |
| 1138 CommonOperatorReducer common_reducer(&graph_reducer, data->graph(), | 1138 CommonOperatorReducer common_reducer(&graph_reducer, data->graph(), |
| 1139 data->common(), data->machine()); | 1139 data->common(), data->machine()); |
| 1140 AddReducer(data, &graph_reducer, &branch_condition_elimination); | 1140 AddReducer(data, &graph_reducer, &branch_condition_elimination); |
| 1141 AddReducer(data, &graph_reducer, &dead_code_elimination); | 1141 AddReducer(data, &graph_reducer, &dead_code_elimination); |
| 1142 AddReducer(data, &graph_reducer, &redundancy_elimination); | 1142 AddReducer(data, &graph_reducer, &redundancy_elimination); |
| 1143 AddReducer(data, &graph_reducer, &load_elimination); | 1143 AddReducer(data, &graph_reducer, &load_elimination); |
| 1144 AddReducer(data, &graph_reducer, &common_reducer); |
| 1144 AddReducer(data, &graph_reducer, &value_numbering); | 1145 AddReducer(data, &graph_reducer, &value_numbering); |
| 1145 AddReducer(data, &graph_reducer, &common_reducer); | |
| 1146 graph_reducer.ReduceGraph(); | 1146 graph_reducer.ReduceGraph(); |
| 1147 } | 1147 } |
| 1148 }; | 1148 }; |
| 1149 | 1149 |
| 1150 struct MemoryOptimizationPhase { | 1150 struct MemoryOptimizationPhase { |
| 1151 static const char* phase_name() { return "memory optimization"; } | 1151 static const char* phase_name() { return "memory optimization"; } |
| 1152 | 1152 |
| 1153 void Run(PipelineData* data, Zone* temp_zone) { | 1153 void Run(PipelineData* data, Zone* temp_zone) { |
| 1154 // The memory optimizer requires the graphs to be trimmed, so trim now. | 1154 // The memory optimizer requires the graphs to be trimmed, so trim now. |
| 1155 GraphTrimmer trimmer(temp_zone, data->graph()); | 1155 GraphTrimmer trimmer(temp_zone, data->graph()); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 1174 data->common()); | 1174 data->common()); |
| 1175 ValueNumberingReducer value_numbering(temp_zone, data->graph()->zone()); | 1175 ValueNumberingReducer value_numbering(temp_zone, data->graph()->zone()); |
| 1176 MachineOperatorReducer machine_reducer(data->jsgraph()); | 1176 MachineOperatorReducer machine_reducer(data->jsgraph()); |
| 1177 CommonOperatorReducer common_reducer(&graph_reducer, data->graph(), | 1177 CommonOperatorReducer common_reducer(&graph_reducer, data->graph(), |
| 1178 data->common(), data->machine()); | 1178 data->common(), data->machine()); |
| 1179 SelectLowering select_lowering(data->jsgraph()->graph(), | 1179 SelectLowering select_lowering(data->jsgraph()->graph(), |
| 1180 data->jsgraph()->common()); | 1180 data->jsgraph()->common()); |
| 1181 TailCallOptimization tco(data->common(), data->graph()); | 1181 TailCallOptimization tco(data->common(), data->graph()); |
| 1182 AddReducer(data, &graph_reducer, &branch_condition_elimination); | 1182 AddReducer(data, &graph_reducer, &branch_condition_elimination); |
| 1183 AddReducer(data, &graph_reducer, &dead_code_elimination); | 1183 AddReducer(data, &graph_reducer, &dead_code_elimination); |
| 1184 AddReducer(data, &graph_reducer, &value_numbering); | |
| 1185 AddReducer(data, &graph_reducer, &machine_reducer); | 1184 AddReducer(data, &graph_reducer, &machine_reducer); |
| 1186 AddReducer(data, &graph_reducer, &common_reducer); | 1185 AddReducer(data, &graph_reducer, &common_reducer); |
| 1187 AddReducer(data, &graph_reducer, &select_lowering); | 1186 AddReducer(data, &graph_reducer, &select_lowering); |
| 1188 AddReducer(data, &graph_reducer, &tco); | 1187 AddReducer(data, &graph_reducer, &tco); |
| 1188 AddReducer(data, &graph_reducer, &value_numbering); |
| 1189 graph_reducer.ReduceGraph(); | 1189 graph_reducer.ReduceGraph(); |
| 1190 } | 1190 } |
| 1191 }; | 1191 }; |
| 1192 | 1192 |
| 1193 struct EarlyGraphTrimmingPhase { | 1193 struct EarlyGraphTrimmingPhase { |
| 1194 static const char* phase_name() { return "early graph trimming"; } | 1194 static const char* phase_name() { return "early graph trimming"; } |
| 1195 void Run(PipelineData* data, Zone* temp_zone) { | 1195 void Run(PipelineData* data, Zone* temp_zone) { |
| 1196 GraphTrimmer trimmer(temp_zone, data->graph()); | 1196 GraphTrimmer trimmer(temp_zone, data->graph()); |
| 1197 NodeVector roots(temp_zone); | 1197 NodeVector roots(temp_zone); |
| 1198 data->jsgraph()->GetCachedNodes(&roots); | 1198 data->jsgraph()->GetCachedNodes(&roots); |
| (...skipping 828 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2027 data->DeleteRegisterAllocationZone(); | 2027 data->DeleteRegisterAllocationZone(); |
| 2028 } | 2028 } |
| 2029 | 2029 |
| 2030 CompilationInfo* PipelineImpl::info() const { return data_->info(); } | 2030 CompilationInfo* PipelineImpl::info() const { return data_->info(); } |
| 2031 | 2031 |
| 2032 Isolate* PipelineImpl::isolate() const { return info()->isolate(); } | 2032 Isolate* PipelineImpl::isolate() const { return info()->isolate(); } |
| 2033 | 2033 |
| 2034 } // namespace compiler | 2034 } // namespace compiler |
| 2035 } // namespace internal | 2035 } // namespace internal |
| 2036 } // namespace v8 | 2036 } // namespace v8 |
| OLD | NEW |