| 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 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 // generated code. | 164 // generated code. |
| 165 intptr_t length = graph_builder.postorder_block_entries().length(); | 165 intptr_t length = graph_builder.postorder_block_entries().length(); |
| 166 for (intptr_t i = length - 1; i >= 0; --i) { | 166 for (intptr_t i = length - 1; i >= 0; --i) { |
| 167 block_order.Add(graph_builder.postorder_block_entries()[i]); | 167 block_order.Add(graph_builder.postorder_block_entries()[i]); |
| 168 } | 168 } |
| 169 if (optimized) { | 169 if (optimized) { |
| 170 FlowGraphOptimizer optimizer(block_order); | 170 FlowGraphOptimizer optimizer(block_order); |
| 171 optimizer.ApplyICData(); | 171 optimizer.ApplyICData(); |
| 172 | 172 |
| 173 // Propagate types and eliminate more type tests. | 173 // Propagate types and eliminate more type tests. |
| 174 FlowGraphTypePropagator propagator(parsed_function, block_order); | 174 FlowGraphTypePropagator propagator(parsed_function, |
| 175 block_order, |
| 176 optimized && use_ssa); |
| 175 propagator.PropagateTypes(); | 177 propagator.PropagateTypes(); |
| 176 | 178 |
| 177 // Do optimizations that depend on the propagated type information. | 179 // Do optimizations that depend on the propagated type information. |
| 178 optimizer.OptimizeComputations(); | 180 optimizer.OptimizeComputations(); |
| 179 | 181 |
| 180 if (use_ssa) { | 182 if (use_ssa) { |
| 181 // Perform register allocation on the SSA graph. | 183 // Perform register allocation on the SSA graph. |
| 182 FlowGraphAllocator allocator(block_order, &graph_builder); | 184 FlowGraphAllocator allocator(block_order, &graph_builder); |
| 183 allocator.AllocateRegisters(); | 185 allocator.AllocateRegisters(); |
| 184 } | 186 } |
| (...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 531 result = isolate->object_store()->sticky_error(); | 533 result = isolate->object_store()->sticky_error(); |
| 532 isolate->object_store()->clear_sticky_error(); | 534 isolate->object_store()->clear_sticky_error(); |
| 533 isolate->set_long_jump_base(base); | 535 isolate->set_long_jump_base(base); |
| 534 return result.raw(); | 536 return result.raw(); |
| 535 } | 537 } |
| 536 UNREACHABLE(); | 538 UNREACHABLE(); |
| 537 return Object::null(); | 539 return Object::null(); |
| 538 } | 540 } |
| 539 | 541 |
| 540 } // namespace dart | 542 } // namespace dart |
| OLD | NEW |