| 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 765 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 776 struct InliningPhase { | 776 struct InliningPhase { |
| 777 static const char* phase_name() { return "inlining"; } | 777 static const char* phase_name() { return "inlining"; } |
| 778 | 778 |
| 779 void Run(PipelineData* data, Zone* temp_zone) { | 779 void Run(PipelineData* data, Zone* temp_zone) { |
| 780 JSGraphReducer graph_reducer(data->jsgraph(), temp_zone); | 780 JSGraphReducer graph_reducer(data->jsgraph(), temp_zone); |
| 781 DeadCodeElimination dead_code_elimination(&graph_reducer, data->graph(), | 781 DeadCodeElimination dead_code_elimination(&graph_reducer, data->graph(), |
| 782 data->common()); | 782 data->common()); |
| 783 CheckpointElimination checkpoint_elimination(&graph_reducer); | 783 CheckpointElimination checkpoint_elimination(&graph_reducer); |
| 784 CommonOperatorReducer common_reducer(&graph_reducer, data->graph(), | 784 CommonOperatorReducer common_reducer(&graph_reducer, data->graph(), |
| 785 data->common(), data->machine()); | 785 data->common(), data->machine()); |
| 786 JSCallReducer::Flags call_reducer_flags = JSCallReducer::kNoFlags; | |
| 787 if (data->info()->is_deoptimization_enabled()) { | |
| 788 call_reducer_flags |= JSCallReducer::kDeoptimizationEnabled; | |
| 789 } | |
| 790 JSCallReducer call_reducer(&graph_reducer, data->jsgraph(), | 786 JSCallReducer call_reducer(&graph_reducer, data->jsgraph(), |
| 791 call_reducer_flags, data->native_context(), | 787 data->native_context(), |
| 792 data->info()->dependencies()); | 788 data->info()->dependencies()); |
| 793 JSContextSpecialization context_specialization( | 789 JSContextSpecialization context_specialization( |
| 794 &graph_reducer, data->jsgraph(), | 790 &graph_reducer, data->jsgraph(), |
| 795 data->info()->is_function_context_specializing() | 791 data->info()->is_function_context_specializing() |
| 796 ? handle(data->info()->context()) | 792 ? handle(data->info()->context()) |
| 797 : MaybeHandle<Context>()); | 793 : MaybeHandle<Context>()); |
| 798 JSFrameSpecialization frame_specialization( | 794 JSFrameSpecialization frame_specialization( |
| 799 &graph_reducer, data->info()->osr_frame(), data->jsgraph()); | 795 &graph_reducer, data->info()->osr_frame(), data->jsgraph()); |
| 800 JSNativeContextSpecialization::Flags flags = | 796 JSNativeContextSpecialization::Flags flags = |
| 801 JSNativeContextSpecialization::kNoFlags; | 797 JSNativeContextSpecialization::kNoFlags; |
| 802 if (data->info()->is_accessor_inlining_enabled()) { | 798 if (data->info()->is_accessor_inlining_enabled()) { |
| 803 flags |= JSNativeContextSpecialization::kAccessorInliningEnabled; | 799 flags |= JSNativeContextSpecialization::kAccessorInliningEnabled; |
| 804 } | 800 } |
| 805 if (data->info()->is_bailout_on_uninitialized()) { | 801 if (data->info()->is_bailout_on_uninitialized()) { |
| 806 flags |= JSNativeContextSpecialization::kBailoutOnUninitialized; | 802 flags |= JSNativeContextSpecialization::kBailoutOnUninitialized; |
| 807 } | 803 } |
| 808 if (data->info()->is_deoptimization_enabled()) { | |
| 809 flags |= JSNativeContextSpecialization::kDeoptimizationEnabled; | |
| 810 } | |
| 811 JSNativeContextSpecialization native_context_specialization( | 804 JSNativeContextSpecialization native_context_specialization( |
| 812 &graph_reducer, data->jsgraph(), flags, data->native_context(), | 805 &graph_reducer, data->jsgraph(), flags, data->native_context(), |
| 813 data->info()->dependencies(), temp_zone); | 806 data->info()->dependencies(), temp_zone); |
| 814 JSInliningHeuristic inlining( | 807 JSInliningHeuristic inlining( |
| 815 &graph_reducer, data->info()->is_inlining_enabled() | 808 &graph_reducer, data->info()->is_inlining_enabled() |
| 816 ? JSInliningHeuristic::kGeneralInlining | 809 ? JSInliningHeuristic::kGeneralInlining |
| 817 : JSInliningHeuristic::kRestrictedInlining, | 810 : JSInliningHeuristic::kRestrictedInlining, |
| 818 temp_zone, data->info(), data->jsgraph(), data->source_positions()); | 811 temp_zone, data->info(), data->jsgraph(), data->source_positions()); |
| 819 JSIntrinsicLowering intrinsic_lowering( | 812 JSIntrinsicLowering intrinsic_lowering( |
| 820 &graph_reducer, data->jsgraph(), | 813 &graph_reducer, data->jsgraph(), |
| 821 data->info()->is_deoptimization_enabled() | 814 data->info()->is_deoptimization_enabled() |
| 822 ? JSIntrinsicLowering::kDeoptimizationEnabled | 815 ? JSIntrinsicLowering::kDeoptimizationEnabled |
| 823 : JSIntrinsicLowering::kDeoptimizationDisabled); | 816 : JSIntrinsicLowering::kDeoptimizationDisabled); |
| 824 AddReducer(data, &graph_reducer, &dead_code_elimination); | 817 AddReducer(data, &graph_reducer, &dead_code_elimination); |
| 825 AddReducer(data, &graph_reducer, &checkpoint_elimination); | 818 AddReducer(data, &graph_reducer, &checkpoint_elimination); |
| 826 AddReducer(data, &graph_reducer, &common_reducer); | 819 AddReducer(data, &graph_reducer, &common_reducer); |
| 827 if (data->info()->is_frame_specializing()) { | 820 if (data->info()->is_frame_specializing()) { |
| 828 AddReducer(data, &graph_reducer, &frame_specialization); | 821 AddReducer(data, &graph_reducer, &frame_specialization); |
| 829 } | 822 } |
| 830 AddReducer(data, &graph_reducer, &native_context_specialization); | 823 if (data->info()->is_deoptimization_enabled()) { |
| 824 AddReducer(data, &graph_reducer, &native_context_specialization); |
| 825 } |
| 831 AddReducer(data, &graph_reducer, &context_specialization); | 826 AddReducer(data, &graph_reducer, &context_specialization); |
| 832 AddReducer(data, &graph_reducer, &intrinsic_lowering); | 827 AddReducer(data, &graph_reducer, &intrinsic_lowering); |
| 833 AddReducer(data, &graph_reducer, &call_reducer); | 828 if (data->info()->is_deoptimization_enabled()) { |
| 829 AddReducer(data, &graph_reducer, &call_reducer); |
| 830 } |
| 834 AddReducer(data, &graph_reducer, &inlining); | 831 AddReducer(data, &graph_reducer, &inlining); |
| 835 graph_reducer.ReduceGraph(); | 832 graph_reducer.ReduceGraph(); |
| 836 } | 833 } |
| 837 }; | 834 }; |
| 838 | 835 |
| 839 | 836 |
| 840 struct TyperPhase { | 837 struct TyperPhase { |
| 841 static const char* phase_name() { return "typer"; } | 838 static const char* phase_name() { return "typer"; } |
| 842 | 839 |
| 843 void Run(PipelineData* data, Zone* temp_zone, Typer* typer) { | 840 void Run(PipelineData* data, Zone* temp_zone, Typer* typer) { |
| (...skipping 1183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2027 data->DeleteRegisterAllocationZone(); | 2024 data->DeleteRegisterAllocationZone(); |
| 2028 } | 2025 } |
| 2029 | 2026 |
| 2030 CompilationInfo* PipelineImpl::info() const { return data_->info(); } | 2027 CompilationInfo* PipelineImpl::info() const { return data_->info(); } |
| 2031 | 2028 |
| 2032 Isolate* PipelineImpl::isolate() const { return info()->isolate(); } | 2029 Isolate* PipelineImpl::isolate() const { return info()->isolate(); } |
| 2033 | 2030 |
| 2034 } // namespace compiler | 2031 } // namespace compiler |
| 2035 } // namespace internal | 2032 } // namespace internal |
| 2036 } // namespace v8 | 2033 } // namespace v8 |
| OLD | NEW |