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 927 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
938 struct RepresentationSelectionPhase { | 938 struct RepresentationSelectionPhase { |
939 static const char* phase_name() { return "representation selection"; } | 939 static const char* phase_name() { return "representation selection"; } |
940 | 940 |
941 void Run(PipelineData* data, Zone* temp_zone) { | 941 void Run(PipelineData* data, Zone* temp_zone) { |
942 SimplifiedLowering lowering(data->jsgraph(), temp_zone, | 942 SimplifiedLowering lowering(data->jsgraph(), temp_zone, |
943 data->source_positions()); | 943 data->source_positions()); |
944 lowering.LowerAllNodes(); | 944 lowering.LowerAllNodes(); |
945 } | 945 } |
946 }; | 946 }; |
947 | 947 |
| 948 struct LoopExitEliminationPhase { |
| 949 static const char* phase_name() { return "loop exit elimination"; } |
| 950 |
| 951 void Run(PipelineData* data, Zone* temp_zone) { |
| 952 LoopPeeler::EliminateLoopExits(data->graph(), temp_zone); |
| 953 } |
| 954 }; |
| 955 |
948 struct EarlyOptimizationPhase { | 956 struct EarlyOptimizationPhase { |
949 static const char* phase_name() { return "early optimization"; } | 957 static const char* phase_name() { return "early optimization"; } |
950 | 958 |
951 void Run(PipelineData* data, Zone* temp_zone) { | 959 void Run(PipelineData* data, Zone* temp_zone) { |
952 JSGraphReducer graph_reducer(data->jsgraph(), temp_zone); | 960 JSGraphReducer graph_reducer(data->jsgraph(), temp_zone); |
953 JSGenericLowering generic_lowering(data->jsgraph()); | 961 JSGenericLowering generic_lowering(data->jsgraph()); |
954 DeadCodeElimination dead_code_elimination(&graph_reducer, data->graph(), | 962 DeadCodeElimination dead_code_elimination(&graph_reducer, data->graph(), |
955 data->common()); | 963 data->common()); |
956 SimplifiedOperatorReducer simple_reducer(&graph_reducer, data->jsgraph()); | 964 SimplifiedOperatorReducer simple_reducer(&graph_reducer, data->jsgraph()); |
957 RedundancyElimination redundancy_elimination(&graph_reducer, temp_zone); | 965 RedundancyElimination redundancy_elimination(&graph_reducer, temp_zone); |
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1426 info()->dependencies()); | 1434 info()->dependencies()); |
1427 Run<TyperPhase>(&typer); | 1435 Run<TyperPhase>(&typer); |
1428 RunPrintAndVerify("Typed"); | 1436 RunPrintAndVerify("Typed"); |
1429 | 1437 |
1430 data->BeginPhaseKind("lowering"); | 1438 data->BeginPhaseKind("lowering"); |
1431 | 1439 |
1432 // Lower JSOperators where we can determine types. | 1440 // Lower JSOperators where we can determine types. |
1433 Run<TypedLoweringPhase>(); | 1441 Run<TypedLoweringPhase>(); |
1434 RunPrintAndVerify("Lowered typed"); | 1442 RunPrintAndVerify("Lowered typed"); |
1435 | 1443 |
| 1444 // Eventually, loop peeling will be done here. |
| 1445 Run<LoopExitEliminationPhase>(); |
| 1446 RunPrintAndVerify("Loop exits eliminated", true); |
| 1447 |
1436 if (FLAG_turbo_stress_loop_peeling) { | 1448 if (FLAG_turbo_stress_loop_peeling) { |
1437 Run<StressLoopPeelingPhase>(); | 1449 Run<StressLoopPeelingPhase>(); |
1438 RunPrintAndVerify("Loop peeled"); | 1450 RunPrintAndVerify("Loop peeled"); |
1439 } | 1451 } |
1440 | 1452 |
1441 if (FLAG_turbo_escape) { | 1453 if (FLAG_turbo_escape) { |
1442 Run<EscapeAnalysisPhase>(); | 1454 Run<EscapeAnalysisPhase>(); |
1443 RunPrintAndVerify("Escape Analysed"); | 1455 RunPrintAndVerify("Escape Analysed"); |
1444 } | 1456 } |
1445 | 1457 |
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1831 data->DeleteRegisterAllocationZone(); | 1843 data->DeleteRegisterAllocationZone(); |
1832 } | 1844 } |
1833 | 1845 |
1834 CompilationInfo* PipelineImpl::info() const { return data_->info(); } | 1846 CompilationInfo* PipelineImpl::info() const { return data_->info(); } |
1835 | 1847 |
1836 Isolate* PipelineImpl::isolate() const { return info()->isolate(); } | 1848 Isolate* PipelineImpl::isolate() const { return info()->isolate(); } |
1837 | 1849 |
1838 } // namespace compiler | 1850 } // namespace compiler |
1839 } // namespace internal | 1851 } // namespace internal |
1840 } // namespace v8 | 1852 } // namespace v8 |
OLD | NEW |