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/aot_optimizer.h" | 7 #include "vm/aot_optimizer.h" |
8 #include "vm/assembler.h" | 8 #include "vm/assembler.h" |
9 #include "vm/ast_printer.h" | 9 #include "vm/ast_printer.h" |
10 #include "vm/branch_optimizer.h" | 10 #include "vm/branch_optimizer.h" |
(...skipping 3143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3154 DEBUG_ASSERT(flow_graph->VerifyUseLists()); | 3154 DEBUG_ASSERT(flow_graph->VerifyUseLists()); |
3155 // Canonicalization introduced more opportunities for constant | 3155 // Canonicalization introduced more opportunities for constant |
3156 // propagation. | 3156 // propagation. |
3157 ConstantPropagator::Optimize(flow_graph); | 3157 ConstantPropagator::Optimize(flow_graph); |
3158 DEBUG_ASSERT(flow_graph->VerifyUseLists()); | 3158 DEBUG_ASSERT(flow_graph->VerifyUseLists()); |
3159 } | 3159 } |
3160 | 3160 |
3161 // Optimistically convert loop phis that have a single non-smi input | 3161 // Optimistically convert loop phis that have a single non-smi input |
3162 // coming from the loop pre-header into smi-phis. | 3162 // coming from the loop pre-header into smi-phis. |
3163 if (FLAG_loop_invariant_code_motion) { | 3163 if (FLAG_loop_invariant_code_motion) { |
| 3164 flow_graph->FixupRedefinitions(); |
| 3165 DEBUG_ASSERT(flow_graph->VerifyRedefinitions()); |
3164 LICM licm(flow_graph); | 3166 LICM licm(flow_graph); |
3165 licm.OptimisticallySpecializeSmiPhis(); | 3167 licm.OptimisticallySpecializeSmiPhis(); |
3166 DEBUG_ASSERT(flow_graph->VerifyUseLists()); | 3168 DEBUG_ASSERT(flow_graph->VerifyUseLists()); |
3167 } | 3169 } |
3168 | 3170 |
3169 // Propagate types and eliminate even more type tests. | 3171 // Propagate types and eliminate even more type tests. |
3170 // Recompute types after constant propagation to infer more precise | 3172 // Recompute types after constant propagation to infer more precise |
3171 // types for uses that were previously reached by now eliminated phis. | 3173 // types for uses that were previously reached by now eliminated phis. |
3172 FlowGraphTypePropagator::Propagate(flow_graph); | 3174 FlowGraphTypePropagator::Propagate(flow_graph); |
3173 DEBUG_ASSERT(flow_graph->VerifyUseLists()); | 3175 DEBUG_ASSERT(flow_graph->VerifyUseLists()); |
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3552 | 3554 |
3553 ASSERT(FLAG_precompiled_mode); | 3555 ASSERT(FLAG_precompiled_mode); |
3554 const bool optimized = function.IsOptimizable(); // False for natives. | 3556 const bool optimized = function.IsOptimizable(); // False for natives. |
3555 DartPrecompilationPipeline pipeline(zone, field_type_map); | 3557 DartPrecompilationPipeline pipeline(zone, field_type_map); |
3556 return PrecompileFunctionHelper(precompiler, &pipeline, function, optimized); | 3558 return PrecompileFunctionHelper(precompiler, &pipeline, function, optimized); |
3557 } | 3559 } |
3558 | 3560 |
3559 #endif // DART_PRECOMPILER | 3561 #endif // DART_PRECOMPILER |
3560 | 3562 |
3561 } // namespace dart | 3563 } // namespace dart |
OLD | NEW |