| 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 #include "vm/ast_printer.h" | 8 #include "vm/ast_printer.h" |
| 9 #include "vm/code_generator.h" | 9 #include "vm/code_generator.h" |
| 10 #include "vm/code_patcher.h" | 10 #include "vm/code_patcher.h" |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 // because it is a 'natural' order for the human reader of the | 166 // because it is a 'natural' order for the human reader of the |
| 167 // generated code. | 167 // generated code. |
| 168 intptr_t length = graph_builder.postorder_block_entries().length(); | 168 intptr_t length = graph_builder.postorder_block_entries().length(); |
| 169 for (intptr_t i = length - 1; i >= 0; --i) { | 169 for (intptr_t i = length - 1; i >= 0; --i) { |
| 170 block_order.Add(graph_builder.postorder_block_entries()[i]); | 170 block_order.Add(graph_builder.postorder_block_entries()[i]); |
| 171 } | 171 } |
| 172 if (optimized) { | 172 if (optimized) { |
| 173 FlowGraphOptimizer optimizer(block_order); | 173 FlowGraphOptimizer optimizer(block_order); |
| 174 optimizer.ApplyICData(); | 174 optimizer.ApplyICData(); |
| 175 | 175 |
| 176 // Propagate types and eliminate more type tests. |
| 177 FlowGraphTypePropagator propagator(parsed_function, block_order); |
| 178 propagator.PropagateTypes(); |
| 179 |
| 176 if (use_ssa) { | 180 if (use_ssa) { |
| 177 // Perform register allocation on the SSA graph. | 181 // Perform register allocation on the SSA graph. |
| 178 FlowGraphAllocator allocator(block_order, &graph_builder); | 182 FlowGraphAllocator allocator(block_order, &graph_builder); |
| 179 allocator.AllocateRegisters(); | 183 allocator.AllocateRegisters(); |
| 180 } | 184 } |
| 181 if (FLAG_print_flow_graph) { | 185 if (FLAG_print_flow_graph) { |
| 182 OS::Print("After Optimizations:\n"); | 186 OS::Print("After Optimizations:\n"); |
| 183 FlowGraphPrinter printer(Function::Handle(), block_order); | 187 FlowGraphPrinter printer(Function::Handle(), block_order); |
| 184 printer.PrintBlocks(); | 188 printer.PrintBlocks(); |
| 185 } | 189 } |
| (...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 489 isolate->object_store()->clear_sticky_error(); | 493 isolate->object_store()->clear_sticky_error(); |
| 490 isolate->set_long_jump_base(base); | 494 isolate->set_long_jump_base(base); |
| 491 return result.raw(); | 495 return result.raw(); |
| 492 } | 496 } |
| 493 UNREACHABLE(); | 497 UNREACHABLE(); |
| 494 return Object::null(); | 498 return Object::null(); |
| 495 } | 499 } |
| 496 | 500 |
| 497 | 501 |
| 498 } // namespace dart | 502 } // namespace dart |
| OLD | NEW |