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 1014 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1025 // - introduce effect phis and rewire effects to get SSA again. | 1025 // - introduce effect phis and rewire effects to get SSA again. |
1026 EffectControlLinearizer linearizer(data->jsgraph(), schedule, temp_zone); | 1026 EffectControlLinearizer linearizer(data->jsgraph(), schedule, temp_zone); |
1027 linearizer.Run(); | 1027 linearizer.Run(); |
1028 } | 1028 } |
1029 }; | 1029 }; |
1030 | 1030 |
1031 struct MemoryOptimizationPhase { | 1031 struct MemoryOptimizationPhase { |
1032 static const char* phase_name() { return "memory optimization"; } | 1032 static const char* phase_name() { return "memory optimization"; } |
1033 | 1033 |
1034 void Run(PipelineData* data, Zone* temp_zone) { | 1034 void Run(PipelineData* data, Zone* temp_zone) { |
| 1035 // The memory optimizer requires the graphs to be trimmed, so trim now. |
| 1036 GraphTrimmer trimmer(temp_zone, data->graph()); |
| 1037 NodeVector roots(temp_zone); |
| 1038 data->jsgraph()->GetCachedNodes(&roots); |
| 1039 trimmer.TrimGraph(roots.begin(), roots.end()); |
| 1040 |
| 1041 // Optimize allocations and load/store operations. |
1035 MemoryOptimizer optimizer(data->jsgraph(), temp_zone); | 1042 MemoryOptimizer optimizer(data->jsgraph(), temp_zone); |
1036 optimizer.Optimize(); | 1043 optimizer.Optimize(); |
1037 } | 1044 } |
1038 }; | 1045 }; |
1039 | 1046 |
1040 struct LateOptimizationPhase { | 1047 struct LateOptimizationPhase { |
1041 static const char* phase_name() { return "late optimization"; } | 1048 static const char* phase_name() { return "late optimization"; } |
1042 | 1049 |
1043 void Run(PipelineData* data, Zone* temp_zone) { | 1050 void Run(PipelineData* data, Zone* temp_zone) { |
1044 JSGraphReducer graph_reducer(data->jsgraph(), temp_zone); | 1051 JSGraphReducer graph_reducer(data->jsgraph(), temp_zone); |
(...skipping 760 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1805 data->DeleteRegisterAllocationZone(); | 1812 data->DeleteRegisterAllocationZone(); |
1806 } | 1813 } |
1807 | 1814 |
1808 CompilationInfo* PipelineImpl::info() const { return data_->info(); } | 1815 CompilationInfo* PipelineImpl::info() const { return data_->info(); } |
1809 | 1816 |
1810 Isolate* PipelineImpl::isolate() const { return info()->isolate(); } | 1817 Isolate* PipelineImpl::isolate() const { return info()->isolate(); } |
1811 | 1818 |
1812 } // namespace compiler | 1819 } // namespace compiler |
1813 } // namespace internal | 1820 } // namespace internal |
1814 } // namespace v8 | 1821 } // namespace v8 |
OLD | NEW |