| 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 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 252 | 252 |
| 253 if (FLAG_range_analysis) { | 253 if (FLAG_range_analysis) { |
| 254 // We have to perform range analysis after LICM because it | 254 // We have to perform range analysis after LICM because it |
| 255 // optimistically moves CheckSmi through phis into loop preheaders | 255 // optimistically moves CheckSmi through phis into loop preheaders |
| 256 // making some phis smi. | 256 // making some phis smi. |
| 257 optimizer.InferSmiRanges(); | 257 optimizer.InferSmiRanges(); |
| 258 DEBUG_ASSERT(flow_graph->VerifyUseLists()); | 258 DEBUG_ASSERT(flow_graph->VerifyUseLists()); |
| 259 } | 259 } |
| 260 | 260 |
| 261 // The final canonicalization pass before the code generation. | 261 // The final canonicalization pass before the code generation. |
| 262 if (FLAG_propagate_types) { |
| 263 // Recompute types after code movement was done to ensure correct |
| 264 // reaching types for hoisted values. |
| 265 FlowGraphTypePropagator propagator(flow_graph); |
| 266 propagator.Propagate(); |
| 267 DEBUG_ASSERT(flow_graph->VerifyUseLists()); |
| 268 } |
| 262 optimizer.Canonicalize(); | 269 optimizer.Canonicalize(); |
| 263 DEBUG_ASSERT(flow_graph->VerifyUseLists()); | 270 DEBUG_ASSERT(flow_graph->VerifyUseLists()); |
| 264 | 271 |
| 265 // Perform register allocation on the SSA graph. | 272 // Perform register allocation on the SSA graph. |
| 266 FlowGraphAllocator allocator(*flow_graph); | 273 FlowGraphAllocator allocator(*flow_graph); |
| 267 allocator.AllocateRegisters(); | 274 allocator.AllocateRegisters(); |
| 268 | 275 |
| 269 if (FLAG_print_flow_graph || FLAG_print_flow_graph_optimized) { | 276 if (FLAG_print_flow_graph || FLAG_print_flow_graph_optimized) { |
| 270 FlowGraphPrinter::PrintGraph("After Optimizations", flow_graph); | 277 FlowGraphPrinter::PrintGraph("After Optimizations", flow_graph); |
| 271 } | 278 } |
| (...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 661 Object::Handle(isolate->object_store()->sticky_error()); | 668 Object::Handle(isolate->object_store()->sticky_error()); |
| 662 isolate->object_store()->clear_sticky_error(); | 669 isolate->object_store()->clear_sticky_error(); |
| 663 isolate->set_long_jump_base(base); | 670 isolate->set_long_jump_base(base); |
| 664 return result.raw(); | 671 return result.raw(); |
| 665 } | 672 } |
| 666 UNREACHABLE(); | 673 UNREACHABLE(); |
| 667 return Object::null(); | 674 return Object::null(); |
| 668 } | 675 } |
| 669 | 676 |
| 670 } // namespace dart | 677 } // namespace dart |
| OLD | NEW |