| 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 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 295 if (optimizer.Canonicalize()) { | 295 if (optimizer.Canonicalize()) { |
| 296 // To fully remove redundant boxing (e.g. BoxDouble used only in | 296 // To fully remove redundant boxing (e.g. BoxDouble used only in |
| 297 // environments and UnboxDouble instructions) instruction we | 297 // environments and UnboxDouble instructions) instruction we |
| 298 // first need to replace all their uses and then fold them away. | 298 // first need to replace all their uses and then fold them away. |
| 299 // For now we just repeat Canonicalize twice to do that. | 299 // For now we just repeat Canonicalize twice to do that. |
| 300 // TODO(vegorov): implement a separate representation folding pass. | 300 // TODO(vegorov): implement a separate representation folding pass. |
| 301 optimizer.Canonicalize(); | 301 optimizer.Canonicalize(); |
| 302 } | 302 } |
| 303 DEBUG_ASSERT(flow_graph->VerifyUseLists()); | 303 DEBUG_ASSERT(flow_graph->VerifyUseLists()); |
| 304 | 304 |
| 305 // Optimize try-blocks. |
| 306 optimizer.AnalyzeTryCatch(); |
| 307 |
| 305 // Perform register allocation on the SSA graph. | 308 // Perform register allocation on the SSA graph. |
| 306 FlowGraphAllocator allocator(*flow_graph); | 309 FlowGraphAllocator allocator(*flow_graph); |
| 307 allocator.AllocateRegisters(); | 310 allocator.AllocateRegisters(); |
| 308 | 311 |
| 309 if (FLAG_print_flow_graph || FLAG_print_flow_graph_optimized) { | 312 if (FLAG_print_flow_graph || FLAG_print_flow_graph_optimized) { |
| 310 FlowGraphPrinter::PrintGraph("After Optimizations", flow_graph); | 313 FlowGraphPrinter::PrintGraph("After Optimizations", flow_graph); |
| 311 } | 314 } |
| 312 } | 315 } |
| 313 | 316 |
| 314 Assembler assembler; | 317 Assembler assembler; |
| (...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 709 Object::Handle(isolate->object_store()->sticky_error()); | 712 Object::Handle(isolate->object_store()->sticky_error()); |
| 710 isolate->object_store()->clear_sticky_error(); | 713 isolate->object_store()->clear_sticky_error(); |
| 711 isolate->set_long_jump_base(base); | 714 isolate->set_long_jump_base(base); |
| 712 return result.raw(); | 715 return result.raw(); |
| 713 } | 716 } |
| 714 UNREACHABLE(); | 717 UNREACHABLE(); |
| 715 return Object::null(); | 718 return Object::null(); |
| 716 } | 719 } |
| 717 | 720 |
| 718 } // namespace dart | 721 } // namespace dart |
| OLD | NEW |