| 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 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 | 217 |
| 218 IfConverter::Simplify(flow_graph); | 218 IfConverter::Simplify(flow_graph); |
| 219 DEBUG_ASSERT(flow_graph->VerifyUseLists()); | 219 DEBUG_ASSERT(flow_graph->VerifyUseLists()); |
| 220 | 220 |
| 221 if (FLAG_constant_propagation) { | 221 if (FLAG_constant_propagation) { |
| 222 ConstantPropagator::Optimize(flow_graph); | 222 ConstantPropagator::Optimize(flow_graph); |
| 223 DEBUG_ASSERT(flow_graph->VerifyUseLists()); | 223 DEBUG_ASSERT(flow_graph->VerifyUseLists()); |
| 224 // A canonicalization pass to remove e.g. smi checks on smi constants. | 224 // A canonicalization pass to remove e.g. smi checks on smi constants. |
| 225 optimizer.Canonicalize(); | 225 optimizer.Canonicalize(); |
| 226 DEBUG_ASSERT(flow_graph->VerifyUseLists()); | 226 DEBUG_ASSERT(flow_graph->VerifyUseLists()); |
| 227 // Canonicalization introduced more opportunities for constant |
| 228 // propagation. |
| 229 ConstantPropagator::Optimize(flow_graph); |
| 230 DEBUG_ASSERT(flow_graph->VerifyUseLists()); |
| 227 } | 231 } |
| 228 | 232 |
| 229 // Propagate types and eliminate even more type tests. | 233 // Propagate types and eliminate even more type tests. |
| 230 if (FLAG_propagate_types) { | 234 if (FLAG_propagate_types) { |
| 231 // Recompute types after constant propagation to infer more precise | 235 // Recompute types after constant propagation to infer more precise |
| 232 // types for uses that were previously reached by now eliminated phis. | 236 // types for uses that were previously reached by now eliminated phis. |
| 233 FlowGraphTypePropagator propagator(flow_graph); | 237 FlowGraphTypePropagator propagator(flow_graph); |
| 234 propagator.Propagate(); | 238 propagator.Propagate(); |
| 235 DEBUG_ASSERT(flow_graph->VerifyUseLists()); | 239 DEBUG_ASSERT(flow_graph->VerifyUseLists()); |
| 236 } | 240 } |
| (...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 690 Object::Handle(isolate->object_store()->sticky_error()); | 694 Object::Handle(isolate->object_store()->sticky_error()); |
| 691 isolate->object_store()->clear_sticky_error(); | 695 isolate->object_store()->clear_sticky_error(); |
| 692 isolate->set_long_jump_base(base); | 696 isolate->set_long_jump_base(base); |
| 693 return result.raw(); | 697 return result.raw(); |
| 694 } | 698 } |
| 695 UNREACHABLE(); | 699 UNREACHABLE(); |
| 696 return Object::null(); | 700 return Object::null(); |
| 697 } | 701 } |
| 698 | 702 |
| 699 } // namespace dart | 703 } // namespace dart |
| OLD | NEW |