| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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/compiler.h" | 5 #include "vm/compiler.h" |
| 6 | 6 |
| 7 #include "vm/assembler.h" | 7 #include "vm/assembler.h" |
| 8 | 8 |
| 9 #include "vm/ast_printer.h" | 9 #include "vm/ast_printer.h" |
| 10 #include "vm/code_generator.h" | 10 #include "vm/code_generator.h" |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 } | 257 } |
| 258 | 258 |
| 259 if (FLAG_range_analysis) { | 259 if (FLAG_range_analysis) { |
| 260 // We have to perform range analysis after LICM because it | 260 // We have to perform range analysis after LICM because it |
| 261 // optimistically moves CheckSmi through phis into loop preheaders | 261 // optimistically moves CheckSmi through phis into loop preheaders |
| 262 // making some phis smi. | 262 // making some phis smi. |
| 263 optimizer.InferSmiRanges(); | 263 optimizer.InferSmiRanges(); |
| 264 DEBUG_ASSERT(flow_graph->VerifyUseLists()); | 264 DEBUG_ASSERT(flow_graph->VerifyUseLists()); |
| 265 } | 265 } |
| 266 | 266 |
| 267 if (FLAG_constant_propagation) { |
| 268 // Constant propagation can use information from range analysis to |
| 269 // find unreachable branch targets. |
| 270 ConstantPropagator::OptimizeBranches(flow_graph); |
| 271 DEBUG_ASSERT(flow_graph->VerifyUseLists()); |
| 272 } |
| 273 |
| 267 // The final canonicalization pass before the code generation. | 274 // The final canonicalization pass before the code generation. |
| 268 if (FLAG_propagate_types) { | 275 if (FLAG_propagate_types) { |
| 269 // Recompute types after code movement was done to ensure correct | 276 // Recompute types after code movement was done to ensure correct |
| 270 // reaching types for hoisted values. | 277 // reaching types for hoisted values. |
| 271 FlowGraphTypePropagator propagator(flow_graph); | 278 FlowGraphTypePropagator propagator(flow_graph); |
| 272 propagator.Propagate(); | 279 propagator.Propagate(); |
| 273 DEBUG_ASSERT(flow_graph->VerifyUseLists()); | 280 DEBUG_ASSERT(flow_graph->VerifyUseLists()); |
| 274 } | 281 } |
| 275 optimizer.Canonicalize(); | 282 optimizer.Canonicalize(); |
| 276 DEBUG_ASSERT(flow_graph->VerifyUseLists()); | 283 DEBUG_ASSERT(flow_graph->VerifyUseLists()); |
| (...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 680 Object::Handle(isolate->object_store()->sticky_error()); | 687 Object::Handle(isolate->object_store()->sticky_error()); |
| 681 isolate->object_store()->clear_sticky_error(); | 688 isolate->object_store()->clear_sticky_error(); |
| 682 isolate->set_long_jump_base(base); | 689 isolate->set_long_jump_base(base); |
| 683 return result.raw(); | 690 return result.raw(); |
| 684 } | 691 } |
| 685 UNREACHABLE(); | 692 UNREACHABLE(); |
| 686 return Object::null(); | 693 return Object::null(); |
| 687 } | 694 } |
| 688 | 695 |
| 689 } // namespace dart | 696 } // namespace dart |
| OLD | NEW |