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 1115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1126 | 1126 |
1127 struct LateOptimizationPhase { | 1127 struct LateOptimizationPhase { |
1128 static const char* phase_name() { return "late optimization"; } | 1128 static const char* phase_name() { return "late optimization"; } |
1129 | 1129 |
1130 void Run(PipelineData* data, Zone* temp_zone) { | 1130 void Run(PipelineData* data, Zone* temp_zone) { |
1131 JSGraphReducer graph_reducer(data->jsgraph(), temp_zone); | 1131 JSGraphReducer graph_reducer(data->jsgraph(), temp_zone); |
1132 BranchElimination branch_condition_elimination(&graph_reducer, | 1132 BranchElimination branch_condition_elimination(&graph_reducer, |
1133 data->jsgraph(), temp_zone); | 1133 data->jsgraph(), temp_zone); |
1134 DeadCodeElimination dead_code_elimination(&graph_reducer, data->graph(), | 1134 DeadCodeElimination dead_code_elimination(&graph_reducer, data->graph(), |
1135 data->common()); | 1135 data->common()); |
| 1136 ValueNumberingReducer value_numbering(temp_zone, data->graph()->zone()); |
1136 MachineOperatorReducer machine_reducer(data->jsgraph()); | 1137 MachineOperatorReducer machine_reducer(data->jsgraph()); |
1137 CommonOperatorReducer common_reducer(&graph_reducer, data->graph(), | 1138 CommonOperatorReducer common_reducer(&graph_reducer, data->graph(), |
1138 data->common(), data->machine()); | 1139 data->common(), data->machine()); |
1139 SelectLowering select_lowering(data->jsgraph()->graph(), | 1140 SelectLowering select_lowering(data->jsgraph()->graph(), |
1140 data->jsgraph()->common()); | 1141 data->jsgraph()->common()); |
1141 TailCallOptimization tco(data->common(), data->graph()); | 1142 TailCallOptimization tco(data->common(), data->graph()); |
1142 AddReducer(data, &graph_reducer, &branch_condition_elimination); | 1143 AddReducer(data, &graph_reducer, &branch_condition_elimination); |
1143 AddReducer(data, &graph_reducer, &dead_code_elimination); | 1144 AddReducer(data, &graph_reducer, &dead_code_elimination); |
| 1145 AddReducer(data, &graph_reducer, &value_numbering); |
1144 AddReducer(data, &graph_reducer, &machine_reducer); | 1146 AddReducer(data, &graph_reducer, &machine_reducer); |
1145 AddReducer(data, &graph_reducer, &common_reducer); | 1147 AddReducer(data, &graph_reducer, &common_reducer); |
1146 AddReducer(data, &graph_reducer, &select_lowering); | 1148 AddReducer(data, &graph_reducer, &select_lowering); |
1147 AddReducer(data, &graph_reducer, &tco); | 1149 AddReducer(data, &graph_reducer, &tco); |
1148 graph_reducer.ReduceGraph(); | 1150 graph_reducer.ReduceGraph(); |
1149 } | 1151 } |
1150 }; | 1152 }; |
1151 | 1153 |
1152 struct EarlyGraphTrimmingPhase { | 1154 struct EarlyGraphTrimmingPhase { |
1153 static const char* phase_name() { return "early graph trimming"; } | 1155 static const char* phase_name() { return "early graph trimming"; } |
(...skipping 843 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1997 data->DeleteRegisterAllocationZone(); | 1999 data->DeleteRegisterAllocationZone(); |
1998 } | 2000 } |
1999 | 2001 |
2000 CompilationInfo* PipelineImpl::info() const { return data_->info(); } | 2002 CompilationInfo* PipelineImpl::info() const { return data_->info(); } |
2001 | 2003 |
2002 Isolate* PipelineImpl::isolate() const { return info()->isolate(); } | 2004 Isolate* PipelineImpl::isolate() const { return info()->isolate(); } |
2003 | 2005 |
2004 } // namespace compiler | 2006 } // namespace compiler |
2005 } // namespace internal | 2007 } // namespace internal |
2006 } // namespace v8 | 2008 } // namespace v8 |
OLD | NEW |