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 759 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
770 }; | 770 }; |
771 | 771 |
772 | 772 |
773 struct InliningPhase { | 773 struct InliningPhase { |
774 static const char* phase_name() { return "inlining"; } | 774 static const char* phase_name() { return "inlining"; } |
775 | 775 |
776 void Run(PipelineData* data, Zone* temp_zone) { | 776 void Run(PipelineData* data, Zone* temp_zone) { |
777 JSGraphReducer graph_reducer(data->jsgraph(), temp_zone); | 777 JSGraphReducer graph_reducer(data->jsgraph(), temp_zone); |
778 DeadCodeElimination dead_code_elimination(&graph_reducer, data->graph(), | 778 DeadCodeElimination dead_code_elimination(&graph_reducer, data->graph(), |
779 data->common()); | 779 data->common()); |
| 780 CheckpointElimination checkpoint_elimination(&graph_reducer); |
780 CommonOperatorReducer common_reducer(&graph_reducer, data->graph(), | 781 CommonOperatorReducer common_reducer(&graph_reducer, data->graph(), |
781 data->common(), data->machine()); | 782 data->common(), data->machine()); |
782 JSCallReducer::Flags call_reducer_flags = JSCallReducer::kNoFlags; | 783 JSCallReducer::Flags call_reducer_flags = JSCallReducer::kNoFlags; |
783 if (data->info()->is_deoptimization_enabled()) { | 784 if (data->info()->is_deoptimization_enabled()) { |
784 call_reducer_flags |= JSCallReducer::kDeoptimizationEnabled; | 785 call_reducer_flags |= JSCallReducer::kDeoptimizationEnabled; |
785 } | 786 } |
786 JSCallReducer call_reducer(&graph_reducer, data->jsgraph(), | 787 JSCallReducer call_reducer(&graph_reducer, data->jsgraph(), |
787 call_reducer_flags, data->native_context(), | 788 call_reducer_flags, data->native_context(), |
788 data->info()->dependencies()); | 789 data->info()->dependencies()); |
789 JSContextSpecialization context_specialization( | 790 JSContextSpecialization context_specialization( |
(...skipping 21 matching lines...) Expand all Loading... |
811 &graph_reducer, data->info()->is_inlining_enabled() | 812 &graph_reducer, data->info()->is_inlining_enabled() |
812 ? JSInliningHeuristic::kGeneralInlining | 813 ? JSInliningHeuristic::kGeneralInlining |
813 : JSInliningHeuristic::kRestrictedInlining, | 814 : JSInliningHeuristic::kRestrictedInlining, |
814 temp_zone, data->info(), data->jsgraph(), data->source_positions()); | 815 temp_zone, data->info(), data->jsgraph(), data->source_positions()); |
815 JSIntrinsicLowering intrinsic_lowering( | 816 JSIntrinsicLowering intrinsic_lowering( |
816 &graph_reducer, data->jsgraph(), | 817 &graph_reducer, data->jsgraph(), |
817 data->info()->is_deoptimization_enabled() | 818 data->info()->is_deoptimization_enabled() |
818 ? JSIntrinsicLowering::kDeoptimizationEnabled | 819 ? JSIntrinsicLowering::kDeoptimizationEnabled |
819 : JSIntrinsicLowering::kDeoptimizationDisabled); | 820 : JSIntrinsicLowering::kDeoptimizationDisabled); |
820 AddReducer(data, &graph_reducer, &dead_code_elimination); | 821 AddReducer(data, &graph_reducer, &dead_code_elimination); |
| 822 AddReducer(data, &graph_reducer, &checkpoint_elimination); |
821 AddReducer(data, &graph_reducer, &common_reducer); | 823 AddReducer(data, &graph_reducer, &common_reducer); |
822 if (data->info()->is_frame_specializing()) { | 824 if (data->info()->is_frame_specializing()) { |
823 AddReducer(data, &graph_reducer, &frame_specialization); | 825 AddReducer(data, &graph_reducer, &frame_specialization); |
824 } | 826 } |
825 AddReducer(data, &graph_reducer, &native_context_specialization); | 827 AddReducer(data, &graph_reducer, &native_context_specialization); |
826 AddReducer(data, &graph_reducer, &context_specialization); | 828 AddReducer(data, &graph_reducer, &context_specialization); |
827 AddReducer(data, &graph_reducer, &intrinsic_lowering); | 829 AddReducer(data, &graph_reducer, &intrinsic_lowering); |
828 AddReducer(data, &graph_reducer, &call_reducer); | 830 AddReducer(data, &graph_reducer, &call_reducer); |
829 AddReducer(data, &graph_reducer, &inlining); | 831 AddReducer(data, &graph_reducer, &inlining); |
830 graph_reducer.ReduceGraph(); | 832 graph_reducer.ReduceGraph(); |
(...skipping 1183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2014 data->DeleteRegisterAllocationZone(); | 2016 data->DeleteRegisterAllocationZone(); |
2015 } | 2017 } |
2016 | 2018 |
2017 CompilationInfo* PipelineImpl::info() const { return data_->info(); } | 2019 CompilationInfo* PipelineImpl::info() const { return data_->info(); } |
2018 | 2020 |
2019 Isolate* PipelineImpl::isolate() const { return info()->isolate(); } | 2021 Isolate* PipelineImpl::isolate() const { return info()->isolate(); } |
2020 | 2022 |
2021 } // namespace compiler | 2023 } // namespace compiler |
2022 } // namespace internal | 2024 } // namespace internal |
2023 } // namespace v8 | 2025 } // namespace v8 |
OLD | NEW |