| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "vm/precompiler.h" | 5 #include "vm/precompiler.h" |
| 6 | 6 |
| 7 #include "vm/assembler.h" | 7 #include "vm/assembler.h" |
| 8 #include "vm/ast_printer.h" | 8 #include "vm/ast_printer.h" |
| 9 #include "vm/branch_optimizer.h" | 9 #include "vm/branch_optimizer.h" |
| 10 #include "vm/cha.h" | 10 #include "vm/cha.h" |
| 11 #include "vm/code_generator.h" | 11 #include "vm/code_generator.h" |
| 12 #include "vm/code_patcher.h" | 12 #include "vm/code_patcher.h" |
| 13 #include "vm/compiler.h" | 13 #include "vm/compiler.h" |
| 14 #include "vm/constant_propagator.h" | 14 #include "vm/constant_propagator.h" |
| 15 #include "vm/dart_entry.h" | 15 #include "vm/dart_entry.h" |
| 16 #include "vm/disassembler.h" | 16 #include "vm/disassembler.h" |
| 17 #include "vm/exceptions.h" | 17 #include "vm/exceptions.h" |
| 18 #include "vm/flags.h" | 18 #include "vm/flags.h" |
| 19 #include "vm/flow_graph.h" | 19 #include "vm/flow_graph.h" |
| 20 #include "vm/flow_graph_allocator.h" | 20 #include "vm/flow_graph_allocator.h" |
| 21 #include "vm/flow_graph_builder.h" | 21 #include "vm/flow_graph_builder.h" |
| 22 #include "vm/flow_graph_compiler.h" | 22 #include "vm/flow_graph_compiler.h" |
| 23 #include "vm/flow_graph_inliner.h" | 23 #include "vm/flow_graph_inliner.h" |
| 24 #include "vm/flow_graph_optimizer.h" | 24 #include "vm/flow_graph_optimizer.h" |
| 25 #include "vm/flow_graph_range_analysis.h" |
| 25 #include "vm/flow_graph_type_propagator.h" | 26 #include "vm/flow_graph_type_propagator.h" |
| 26 #include "vm/hash_table.h" | 27 #include "vm/hash_table.h" |
| 27 #include "vm/il_printer.h" | 28 #include "vm/il_printer.h" |
| 28 #include "vm/isolate.h" | 29 #include "vm/isolate.h" |
| 29 #include "vm/log.h" | 30 #include "vm/log.h" |
| 30 #include "vm/longjump.h" | 31 #include "vm/longjump.h" |
| 31 #include "vm/object.h" | 32 #include "vm/object.h" |
| 32 #include "vm/object_store.h" | 33 #include "vm/object_store.h" |
| 33 #include "vm/os.h" | 34 #include "vm/os.h" |
| 34 #include "vm/parser.h" | 35 #include "vm/parser.h" |
| (...skipping 1875 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1910 "RangeAnalysis"); | 1911 "RangeAnalysis"); |
| 1911 #endif // !PRODUCT | 1912 #endif // !PRODUCT |
| 1912 // Propagate types after store-load-forwarding. Some phis may have | 1913 // Propagate types after store-load-forwarding. Some phis may have |
| 1913 // become smi phis that can be processed by range analysis. | 1914 // become smi phis that can be processed by range analysis. |
| 1914 FlowGraphTypePropagator::Propagate(flow_graph); | 1915 FlowGraphTypePropagator::Propagate(flow_graph); |
| 1915 DEBUG_ASSERT(flow_graph->VerifyUseLists()); | 1916 DEBUG_ASSERT(flow_graph->VerifyUseLists()); |
| 1916 | 1917 |
| 1917 // We have to perform range analysis after LICM because it | 1918 // We have to perform range analysis after LICM because it |
| 1918 // optimistically moves CheckSmi through phis into loop preheaders | 1919 // optimistically moves CheckSmi through phis into loop preheaders |
| 1919 // making some phis smi. | 1920 // making some phis smi. |
| 1920 optimizer.InferIntRanges(); | 1921 RangeAnalysis range_analysis(flow_graph); |
| 1922 range_analysis.Analyze(); |
| 1921 DEBUG_ASSERT(flow_graph->VerifyUseLists()); | 1923 DEBUG_ASSERT(flow_graph->VerifyUseLists()); |
| 1922 } | 1924 } |
| 1923 | 1925 |
| 1924 if (FLAG_constant_propagation) { | 1926 if (FLAG_constant_propagation) { |
| 1925 #ifndef PRODUCT | 1927 #ifndef PRODUCT |
| 1926 TimelineDurationScope tds2(thread(), | 1928 TimelineDurationScope tds2(thread(), |
| 1927 compiler_timeline, | 1929 compiler_timeline, |
| 1928 "ConstantPropagator::OptimizeBranches"); | 1930 "ConstantPropagator::OptimizeBranches"); |
| 1929 #endif // !PRODUCT | 1931 #endif // !PRODUCT |
| 1930 // Constant propagation can use information from range analysis to | 1932 // Constant propagation can use information from range analysis to |
| (...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2230 CompilationPipeline::New(thread->zone(), function); | 2232 CompilationPipeline::New(thread->zone(), function); |
| 2231 | 2233 |
| 2232 ASSERT(FLAG_precompilation); | 2234 ASSERT(FLAG_precompilation); |
| 2233 const bool optimized = function.IsOptimizable(); // False for natives. | 2235 const bool optimized = function.IsOptimizable(); // False for natives. |
| 2234 return PrecompileFunctionHelper(pipeline, function, optimized); | 2236 return PrecompileFunctionHelper(pipeline, function, optimized); |
| 2235 } | 2237 } |
| 2236 | 2238 |
| 2237 #endif // DART_PRECOMPILER | 2239 #endif // DART_PRECOMPILER |
| 2238 | 2240 |
| 2239 } // namespace dart | 2241 } // namespace dart |
| OLD | NEW |