Index: src/compiler/pipeline.cc |
diff --git a/src/compiler/pipeline.cc b/src/compiler/pipeline.cc |
index 883d00bb4b978cb99b85ad9325f4d3d2713dfede..2e9332536245c56e333e75af3dd3a414dddc0b9d 100644 |
--- a/src/compiler/pipeline.cc |
+++ b/src/compiler/pipeline.cc |
@@ -722,6 +722,30 @@ |
}; |
+struct ChangeLoweringPhase { |
+ static const char* phase_name() { return "change lowering"; } |
+ |
+ void Run(PipelineData* data, Zone* temp_zone) { |
+ JSGraphReducer graph_reducer(data->jsgraph(), temp_zone); |
+ DeadCodeElimination dead_code_elimination(&graph_reducer, data->graph(), |
+ data->common()); |
+ SimplifiedOperatorReducer simple_reducer(data->jsgraph()); |
+ ValueNumberingReducer value_numbering(temp_zone); |
+ ChangeLowering lowering(data->jsgraph()); |
+ MachineOperatorReducer machine_reducer(data->jsgraph()); |
+ CommonOperatorReducer common_reducer(&graph_reducer, data->graph(), |
+ data->common(), data->machine()); |
+ AddReducer(data, &graph_reducer, &dead_code_elimination); |
+ AddReducer(data, &graph_reducer, &simple_reducer); |
+ AddReducer(data, &graph_reducer, &value_numbering); |
+ AddReducer(data, &graph_reducer, &lowering); |
+ AddReducer(data, &graph_reducer, &machine_reducer); |
+ AddReducer(data, &graph_reducer, &common_reducer); |
+ graph_reducer.ReduceGraph(); |
+ } |
+}; |
+ |
+ |
struct EarlyGraphTrimmingPhase { |
static const char* phase_name() { return "early graph trimming"; } |
void Run(PipelineData* data, Zone* temp_zone) { |
@@ -769,10 +793,6 @@ |
data->common()); |
CommonOperatorReducer common_reducer(&graph_reducer, data->graph(), |
data->common(), data->machine()); |
- SimplifiedOperatorReducer simple_reducer(data->jsgraph()); |
- ValueNumberingReducer value_numbering(temp_zone); |
- ChangeLowering change_lowering(data->jsgraph()); |
- MachineOperatorReducer machine_reducer(data->jsgraph()); |
JSGenericLowering generic_lowering(data->info()->is_typing_enabled(), |
data->jsgraph()); |
SelectLowering select_lowering(data->jsgraph()->graph(), |
@@ -781,12 +801,6 @@ |
AddReducer(data, &graph_reducer, &context_relaxing); |
AddReducer(data, &graph_reducer, &dead_code_elimination); |
AddReducer(data, &graph_reducer, &common_reducer); |
- if (data->info()->is_typing_enabled()) { |
- AddReducer(data, &graph_reducer, &simple_reducer); |
- AddReducer(data, &graph_reducer, &value_numbering); |
- AddReducer(data, &graph_reducer, &change_lowering); |
- AddReducer(data, &graph_reducer, &machine_reducer); |
- } |
AddReducer(data, &graph_reducer, &generic_lowering); |
AddReducer(data, &graph_reducer, &select_lowering); |
AddReducer(data, &graph_reducer, &tco); |
@@ -1178,9 +1192,14 @@ |
Run<ControlFlowOptimizationPhase>(); |
RunPrintAndVerify("Control flow optimized"); |
} |
- } |
- |
- // Lower changes inserted earlier and any remaining generic JSOperators. |
+ |
+ // Lower changes that have been inserted before. |
+ Run<ChangeLoweringPhase>(); |
+ // TODO(jarin, rossberg): Remove UNTYPED once machine typing works. |
+ RunPrintAndVerify("Lowered changes", true); |
+ } |
+ |
+ // Lower any remaining generic JSOperators. |
Run<GenericLoweringPhase>(); |
// TODO(jarin, rossberg): Remove UNTYPED once machine typing works. |
RunPrintAndVerify("Lowered generic", true); |