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 792 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
803 flags |= JSNativeContextSpecialization::kDeoptimizationEnabled; | 803 flags |= JSNativeContextSpecialization::kDeoptimizationEnabled; |
804 } | 804 } |
805 JSNativeContextSpecialization native_context_specialization( | 805 JSNativeContextSpecialization native_context_specialization( |
806 &graph_reducer, data->jsgraph(), flags, data->native_context(), | 806 &graph_reducer, data->jsgraph(), flags, data->native_context(), |
807 data->info()->dependencies(), temp_zone); | 807 data->info()->dependencies(), temp_zone); |
808 JSInliningHeuristic inlining(&graph_reducer, | 808 JSInliningHeuristic inlining(&graph_reducer, |
809 data->info()->is_inlining_enabled() | 809 data->info()->is_inlining_enabled() |
810 ? JSInliningHeuristic::kGeneralInlining | 810 ? JSInliningHeuristic::kGeneralInlining |
811 : JSInliningHeuristic::kRestrictedInlining, | 811 : JSInliningHeuristic::kRestrictedInlining, |
812 temp_zone, data->info(), data->jsgraph()); | 812 temp_zone, data->info(), data->jsgraph()); |
| 813 JSIntrinsicLowering intrinsic_lowering( |
| 814 &graph_reducer, data->jsgraph(), |
| 815 data->info()->is_deoptimization_enabled() |
| 816 ? JSIntrinsicLowering::kDeoptimizationEnabled |
| 817 : JSIntrinsicLowering::kDeoptimizationDisabled); |
813 AddReducer(data, &graph_reducer, &dead_code_elimination); | 818 AddReducer(data, &graph_reducer, &dead_code_elimination); |
814 AddReducer(data, &graph_reducer, &common_reducer); | 819 AddReducer(data, &graph_reducer, &common_reducer); |
815 if (data->info()->is_frame_specializing()) { | 820 if (data->info()->is_frame_specializing()) { |
816 AddReducer(data, &graph_reducer, &frame_specialization); | 821 AddReducer(data, &graph_reducer, &frame_specialization); |
817 } | 822 } |
818 if (data->info()->is_deoptimization_enabled()) { | 823 if (data->info()->is_deoptimization_enabled()) { |
819 AddReducer(data, &graph_reducer, &global_object_specialization); | 824 AddReducer(data, &graph_reducer, &global_object_specialization); |
820 } | 825 } |
821 AddReducer(data, &graph_reducer, &native_context_specialization); | 826 AddReducer(data, &graph_reducer, &native_context_specialization); |
822 AddReducer(data, &graph_reducer, &context_specialization); | 827 AddReducer(data, &graph_reducer, &context_specialization); |
| 828 AddReducer(data, &graph_reducer, &intrinsic_lowering); |
823 AddReducer(data, &graph_reducer, &call_reducer); | 829 AddReducer(data, &graph_reducer, &call_reducer); |
824 if (!data->info()->is_optimizing_from_bytecode()) { | 830 if (!data->info()->is_optimizing_from_bytecode()) { |
825 AddReducer(data, &graph_reducer, &inlining); | 831 AddReducer(data, &graph_reducer, &inlining); |
826 } | 832 } |
827 graph_reducer.ReduceGraph(); | 833 graph_reducer.ReduceGraph(); |
828 } | 834 } |
829 }; | 835 }; |
830 | 836 |
831 | 837 |
832 struct TyperPhase { | 838 struct TyperPhase { |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
896 JSTypedLowering::Flags typed_lowering_flags = JSTypedLowering::kNoFlags; | 902 JSTypedLowering::Flags typed_lowering_flags = JSTypedLowering::kNoFlags; |
897 if (data->info()->is_deoptimization_enabled()) { | 903 if (data->info()->is_deoptimization_enabled()) { |
898 typed_lowering_flags |= JSTypedLowering::kDeoptimizationEnabled; | 904 typed_lowering_flags |= JSTypedLowering::kDeoptimizationEnabled; |
899 } | 905 } |
900 if (data->info()->is_optimizing_from_bytecode()) { | 906 if (data->info()->is_optimizing_from_bytecode()) { |
901 typed_lowering_flags |= JSTypedLowering::kDisableIntegerBinaryOpReduction; | 907 typed_lowering_flags |= JSTypedLowering::kDisableIntegerBinaryOpReduction; |
902 } | 908 } |
903 JSTypedLowering typed_lowering(&graph_reducer, data->info()->dependencies(), | 909 JSTypedLowering typed_lowering(&graph_reducer, data->info()->dependencies(), |
904 typed_lowering_flags, data->jsgraph(), | 910 typed_lowering_flags, data->jsgraph(), |
905 temp_zone); | 911 temp_zone); |
906 JSIntrinsicLowering intrinsic_lowering( | |
907 &graph_reducer, data->jsgraph(), | |
908 data->info()->is_deoptimization_enabled() | |
909 ? JSIntrinsicLowering::kDeoptimizationEnabled | |
910 : JSIntrinsicLowering::kDeoptimizationDisabled); | |
911 SimplifiedOperatorReducer simple_reducer(&graph_reducer, data->jsgraph()); | 912 SimplifiedOperatorReducer simple_reducer(&graph_reducer, data->jsgraph()); |
912 CheckpointElimination checkpoint_elimination(&graph_reducer); | 913 CheckpointElimination checkpoint_elimination(&graph_reducer); |
913 CommonOperatorReducer common_reducer(&graph_reducer, data->graph(), | 914 CommonOperatorReducer common_reducer(&graph_reducer, data->graph(), |
914 data->common(), data->machine()); | 915 data->common(), data->machine()); |
915 AddReducer(data, &graph_reducer, &dead_code_elimination); | 916 AddReducer(data, &graph_reducer, &dead_code_elimination); |
916 AddReducer(data, &graph_reducer, &builtin_reducer); | 917 AddReducer(data, &graph_reducer, &builtin_reducer); |
917 if (data->info()->is_deoptimization_enabled()) { | 918 if (data->info()->is_deoptimization_enabled()) { |
918 AddReducer(data, &graph_reducer, &create_lowering); | 919 AddReducer(data, &graph_reducer, &create_lowering); |
919 } | 920 } |
920 AddReducer(data, &graph_reducer, &typed_lowering); | 921 AddReducer(data, &graph_reducer, &typed_lowering); |
921 AddReducer(data, &graph_reducer, &intrinsic_lowering); | |
922 AddReducer(data, &graph_reducer, &simple_reducer); | 922 AddReducer(data, &graph_reducer, &simple_reducer); |
923 AddReducer(data, &graph_reducer, &checkpoint_elimination); | 923 AddReducer(data, &graph_reducer, &checkpoint_elimination); |
924 AddReducer(data, &graph_reducer, &common_reducer); | 924 AddReducer(data, &graph_reducer, &common_reducer); |
925 graph_reducer.ReduceGraph(); | 925 graph_reducer.ReduceGraph(); |
926 } | 926 } |
927 }; | 927 }; |
928 | 928 |
929 | 929 |
930 struct EscapeAnalysisPhase { | 930 struct EscapeAnalysisPhase { |
931 static const char* phase_name() { return "escape analysis"; } | 931 static const char* phase_name() { return "escape analysis"; } |
(...skipping 961 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1893 data->DeleteRegisterAllocationZone(); | 1893 data->DeleteRegisterAllocationZone(); |
1894 } | 1894 } |
1895 | 1895 |
1896 CompilationInfo* PipelineImpl::info() const { return data_->info(); } | 1896 CompilationInfo* PipelineImpl::info() const { return data_->info(); } |
1897 | 1897 |
1898 Isolate* PipelineImpl::isolate() const { return info()->isolate(); } | 1898 Isolate* PipelineImpl::isolate() const { return info()->isolate(); } |
1899 | 1899 |
1900 } // namespace compiler | 1900 } // namespace compiler |
1901 } // namespace internal | 1901 } // namespace internal |
1902 } // namespace v8 | 1902 } // namespace v8 |
OLD | NEW |